├── client
├── README.md
├── src
│ ├── assets
│ │ └── .gitkeep
│ ├── app
│ │ ├── app.component.css
│ │ ├── models
│ │ │ ├── navLinks.ts
│ │ │ ├── auth.spec.ts
│ │ │ ├── research.spec.ts
│ │ │ ├── auth.ts
│ │ │ └── research.ts
│ │ ├── pages
│ │ │ ├── welcome
│ │ │ │ ├── welcome.component.css
│ │ │ │ ├── welcome.component.html
│ │ │ │ ├── welcome.routes.ts
│ │ │ │ └── welcome.component.ts
│ │ │ ├── dashboard
│ │ │ │ ├── profile
│ │ │ │ │ ├── profile.component.css
│ │ │ │ │ ├── profile.component.html
│ │ │ │ │ ├── profile.component.ts
│ │ │ │ │ └── profile.component.spec.ts
│ │ │ │ ├── research
│ │ │ │ │ ├── home
│ │ │ │ │ │ ├── home.component.css
│ │ │ │ │ │ ├── home.component.html
│ │ │ │ │ │ ├── home.component.spec.ts
│ │ │ │ │ │ └── home.component.ts
│ │ │ │ │ ├── research.component.css
│ │ │ │ │ ├── research.component.html
│ │ │ │ │ ├── research.component.ts
│ │ │ │ │ ├── details
│ │ │ │ │ │ ├── details.component.spec.ts
│ │ │ │ │ │ ├── details.component.css
│ │ │ │ │ │ ├── details.component.html
│ │ │ │ │ │ └── details.component.ts
│ │ │ │ │ └── research.component.spec.ts
│ │ │ │ ├── settings
│ │ │ │ │ ├── settings.component.css
│ │ │ │ │ ├── settings.component.html
│ │ │ │ │ ├── settings.component.ts
│ │ │ │ │ └── settings.component.spec.ts
│ │ │ │ ├── documents
│ │ │ │ │ ├── documents.component.css
│ │ │ │ │ ├── documents.component.html
│ │ │ │ │ ├── documents.component.ts
│ │ │ │ │ └── documents.component.spec.ts
│ │ │ │ ├── home
│ │ │ │ │ ├── home.component.spec.ts
│ │ │ │ │ ├── home.component.css
│ │ │ │ │ ├── home.component.html
│ │ │ │ │ └── home.component.ts
│ │ │ │ ├── dashboard.component.spec.ts
│ │ │ │ ├── dashboard.component.html
│ │ │ │ ├── dashboard.component.ts
│ │ │ │ └── dashboard.component.css
│ │ │ ├── signin
│ │ │ │ ├── signin.component.css
│ │ │ │ ├── signin.component.spec.ts
│ │ │ │ ├── signin.component.html
│ │ │ │ └── signin.component.ts
│ │ │ └── signup
│ │ │ │ ├── signup.component.css
│ │ │ │ ├── signup.component.spec.ts
│ │ │ │ ├── signup.component.html
│ │ │ │ └── signup.component.ts
│ │ ├── components
│ │ │ ├── chatbox
│ │ │ │ ├── chatbox.component.css
│ │ │ │ ├── chatbox.component.spec.ts
│ │ │ │ ├── chatbox.component.html
│ │ │ │ └── chatbox.component.ts
│ │ │ ├── empty
│ │ │ │ ├── empty.component.css
│ │ │ │ ├── empty.component.html
│ │ │ │ ├── empty.component.ts
│ │ │ │ └── empty.component.spec.ts
│ │ │ └── forms
│ │ │ │ ├── review-form
│ │ │ │ ├── review-form.component.css
│ │ │ │ ├── review-form.component.spec.ts
│ │ │ │ ├── review-form.component.html
│ │ │ │ └── review-form.component.ts
│ │ │ │ └── create-query
│ │ │ │ ├── create-query.component.css
│ │ │ │ ├── create-query.component.spec.ts
│ │ │ │ ├── create-query.component.ts
│ │ │ │ └── create-query.component.html
│ │ ├── app.component.html
│ │ ├── utils
│ │ │ └── customFetch.ts
│ │ ├── modals
│ │ │ ├── edit
│ │ │ │ ├── edit.component.css
│ │ │ │ ├── edit.component.spec.ts
│ │ │ │ ├── edit.component.html
│ │ │ │ └── edit.component.ts
│ │ │ ├── create-query
│ │ │ │ ├── create-query.component.css
│ │ │ │ ├── create-query.component.spec.ts
│ │ │ │ ├── create-query.component.ts
│ │ │ │ └── create-query.component.html
│ │ │ └── create-review
│ │ │ │ ├── create-review.component.css
│ │ │ │ ├── create-review.component.spec.ts
│ │ │ │ ├── create-review.component.html
│ │ │ │ └── create-review.component.ts
│ │ ├── app.component.ts
│ │ ├── services
│ │ │ ├── api.service.spec.ts
│ │ │ ├── chat.service.spec.ts
│ │ │ ├── user.service.spec.ts
│ │ │ ├── general.service.spec.ts
│ │ │ ├── research.service.spec.ts
│ │ │ ├── chat.service.ts
│ │ │ ├── general.service.ts
│ │ │ ├── user.service.ts
│ │ │ ├── api.service.ts
│ │ │ └── research.service.ts
│ │ ├── auth
│ │ │ ├── guard.guard.ts
│ │ │ └── guard.guard.spec.ts
│ │ ├── interceptors
│ │ │ ├── auth.interceptor.spec.ts
│ │ │ └── auth.interceptor.ts
│ │ ├── app.config.ts
│ │ ├── app.component.spec.ts
│ │ └── app.routes.ts
│ ├── favicon.ico
│ ├── main.ts
│ ├── index.html
│ ├── theme.less
│ └── styles.css
├── .vscode
│ ├── extensions.json
│ ├── launch.json
│ └── tasks.json
├── tsconfig.app.json
├── tsconfig.spec.json
├── .editorconfig
├── .gitignore
├── tsconfig.json
├── package.json
└── angular.json
├── middleware
├── userMiddleware.js
├── not-found.js
└── authMiddleware.js
├── .gitignore
├── .gitattributes
├── .env-example
├── db
└── connect.js
├── routes
├── userRoutes.js
├── chatRoutes.js
├── authRoutes.js
└── researchRoutes.js
├── errors
├── notFound.js
└── unauthenticated.js
├── utils
├── filterScholarResponse.js
├── attachCookie.js
├── tokenUtils.js
├── openAiRequest.js
└── webScrapper.js
├── controllers
├── userController.js
├── authController.js
├── chatController.js
└── researchController.js
├── index.html
├── models
├── SystematicReview.js
├── FilterQuery.js
├── Chat.js
├── PrimaryStudies.js
├── ResearchPapers.js
└── User.js
├── 404.html
├── LICENSE
├── package.json
├── server.js
└── README.md
/client/README.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/client/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/middleware/userMiddleware.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/client/src/app/app.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/client/src/app/models/navLinks.ts:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .env
3 |
--------------------------------------------------------------------------------
/client/src/app/pages/welcome/welcome.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/client/src/app/components/chatbox/chatbox.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/client/src/app/pages/dashboard/profile/profile.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/client/src/app/pages/dashboard/research/home/home.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/client/src/app/pages/dashboard/research/research.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/client/src/app/pages/dashboard/settings/settings.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/client/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
welcome works!
2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /client/src/app/pages/dashboard/profile/profile.component.html: -------------------------------------------------------------------------------- 1 |profile works!
2 | -------------------------------------------------------------------------------- /client/src/app/pages/dashboard/settings/settings.component.html: -------------------------------------------------------------------------------- 1 |settings works!
2 | -------------------------------------------------------------------------------- /client/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ftoucch/weblit/HEAD/client/src/favicon.ico -------------------------------------------------------------------------------- /client/src/app/pages/dashboard/research/research.component.html: -------------------------------------------------------------------------------- 1 |2 | Document works. 3 |
4 | -------------------------------------------------------------------------------- /.env-example: -------------------------------------------------------------------------------- 1 | JWT_EXPIRES_IN 2 | JWT_SECRET 3 | MONGO_URL 4 | NODE_ENV 5 | OPEN_API_SECRET_KEY 6 | PORT 7 | -------------------------------------------------------------------------------- /client/src/app/components/empty/empty.component.css: -------------------------------------------------------------------------------- 1 | span { 2 | text-align: center; 3 | margin-inline: auto; 4 | } 5 | -------------------------------------------------------------------------------- /client/src/app/utils/customFetch.ts: -------------------------------------------------------------------------------- 1 | export const customFetch = ({ 2 | baseURL: 'http://localhost:5100/api/v1/', 3 | }); 4 | -------------------------------------------------------------------------------- /middleware/not-found.js: -------------------------------------------------------------------------------- 1 | const notFoundMiddleware = (req, res) => 2 | res.status(404).send('Route does not exist') 3 | 4 | export default notFoundMiddleware -------------------------------------------------------------------------------- /db/connect.js: -------------------------------------------------------------------------------- 1 | import mongoose from "mongoose"; 2 | 3 | const connectDB = (url) => { 4 | return mongoose.connect(url) 5 | } 6 | 7 | export default connectDB -------------------------------------------------------------------------------- /client/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /client/src/app/components/forms/review-form/review-form.component.css: -------------------------------------------------------------------------------- 1 | .form-actions { 2 | display: flex; 3 | gap: 1rem; 4 | } 5 | 6 | .btn { 7 | min-width: 60px ; 8 | } -------------------------------------------------------------------------------- /client/src/app/modals/edit/edit.component.css: -------------------------------------------------------------------------------- 1 | .form-input.large { 2 | min-height: 300px; 3 | } 4 | .form-input, 5 | .form-textarea, 6 | .form-select { 7 | background: transparent; 8 | } 9 | -------------------------------------------------------------------------------- /client/src/app/models/auth.spec.ts: -------------------------------------------------------------------------------- 1 | import { Auth } from './auth'; 2 | 3 | describe('Auth', () => { 4 | it('should create an instance', () => { 5 | expect(new Auth()).toBeTruthy(); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /client/src/app/modals/create-query/create-query.component.css: -------------------------------------------------------------------------------- 1 | .form-input.large { 2 | min-height: 120px; 3 | } 4 | .form-input, 5 | .form-textarea, 6 | .form-select { 7 | background: transparent; 8 | } 9 | -------------------------------------------------------------------------------- /client/src/app/modals/create-review/create-review.component.css: -------------------------------------------------------------------------------- 1 | .form-input.large { 2 | min-height: 300px; 3 | } 4 | .form-input, 5 | .form-textarea, 6 | .form-select { 7 | background: transparent; 8 | } 9 | -------------------------------------------------------------------------------- /client/src/app/models/research.spec.ts: -------------------------------------------------------------------------------- 1 | import { Research } from './research'; 2 | 3 | describe('Research', () => { 4 | it('should create an instance', () => { 5 | expect(new Research()).toBeTruthy(); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /routes/userRoutes.js: -------------------------------------------------------------------------------- 1 | import express from 'express'; 2 | import { getCurrentUser } from '../controllers/userController.js'; 3 | 4 | const router = express.Router(); 5 | 6 | router.route('/me').get(getCurrentUser) 7 | 8 | export default router -------------------------------------------------------------------------------- /client/src/app/pages/welcome/welcome.routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | import { WelcomeComponent } from './welcome.component'; 3 | 4 | export const WELCOME_ROUTES: Routes = [ 5 | { path: '', component: WelcomeComponent }, 6 | ]; 7 | -------------------------------------------------------------------------------- /errors/notFound.js: -------------------------------------------------------------------------------- 1 | class NotFoundError extends Error { 2 | constructor(message) { 3 | super(message); 4 | this.name = 'NotFoundError'; 5 | this.statusCode = 404; 6 | } 7 | } 8 | 9 | export default NotFoundError; 10 | -------------------------------------------------------------------------------- /routes/chatRoutes.js: -------------------------------------------------------------------------------- 1 | import express from 'express'; 2 | import { Startchat, getChatHistory } from '../controllers/chatController.js'; 3 | const router = express.Router(); 4 | 5 | router.route('/:id').post(Startchat).get(getChatHistory) 6 | 7 | export default router -------------------------------------------------------------------------------- /client/src/app/models/auth.ts: -------------------------------------------------------------------------------- 1 | export class Auth { 2 | } 3 | 4 | export class Signin { 5 | email: string = ''; 6 | password: string = ''; 7 | } 8 | 9 | 10 | export class Signup { 11 | name: string ='' ; 12 | email: string = ''; 13 | password: string = ''; 14 | } -------------------------------------------------------------------------------- /client/src/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { appConfig } from './app/app.config'; 3 | import { AppComponent } from './app/app.component'; 4 | 5 | bootstrapApplication(AppComponent, appConfig) 6 | .catch((err) => console.error(err)); 7 | -------------------------------------------------------------------------------- /utils/filterScholarResponse.js: -------------------------------------------------------------------------------- 1 | const filterScholarresponse = (data) => { 2 | const filteredPapers = data.data.filter( 3 | (paper) => paper.abstract !== null && paper.abstract.trim() !== '' 4 | ); 5 | return filteredPapers; 6 | }; 7 | 8 | export default filterScholarresponse; 9 | -------------------------------------------------------------------------------- /errors/unauthenticated.js: -------------------------------------------------------------------------------- 1 | import { StatusCodes } from 'http-status-codes' 2 | 3 | class UnAuthenticatedError extends Error { 4 | constructor(message) { 5 | super(message) 6 | this.statusCode = StatusCodes.UNAUTHORIZED 7 | } 8 | } 9 | 10 | export default UnAuthenticatedError -------------------------------------------------------------------------------- /routes/authRoutes.js: -------------------------------------------------------------------------------- 1 | import express from 'express'; 2 | import { register, login, logout} from '../controllers/authController.js'; 3 | 4 | const router = express.Router(); 5 | 6 | router.route('/register').post(register) 7 | router.route('/login').post(login) 8 | router.route('/logout').get(logout) 9 | 10 | 11 | export default router -------------------------------------------------------------------------------- /utils/attachCookie.js: -------------------------------------------------------------------------------- 1 | const attachCookie = ({ res, token }) => { 2 | const oneDay = 1000 * 60 * 60 * 24; 3 | 4 | res.cookie('token', token, { 5 | httpOnly: true, 6 | expires: new Date(Date.now() + oneDay), 7 | secure: process.env.NODE_ENV === 'production', 8 | }); 9 | }; 10 | 11 | export default attachCookie; 12 | -------------------------------------------------------------------------------- /client/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts" 10 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /client/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /client/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /client/src/app/components/forms/create-query/create-query.component.css: -------------------------------------------------------------------------------- 1 | .form-numbers-group { 2 | display: grid; 3 | grid-template-columns: repeat(3, 1fr); 4 | gap: 1rem; 5 | } 6 | 7 | textarea { 8 | min-height: 100px; 9 | } 10 | 11 | .form-actions { 12 | display: flex; 13 | gap: 1rem; 14 | } 15 | 16 | .btn { 17 | min-width: 60px ; 18 | } -------------------------------------------------------------------------------- /client/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |The requested route does not exist
30 |{{ chat.role }}: {{ chat.message }}
12 |59 | {{ truncateText(primaryStudy.abstract, i) }} 60 | 20" (click)="toggleAbstract(i)"> 61 | {{ expandedAbstracts[i] ? "Show Less" : "Read More" }} 62 | 63 |
64 | 67 | 75 |