From 44c05371d5b9845bab8e782e02c4a4f6810f8bda Mon Sep 17 00:00:00 2001 From: Louis-Antoine Caron Date: Fri, 5 Apr 2024 20:10:59 -0400 Subject: [PATCH] test --- client/.dockerignore | 2 ++ client/.env.example | 2 ++ client/.eslintrc.cjs | 18 +++++++++++++++ client/.prettierrc.json | 7 ++++++ client/Dockerfile | 2 +- client/LICENSE | 21 ++++++++++++++++++ client/pull_request_template.md | 13 +++++++++++ client/src/constants.tsx | 1 + .../src/pages/Student/JoinRoom/JoinRoom.tsx | 1 + .../pages/Teacher/ManageRoom/ManageRoom.tsx | 1 + client/vite.config.ts | 4 ++-- nginx/default.conf | 5 +++++ {client/rapport => rapport}/H24-iteration1.md | 0 .../Document-de-Recueil-de-User-Stories 2.md | 0 .../Document-de-Recueil-de-User-Stories.pdf | Bin .../documentation/SRS-PFE004.pdf | Bin .../Diagramme_de_conception_iteration2.svg | 0 .../Diagramme_de_deploiement_iteration2.svg | 0 ...ramme_de_sequence_join_room_iteration2.svg | 0 ...mme_de_sequence_manage_room_iteration2.svg | 0 .../Diagramme_conception_iteration4.svg | 0 ...e_de_sequence_creation_Room_iteration4.svg | 0 ...e_sequence_deroulement_quiz_iteration4.svg | 0 ...ramme_de_sequence_join_room_iteration4.svg | 0 .../Diagramme_deploiement_iteration4.svg | 0 .../rapport_iteration_1.md | 0 .../rapport_iteration_2.md | 0 .../rapport_iteration_3.md | 0 .../rapport_iteration_4.md | 0 server/.dockerignore | 2 ++ server/.env.example | 14 ++++++++++++ server/Dockerfile | 2 +- server/LICENSE | 21 ++++++++++++++++++ server/app.js | 4 ++-- server/controllers/folders.js | 2 +- server/controllers/images.js | 2 +- server/controllers/quiz.js | 2 +- server/controllers/users.js | 2 +- server/middleware/jwtToken.js | 2 +- server/models/users.js | 4 ++-- 40 files changed, 121 insertions(+), 13 deletions(-) create mode 100644 client/.dockerignore create mode 100644 client/.env.example create mode 100644 client/.eslintrc.cjs create mode 100644 client/.prettierrc.json create mode 100644 client/LICENSE create mode 100644 client/pull_request_template.md rename {client/rapport => rapport}/H24-iteration1.md (100%) rename {client/rapport => rapport}/documentation/Document-de-Recueil-de-User-Stories 2.md (100%) rename {client/rapport => rapport}/documentation/Document-de-Recueil-de-User-Stories.pdf (100%) rename {client/rapport => rapport}/documentation/SRS-PFE004.pdf (100%) rename {client/rapport => rapport}/documentation/diagrammes-iteration-2/Diagramme_de_conception_iteration2.svg (100%) rename {client/rapport => rapport}/documentation/diagrammes-iteration-2/Diagramme_de_deploiement_iteration2.svg (100%) rename {client/rapport => rapport}/documentation/diagrammes-iteration-2/Diagramme_de_sequence_join_room_iteration2.svg (100%) rename {client/rapport => rapport}/documentation/diagrammes-iteration-2/Diagramme_de_sequence_manage_room_iteration2.svg (100%) rename {client/rapport => rapport}/documentation/diagrammes-iteration-4/Diagramme_conception_iteration4.svg (100%) rename {client/rapport => rapport}/documentation/diagrammes-iteration-4/Diagramme_de_sequence_creation_Room_iteration4.svg (100%) rename {client/rapport => rapport}/documentation/diagrammes-iteration-4/Diagramme_de_sequence_deroulement_quiz_iteration4.svg (100%) rename {client/rapport => rapport}/documentation/diagrammes-iteration-4/Diagramme_de_sequence_join_room_iteration4.svg (100%) rename {client/rapport => rapport}/documentation/diagrammes-iteration-4/Diagramme_deploiement_iteration4.svg (100%) rename {client/rapport => rapport}/rapport_iteration_1.md (100%) rename {client/rapport => rapport}/rapport_iteration_2.md (100%) rename {client/rapport => rapport}/rapport_iteration_3.md (100%) rename {client/rapport => rapport}/rapport_iteration_4.md (100%) create mode 100644 server/.dockerignore create mode 100644 server/.env.example create mode 100644 server/LICENSE diff --git a/client/.dockerignore b/client/.dockerignore new file mode 100644 index 0000000..fb664ef --- /dev/null +++ b/client/.dockerignore @@ -0,0 +1,2 @@ +**/node_modules +.env \ No newline at end of file diff --git a/client/.env.example b/client/.env.example new file mode 100644 index 0000000..745dff1 --- /dev/null +++ b/client/.env.example @@ -0,0 +1,2 @@ +VITE_BACKEND_URL=localhost:4400 +VITE_AZURE_BACKEND_URL=localhost:4400 \ No newline at end of file diff --git a/client/.eslintrc.cjs b/client/.eslintrc.cjs new file mode 100644 index 0000000..d6c9537 --- /dev/null +++ b/client/.eslintrc.cjs @@ -0,0 +1,18 @@ +module.exports = { + root: true, + env: { browser: true, es2020: true }, + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:react-hooks/recommended', + ], + ignorePatterns: ['dist', '.eslintrc.cjs'], + parser: '@typescript-eslint/parser', + plugins: ['react-refresh'], + rules: { + 'react-refresh/only-export-components': [ + 'warn', + { allowConstantExport: true }, + ], + }, +} diff --git a/client/.prettierrc.json b/client/.prettierrc.json new file mode 100644 index 0000000..516a058 --- /dev/null +++ b/client/.prettierrc.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json.schemastore.org/prettierrc", + "tabWidth": 4, + "singleQuote": true, + "printWidth": 100, + "trailingComma": "none" +} diff --git a/client/Dockerfile b/client/Dockerfile index 7ead288..f1021e6 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -14,4 +14,4 @@ RUN npm run build EXPOSE 5173 -CMD [ "npm", "run", "preview" ] +CMD [ "npm", "run", "preview" ] \ No newline at end of file diff --git a/client/LICENSE b/client/LICENSE new file mode 100644 index 0000000..1e8b7d2 --- /dev/null +++ b/client/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 ETS-PFE004-Plateforme-sondage-minitest + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/client/pull_request_template.md b/client/pull_request_template.md new file mode 100644 index 0000000..f2040c3 --- /dev/null +++ b/client/pull_request_template.md @@ -0,0 +1,13 @@ +## PULL REQUEST + +## Description + +## Link to the ticket + +## Checklist before requesting a review +- [ ] I have performed a self-review of my code +- [ ] If it is a core feature, I have added thorough tests. +- [ ] Do we need to implement analytics? +- [ ] Will this be part of a product update? If yes, please write one phrase about this update. + + diff --git a/client/src/constants.tsx b/client/src/constants.tsx index dfd222a..2384427 100644 --- a/client/src/constants.tsx +++ b/client/src/constants.tsx @@ -3,4 +3,5 @@ const ENV_VARIABLES = { MODE: 'production', VITE_BACKEND_URL: import.meta.env.VITE_BACKEND_URL || "" }; + export { ENV_VARIABLES }; diff --git a/client/src/pages/Student/JoinRoom/JoinRoom.tsx b/client/src/pages/Student/JoinRoom/JoinRoom.tsx index 8d07d8a..23263db 100644 --- a/client/src/pages/Student/JoinRoom/JoinRoom.tsx +++ b/client/src/pages/Student/JoinRoom/JoinRoom.tsx @@ -35,6 +35,7 @@ const JoinRoom: React.FC = () => { const handleCreateSocket = () => { const socket = webSocketService.connect(ENV_VARIABLES.VITE_BACKEND_URL); + socket.on('join-success', () => { setIsWaitingForTeacher(true); setIsConnecting(false); diff --git a/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx b/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx index c4a03d1..6778b45 100644 --- a/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx +++ b/client/src/pages/Teacher/ManageRoom/ManageRoom.tsx @@ -82,6 +82,7 @@ const ManageRoom: React.FC = () => { const createWebSocketRoom = () => { setConnectingError(''); const socket = webSocketService.connect(ENV_VARIABLES.VITE_BACKEND_URL); + console.log(socket); socket.on('connect', () => { webSocketService.createRoom(); diff --git a/client/vite.config.ts b/client/vite.config.ts index 3b05929..b5ff1b6 100644 --- a/client/vite.config.ts +++ b/client/vite.config.ts @@ -14,9 +14,9 @@ export default defineConfig({ strictPort: true }, server: { - port: 8080, + port: 5173, strictPort: true, host: true, - origin: "http://0.0.0.0:8080", + origin: "http://0.0.0.0:5173", }, }); diff --git a/nginx/default.conf b/nginx/default.conf index 595cf1f..b698731 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -17,6 +17,11 @@ server { location /socket.io { rewrite /backend/(.*) /$1 break; proxy_pass http://backend; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $host; + proxy_hide_header 'Access-Control-Allow-Origin'; } location / { diff --git a/client/rapport/H24-iteration1.md b/rapport/H24-iteration1.md similarity index 100% rename from client/rapport/H24-iteration1.md rename to rapport/H24-iteration1.md diff --git a/client/rapport/documentation/Document-de-Recueil-de-User-Stories 2.md b/rapport/documentation/Document-de-Recueil-de-User-Stories 2.md similarity index 100% rename from client/rapport/documentation/Document-de-Recueil-de-User-Stories 2.md rename to rapport/documentation/Document-de-Recueil-de-User-Stories 2.md diff --git a/client/rapport/documentation/Document-de-Recueil-de-User-Stories.pdf b/rapport/documentation/Document-de-Recueil-de-User-Stories.pdf similarity index 100% rename from client/rapport/documentation/Document-de-Recueil-de-User-Stories.pdf rename to rapport/documentation/Document-de-Recueil-de-User-Stories.pdf diff --git a/client/rapport/documentation/SRS-PFE004.pdf b/rapport/documentation/SRS-PFE004.pdf similarity index 100% rename from client/rapport/documentation/SRS-PFE004.pdf rename to rapport/documentation/SRS-PFE004.pdf diff --git a/client/rapport/documentation/diagrammes-iteration-2/Diagramme_de_conception_iteration2.svg b/rapport/documentation/diagrammes-iteration-2/Diagramme_de_conception_iteration2.svg similarity index 100% rename from client/rapport/documentation/diagrammes-iteration-2/Diagramme_de_conception_iteration2.svg rename to rapport/documentation/diagrammes-iteration-2/Diagramme_de_conception_iteration2.svg diff --git a/client/rapport/documentation/diagrammes-iteration-2/Diagramme_de_deploiement_iteration2.svg b/rapport/documentation/diagrammes-iteration-2/Diagramme_de_deploiement_iteration2.svg similarity index 100% rename from client/rapport/documentation/diagrammes-iteration-2/Diagramme_de_deploiement_iteration2.svg rename to rapport/documentation/diagrammes-iteration-2/Diagramme_de_deploiement_iteration2.svg diff --git a/client/rapport/documentation/diagrammes-iteration-2/Diagramme_de_sequence_join_room_iteration2.svg b/rapport/documentation/diagrammes-iteration-2/Diagramme_de_sequence_join_room_iteration2.svg similarity index 100% rename from client/rapport/documentation/diagrammes-iteration-2/Diagramme_de_sequence_join_room_iteration2.svg rename to rapport/documentation/diagrammes-iteration-2/Diagramme_de_sequence_join_room_iteration2.svg diff --git a/client/rapport/documentation/diagrammes-iteration-2/Diagramme_de_sequence_manage_room_iteration2.svg b/rapport/documentation/diagrammes-iteration-2/Diagramme_de_sequence_manage_room_iteration2.svg similarity index 100% rename from client/rapport/documentation/diagrammes-iteration-2/Diagramme_de_sequence_manage_room_iteration2.svg rename to rapport/documentation/diagrammes-iteration-2/Diagramme_de_sequence_manage_room_iteration2.svg diff --git a/client/rapport/documentation/diagrammes-iteration-4/Diagramme_conception_iteration4.svg b/rapport/documentation/diagrammes-iteration-4/Diagramme_conception_iteration4.svg similarity index 100% rename from client/rapport/documentation/diagrammes-iteration-4/Diagramme_conception_iteration4.svg rename to rapport/documentation/diagrammes-iteration-4/Diagramme_conception_iteration4.svg diff --git a/client/rapport/documentation/diagrammes-iteration-4/Diagramme_de_sequence_creation_Room_iteration4.svg b/rapport/documentation/diagrammes-iteration-4/Diagramme_de_sequence_creation_Room_iteration4.svg similarity index 100% rename from client/rapport/documentation/diagrammes-iteration-4/Diagramme_de_sequence_creation_Room_iteration4.svg rename to rapport/documentation/diagrammes-iteration-4/Diagramme_de_sequence_creation_Room_iteration4.svg diff --git a/client/rapport/documentation/diagrammes-iteration-4/Diagramme_de_sequence_deroulement_quiz_iteration4.svg b/rapport/documentation/diagrammes-iteration-4/Diagramme_de_sequence_deroulement_quiz_iteration4.svg similarity index 100% rename from client/rapport/documentation/diagrammes-iteration-4/Diagramme_de_sequence_deroulement_quiz_iteration4.svg rename to rapport/documentation/diagrammes-iteration-4/Diagramme_de_sequence_deroulement_quiz_iteration4.svg diff --git a/client/rapport/documentation/diagrammes-iteration-4/Diagramme_de_sequence_join_room_iteration4.svg b/rapport/documentation/diagrammes-iteration-4/Diagramme_de_sequence_join_room_iteration4.svg similarity index 100% rename from client/rapport/documentation/diagrammes-iteration-4/Diagramme_de_sequence_join_room_iteration4.svg rename to rapport/documentation/diagrammes-iteration-4/Diagramme_de_sequence_join_room_iteration4.svg diff --git a/client/rapport/documentation/diagrammes-iteration-4/Diagramme_deploiement_iteration4.svg b/rapport/documentation/diagrammes-iteration-4/Diagramme_deploiement_iteration4.svg similarity index 100% rename from client/rapport/documentation/diagrammes-iteration-4/Diagramme_deploiement_iteration4.svg rename to rapport/documentation/diagrammes-iteration-4/Diagramme_deploiement_iteration4.svg diff --git a/client/rapport/rapport_iteration_1.md b/rapport/rapport_iteration_1.md similarity index 100% rename from client/rapport/rapport_iteration_1.md rename to rapport/rapport_iteration_1.md diff --git a/client/rapport/rapport_iteration_2.md b/rapport/rapport_iteration_2.md similarity index 100% rename from client/rapport/rapport_iteration_2.md rename to rapport/rapport_iteration_2.md diff --git a/client/rapport/rapport_iteration_3.md b/rapport/rapport_iteration_3.md similarity index 100% rename from client/rapport/rapport_iteration_3.md rename to rapport/rapport_iteration_3.md diff --git a/client/rapport/rapport_iteration_4.md b/rapport/rapport_iteration_4.md similarity index 100% rename from client/rapport/rapport_iteration_4.md rename to rapport/rapport_iteration_4.md diff --git a/server/.dockerignore b/server/.dockerignore new file mode 100644 index 0000000..fb664ef --- /dev/null +++ b/server/.dockerignore @@ -0,0 +1,2 @@ +**/node_modules +.env \ No newline at end of file diff --git a/server/.env.example b/server/.env.example new file mode 100644 index 0000000..b362ba8 --- /dev/null +++ b/server/.env.example @@ -0,0 +1,14 @@ +# Config serveur +PORT=4400 + +# Config BD +MONGO_URI=mongodb://localhost:27017 +MONGO_DATABASE=evaluetonsavoir + +# Config emails +EMAIL_SERVICE=gmail +SENDER_EMAIL=infoevaluetonsavoir@gmail.com +EMAIL_PSW='vvml wmfr dkzb vjzb' + +# JSON Web Token +JWT_SECRET=TOKEN! \ No newline at end of file diff --git a/server/Dockerfile b/server/Dockerfile index 175a72d..02bb17e 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -8,6 +8,6 @@ RUN npm install COPY ./ . -EXPOSE 3000 +EXPOSE 4400 CMD ["npm", "run", "start"] \ No newline at end of file diff --git a/server/LICENSE b/server/LICENSE new file mode 100644 index 0000000..1e8b7d2 --- /dev/null +++ b/server/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 ETS-PFE004-Plateforme-sondage-minitest + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/server/app.js b/server/app.js index 1a62957..76053ba 100644 --- a/server/app.js +++ b/server/app.js @@ -4,7 +4,7 @@ const http = require("http"); const dotenv = require('dotenv') // Import Sockets -const { setupWebsocket } = require("./socket/socket.js"); +const { setupWebsocket } = require("./socket/socket"); const { Server } = require("socket.io"); //import routers @@ -54,7 +54,7 @@ app.use(errorHandler) // Start server async function start() { - const port = process.env.PORT || 3000; + const port = process.env.PORT || 4400; // Check DB connection await db.connect() diff --git a/server/controllers/folders.js b/server/controllers/folders.js index a050d83..17a5039 100644 --- a/server/controllers/folders.js +++ b/server/controllers/folders.js @@ -2,7 +2,7 @@ const model = require('../models/folders.js'); const AppError = require('../middleware/AppError.js'); -const { MISSING_REQUIRED_PARAMETER, NOT_IMPLEMENTED, FOLDER_NOT_FOUND, FOLDER_ALREADY_EXISTS, GETTING_FOLDER_ERROR, DELETE_FOLDER_ERROR, UPDATE_FOLDER_ERROR, MOVING_FOLDER_ERROR, DUPLICATE_FOLDER_ERROR, COPY_FOLDER_ERROR } = require('../constants/errorCodes.js'); +const { MISSING_REQUIRED_PARAMETER, NOT_IMPLEMENTED, FOLDER_NOT_FOUND, FOLDER_ALREADY_EXISTS, GETTING_FOLDER_ERROR, DELETE_FOLDER_ERROR, UPDATE_FOLDER_ERROR, MOVING_FOLDER_ERROR, DUPLICATE_FOLDER_ERROR, COPY_FOLDER_ERROR } = require('../constants/errorCodes'); class FoldersController { diff --git a/server/controllers/images.js b/server/controllers/images.js index 51cfb52..757961c 100644 --- a/server/controllers/images.js +++ b/server/controllers/images.js @@ -1,7 +1,7 @@ const model = require('../models/images.js'); const AppError = require('../middleware/AppError.js'); -const { MISSING_REQUIRED_PARAMETER, IMAGE_NOT_FOUND } = require('../constants/errorCodes.js'); +const { MISSING_REQUIRED_PARAMETER, IMAGE_NOT_FOUND } = require('../constants/errorCodes'); class ImagesController { diff --git a/server/controllers/quiz.js b/server/controllers/quiz.js index 43af3db..8b8b247 100644 --- a/server/controllers/quiz.js +++ b/server/controllers/quiz.js @@ -3,7 +3,7 @@ const folderModel = require('../models/folders.js'); const emailer = require('../config/email.js'); const AppError = require('../middleware/AppError.js'); -const { MISSING_REQUIRED_PARAMETER, NOT_IMPLEMENTED, QUIZ_NOT_FOUND, FOLDER_NOT_FOUND, QUIZ_ALREADY_EXISTS, GETTING_QUIZ_ERROR, DELETE_QUIZ_ERROR, UPDATE_QUIZ_ERROR, MOVING_QUIZ_ERROR, DUPLICATE_QUIZ_ERROR, COPY_QUIZ_ERROR } = require('../constants/errorCodes.js'); +const { MISSING_REQUIRED_PARAMETER, NOT_IMPLEMENTED, QUIZ_NOT_FOUND, FOLDER_NOT_FOUND, QUIZ_ALREADY_EXISTS, GETTING_QUIZ_ERROR, DELETE_QUIZ_ERROR, UPDATE_QUIZ_ERROR, MOVING_QUIZ_ERROR, DUPLICATE_QUIZ_ERROR, COPY_QUIZ_ERROR } = require('../constants/errorCodes'); class QuizController { diff --git a/server/controllers/users.js b/server/controllers/users.js index 7981016..4494f1d 100644 --- a/server/controllers/users.js +++ b/server/controllers/users.js @@ -3,7 +3,7 @@ const model = require('../models/users.js'); const jwt = require('../middleware/jwtToken.js'); const AppError = require('../middleware/AppError.js'); -const { MISSING_REQUIRED_PARAMETER, LOGIN_CREDENTIALS_ERROR, GENERATE_PASSWORD_ERROR, UPDATE_PASSWORD_ERROR, DELETE_USER_ERROR } = require('../constants/errorCodes.js'); +const { MISSING_REQUIRED_PARAMETER, LOGIN_CREDENTIALS_ERROR, GENERATE_PASSWORD_ERROR, UPDATE_PASSWORD_ERROR, DELETE_USER_ERROR } = require('../constants/errorCodes'); class UsersController { diff --git a/server/middleware/jwtToken.js b/server/middleware/jwtToken.js index ba713ac..292e591 100644 --- a/server/middleware/jwtToken.js +++ b/server/middleware/jwtToken.js @@ -1,7 +1,7 @@ const jwt = require('jsonwebtoken') const dotenv = require('dotenv') const AppError = require('./AppError.js'); -const { UNAUTHORIZED_NO_TOKEN_GIVEN, UNAUTHORIZED_INVALID_TOKEN } = require('../constants/errorCodes.js'); +const { UNAUTHORIZED_NO_TOKEN_GIVEN, UNAUTHORIZED_INVALID_TOKEN } = require('../constants/errorCodes'); dotenv.config(); diff --git a/server/models/users.js b/server/models/users.js index 926c42e..caef0a1 100644 --- a/server/models/users.js +++ b/server/models/users.js @@ -2,8 +2,8 @@ const db = require('../config/db.js'); const bcrypt = require('bcrypt'); const AppError = require('../middleware/AppError.js'); -const { USER_ALREADY_EXISTS } = require('../constants/errorCodes.js'); -const Folders = require('./folders.js'); +const { USER_ALREADY_EXISTS } = require('../constants/errorCodes'); +const Folders = require('../models/folders.js'); class Users {