└── chatApp ├── .gitignore ├── README.md ├── api ├── index.js ├── models │ ├── Message.js │ └── User.js ├── package-lock.json ├── package.json ├── uploads │ ├── 1708189408875.jpg │ ├── 1708190956543.jpg │ ├── 1708191074940.mp4 │ ├── 1708191988390.jpg │ └── 1708192085590.jpg ├── uploads1708189089759.jpg └── uploads1708189243630.jpg └── client ├── .eslintrc.cjs ├── .gitignore ├── README.md ├── index.html ├── package-lock.json ├── package.json ├── postcss.config.js ├── public └── vite.svg ├── src ├── App.jsx ├── Avatar.jsx ├── Chat.jsx ├── Contact.jsx ├── Logo.jsx ├── RegisterAndLoginForm.jsx ├── Routes.jsx ├── UserContext.jsx ├── assets │ └── react.svg ├── index.css └── main.jsx ├── tailwind.config.js └── vite.config.js /chatApp/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env -------------------------------------------------------------------------------- /chatApp/README.md: -------------------------------------------------------------------------------- 1 | # Chat-WebApp using MERN Stack 2 | -------------------------------------------------------------------------------- /chatApp/api/index.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); //#1 2 | const mongoose = require("mongoose"); //#1 3 | const cookieParser = require("cookie-parser"); //#3 4 | const bcrypt = require("bcryptjs"); //#3 5 | const dotenv = require("dotenv"); //#1 6 | const User = require("./models/User"); //#2 7 | const Message = require("./models/Message"); //#2 8 | const jwt = require("jsonwebtoken"); //#1 9 | const cors = require("cors"); //#1 10 | const ws = require("ws"); //#1 11 | const fs = require('fs') 12 | 13 | dotenv.config(); 14 | 15 | const app = express(); //!important 16 | app.use('/uploads',express.static(__dirname+'/uploads')) 17 | app.use(express.json()); //!important 18 | app.use(cookieParser()); //!important 19 | app.use( 20 | cors({ 21 | credentials: true, 22 | origin: process.env.CLIENT_URL, 23 | }) 24 | ); //!important 25 | 26 | // Update your MongoDB connection code like this: 27 | mongoose 28 | .connect(process.env.MONGO_URL) 29 | .then(() => { 30 | console.log("Connected to MongoDB"); 31 | }) 32 | .catch((err) => { 33 | console.error("Error connecting to MongoDB:", err); 34 | }); //!important 35 | 36 | const jwtSecret = process.env.JWT_SECRET; 37 | const bcryptSalt = bcrypt.genSaltSync(10); 38 | 39 | app.get("/test", (req, res) => { 40 | res.json("test ok"); 41 | }); 42 | 43 | function getUserDataFromRequest(req) { 44 | return new Promise((resolve, reject) => { 45 | const token = req.cookies?.token; 46 | if (token) { 47 | jwt.verify(token, jwtSecret, {}, (err, userData) => { 48 | if (err) throw err; 49 | resolve(userData); 50 | }); 51 | } else { 52 | reject("no token"); 53 | } 54 | }); 55 | } 56 | 57 | app.get("/messages/:userId", async (req, res) => { 58 | const { userId } = req.params; 59 | const userData = await getUserDataFromRequest(req); 60 | const ourUserId = userData.userId; 61 | const messages = await Message.find({ 62 | sender: { $in: [userId, ourUserId] }, 63 | recipient: { $in: [userId, ourUserId] }, 64 | }).sort({ createdAt: 1 }); 65 | res.json(messages); 66 | }); 67 | 68 | app.get("/people", async (req, res) => { 69 | const Users = await User.find({}, { _id: 1, username: 1 }); 70 | res.json(Users); 71 | }); 72 | 73 | app.get("/profile", (req, res) => { 74 | const token = req.cookies?.token; 75 | if (token) { 76 | jwt.verify(token, jwtSecret, {}, (err, userData) => { 77 | if (err) { 78 | console.error(err); 79 | res.status(401).json("Invalid token"); 80 | } else { 81 | res.json(userData); 82 | } 83 | }); 84 | } else { 85 | res.status(401).json("No token"); 86 | } 87 | }); 88 | 89 | app.post("/login", async (req, res) => { 90 | const { username, password } = req.body; 91 | const foundUser = await User.findOne({ username }); 92 | 93 | if (foundUser) { 94 | const passOk = bcrypt.compareSync(password, foundUser.password); 95 | if (passOk) { 96 | jwt.sign( 97 | { userId: foundUser._id, username }, 98 | jwtSecret, 99 | {}, 100 | (err, token) => { 101 | if (err) throw err; 102 | res.cookie("token", token, { sameSite: "none", secure: true }).json({ 103 | id: foundUser._id, 104 | }); 105 | } 106 | ); 107 | } else { 108 | res.status(401).json("Invalid Password"); 109 | } 110 | } else { 111 | res.status(401).json("User not found"); 112 | } 113 | }); 114 | 115 | app.post("/logout", (req, res) => { 116 | res.cookie("token", '', { sameSite: "none", secure: true }).json('ok') 117 | }); 118 | 119 | // ... 120 | 121 | app.post("/register", async (req, res) => { 122 | const { username, password } = req.body; 123 | try { 124 | const hashedPassword = bcrypt.hashSync(password, bcryptSalt); 125 | const createdUser = await User.create({ 126 | username, 127 | password: hashedPassword, 128 | }); 129 | jwt.sign( 130 | { userId: createdUser._id, username }, 131 | jwtSecret, 132 | {}, 133 | (err, token) => { 134 | if (err) throw err; 135 | res 136 | .cookie("token", token, { sameSite: "none", secure: true }) 137 | .status(201) 138 | .json({ 139 | id: createdUser._id, 140 | }); 141 | } 142 | ); 143 | } catch (err) { 144 | console.error(err); 145 | res.status(500).json("error"); 146 | } 147 | }); 148 | 149 | const server = app.listen(4000, () => { 150 | console.log("server running ...."); 151 | }); 152 | 153 | const wss = new ws.WebSocketServer({ server }); 154 | 155 | const activeUsers = new Set(); 156 | 157 | wss.on("connection", (connection, req) => { 158 | //read username and id form the cookies for this connection 159 | 160 | function notifyAboutOnlinePeople(){ 161 | wss.clients.forEach((client) => { 162 | client.send( 163 | JSON.stringify({ 164 | online: [...wss.clients].map((c) => ({ 165 | userId: c.userId, 166 | username: c.username, 167 | })), 168 | }) 169 | ); 170 | }); 171 | } 172 | 173 | connection.isAlive = true; 174 | 175 | connection.timer = setInterval(() => { 176 | connection.ping(); 177 | connection.deathTimer = setTimeout(() => { 178 | connection.isAlive = false; 179 | clearInterval(connection.timer); 180 | connection.terminate(); 181 | notifyAboutOnlinePeople(); 182 | },1000); 183 | },1000); 184 | 185 | connection.on("pong",()=>{ 186 | clearTimeout(connection.deathTimer); 187 | }); 188 | 189 | const cookies = req.headers.cookie; 190 | if (cookies) { 191 | const tokenCookieString = cookies 192 | .split(";") 193 | .find((str) => str.trim().startsWith("token=")); 194 | if (tokenCookieString) { 195 | const token = tokenCookieString.split("=")[1]; 196 | if (token) { 197 | jwt.verify(token, jwtSecret, {}, (err, userData) => { 198 | if (err) throw err; 199 | const { userId, username } = userData; 200 | connection.userId = userId; 201 | connection.username = username; 202 | }); 203 | } 204 | } 205 | } 206 | 207 | 208 | connection.on("message", async (message, isBinary) => { 209 | messageData = JSON.parse(message.toString()); 210 | const { recipient, text ,file} = messageData; 211 | let filename = null; 212 | 213 | if(file){ 214 | const parts = file.name.split('.') 215 | const ext =parts[parts.length-1] 216 | filename = Date.now()+'.'+ext; 217 | const path = __dirname+'/uploads/'+filename; 218 | const bufferData = Buffer.from(file.data.split(',')[1],'base64'); 219 | fs.writeFile(path,bufferData,()=>{ 220 | }) 221 | } 222 | 223 | if (recipient && (text || file)) { 224 | const messageDoc = await Message.create({ 225 | sender: connection.userId, 226 | recipient, 227 | text, 228 | file: file ? filename : null, 229 | }); 230 | Array.from(wss.clients) 231 | .filter((c) => c.userId === recipient) 232 | .forEach((c) => 233 | c.send( 234 | JSON.stringify({ 235 | text, 236 | sender: connection.userId, 237 | recipient, 238 | file: file ? filename : null, 239 | _id: messageDoc._id, 240 | }) 241 | ) 242 | ); 243 | } 244 | }); 245 | 246 | 247 | 248 | 249 | //notify everyone about online people (when someone connected) 250 | notifyAboutOnlinePeople() 251 | }); 252 | -------------------------------------------------------------------------------- /chatApp/api/models/Message.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose') 2 | 3 | const MessageSchema = new mongoose.Schema({ 4 | sender:{type:mongoose.Schema.Types.ObjectId,ref:'User'}, 5 | recipient:{type:mongoose.Schema.Types.ObjectId,ref:'user'}, 6 | text:String, 7 | file: String, 8 | },{timestamps:true}); 9 | 10 | const messageModel = mongoose.model('Message,',MessageSchema); 11 | 12 | module.exports = messageModel; -------------------------------------------------------------------------------- /chatApp/api/models/User.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose') 2 | 3 | const UserSchema = new mongoose.Schema({ 4 | username: { type: String, unique: true }, 5 | password: String, 6 | }, { timestamps: true }); 7 | 8 | const UserModel = mongoose.model('User', UserSchema); 9 | module.exports = UserModel; -------------------------------------------------------------------------------- /chatApp/api/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "api", 3 | "lockfileVersion": 3, 4 | "requires": true, 5 | "packages": { 6 | "": { 7 | "dependencies": { 8 | "bcryptjs": "^2.4.3", 9 | "cookie-parser": "^1.4.6", 10 | "cors": "^2.8.5", 11 | "dotenv": "^16.3.1", 12 | "express": "^4.18.2", 13 | "jsonwebtoken": "^9.0.2", 14 | "mongoose": "^7.6.3", 15 | "ws": "^8.14.2" 16 | }, 17 | "devDependencies": { 18 | "nodemon": "^3.0.1" 19 | } 20 | }, 21 | "node_modules/@mongodb-js/saslprep": { 22 | "version": "1.1.0", 23 | "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.0.tgz", 24 | "integrity": "sha512-Xfijy7HvfzzqiOAhAepF4SGN5e9leLkMvg/OPOF97XemjfVCYN/oWa75wnkc6mltMSTwY+XlbhWgUOJmkFspSw==", 25 | "optional": true, 26 | "dependencies": { 27 | "sparse-bitfield": "^3.0.3" 28 | } 29 | }, 30 | "node_modules/@types/node": { 31 | "version": "20.8.9", 32 | "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.9.tgz", 33 | "integrity": "sha512-UzykFsT3FhHb1h7yD4CA4YhBHq545JC0YnEz41xkipN88eKQtL6rSgocL5tbAP6Ola9Izm/Aw4Ora8He4x0BHg==", 34 | "dependencies": { 35 | "undici-types": "~5.26.4" 36 | } 37 | }, 38 | "node_modules/@types/webidl-conversions": { 39 | "version": "7.0.2", 40 | "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.2.tgz", 41 | "integrity": "sha512-uNv6b/uGRLlCVmelat2rA8bcVd3k/42mV2EmjhPh6JLkd35T5bgwR/t6xy7a9MWhd9sixIeBUzhBenvk3NO+DQ==" 42 | }, 43 | "node_modules/@types/whatwg-url": { 44 | "version": "8.2.2", 45 | "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.2.tgz", 46 | "integrity": "sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA==", 47 | "dependencies": { 48 | "@types/node": "*", 49 | "@types/webidl-conversions": "*" 50 | } 51 | }, 52 | "node_modules/abbrev": { 53 | "version": "1.1.1", 54 | "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", 55 | "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", 56 | "dev": true 57 | }, 58 | "node_modules/accepts": { 59 | "version": "1.3.8", 60 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", 61 | "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", 62 | "dependencies": { 63 | "mime-types": "~2.1.34", 64 | "negotiator": "0.6.3" 65 | }, 66 | "engines": { 67 | "node": ">= 0.6" 68 | } 69 | }, 70 | "node_modules/anymatch": { 71 | "version": "3.1.3", 72 | "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", 73 | "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", 74 | "dev": true, 75 | "dependencies": { 76 | "normalize-path": "^3.0.0", 77 | "picomatch": "^2.0.4" 78 | }, 79 | "engines": { 80 | "node": ">= 8" 81 | } 82 | }, 83 | "node_modules/array-flatten": { 84 | "version": "1.1.1", 85 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 86 | "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" 87 | }, 88 | "node_modules/balanced-match": { 89 | "version": "1.0.2", 90 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 91 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", 92 | "dev": true 93 | }, 94 | "node_modules/bcryptjs": { 95 | "version": "2.4.3", 96 | "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", 97 | "integrity": "sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==" 98 | }, 99 | "node_modules/binary-extensions": { 100 | "version": "2.2.0", 101 | "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", 102 | "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", 103 | "dev": true, 104 | "engines": { 105 | "node": ">=8" 106 | } 107 | }, 108 | "node_modules/body-parser": { 109 | "version": "1.20.1", 110 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", 111 | "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", 112 | "dependencies": { 113 | "bytes": "3.1.2", 114 | "content-type": "~1.0.4", 115 | "debug": "2.6.9", 116 | "depd": "2.0.0", 117 | "destroy": "1.2.0", 118 | "http-errors": "2.0.0", 119 | "iconv-lite": "0.4.24", 120 | "on-finished": "2.4.1", 121 | "qs": "6.11.0", 122 | "raw-body": "2.5.1", 123 | "type-is": "~1.6.18", 124 | "unpipe": "1.0.0" 125 | }, 126 | "engines": { 127 | "node": ">= 0.8", 128 | "npm": "1.2.8000 || >= 1.4.16" 129 | } 130 | }, 131 | "node_modules/brace-expansion": { 132 | "version": "1.1.11", 133 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 134 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 135 | "dev": true, 136 | "dependencies": { 137 | "balanced-match": "^1.0.0", 138 | "concat-map": "0.0.1" 139 | } 140 | }, 141 | "node_modules/braces": { 142 | "version": "3.0.2", 143 | "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", 144 | "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", 145 | "dev": true, 146 | "dependencies": { 147 | "fill-range": "^7.0.1" 148 | }, 149 | "engines": { 150 | "node": ">=8" 151 | } 152 | }, 153 | "node_modules/bson": { 154 | "version": "5.5.1", 155 | "resolved": "https://registry.npmjs.org/bson/-/bson-5.5.1.tgz", 156 | "integrity": "sha512-ix0EwukN2EpC0SRWIj/7B5+A6uQMQy6KMREI9qQqvgpkV2frH63T0UDVd1SYedL6dNCmDBYB3QtXi4ISk9YT+g==", 157 | "engines": { 158 | "node": ">=14.20.1" 159 | } 160 | }, 161 | "node_modules/buffer-equal-constant-time": { 162 | "version": "1.0.1", 163 | "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", 164 | "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" 165 | }, 166 | "node_modules/bytes": { 167 | "version": "3.1.2", 168 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", 169 | "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", 170 | "engines": { 171 | "node": ">= 0.8" 172 | } 173 | }, 174 | "node_modules/call-bind": { 175 | "version": "1.0.5", 176 | "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", 177 | "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", 178 | "dependencies": { 179 | "function-bind": "^1.1.2", 180 | "get-intrinsic": "^1.2.1", 181 | "set-function-length": "^1.1.1" 182 | }, 183 | "funding": { 184 | "url": "https://github.com/sponsors/ljharb" 185 | } 186 | }, 187 | "node_modules/chokidar": { 188 | "version": "3.5.3", 189 | "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", 190 | "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", 191 | "dev": true, 192 | "funding": [ 193 | { 194 | "type": "individual", 195 | "url": "https://paulmillr.com/funding/" 196 | } 197 | ], 198 | "dependencies": { 199 | "anymatch": "~3.1.2", 200 | "braces": "~3.0.2", 201 | "glob-parent": "~5.1.2", 202 | "is-binary-path": "~2.1.0", 203 | "is-glob": "~4.0.1", 204 | "normalize-path": "~3.0.0", 205 | "readdirp": "~3.6.0" 206 | }, 207 | "engines": { 208 | "node": ">= 8.10.0" 209 | }, 210 | "optionalDependencies": { 211 | "fsevents": "~2.3.2" 212 | } 213 | }, 214 | "node_modules/concat-map": { 215 | "version": "0.0.1", 216 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 217 | "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", 218 | "dev": true 219 | }, 220 | "node_modules/content-disposition": { 221 | "version": "0.5.4", 222 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", 223 | "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", 224 | "dependencies": { 225 | "safe-buffer": "5.2.1" 226 | }, 227 | "engines": { 228 | "node": ">= 0.6" 229 | } 230 | }, 231 | "node_modules/content-type": { 232 | "version": "1.0.5", 233 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", 234 | "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", 235 | "engines": { 236 | "node": ">= 0.6" 237 | } 238 | }, 239 | "node_modules/cookie": { 240 | "version": "0.5.0", 241 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", 242 | "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", 243 | "engines": { 244 | "node": ">= 0.6" 245 | } 246 | }, 247 | "node_modules/cookie-parser": { 248 | "version": "1.4.6", 249 | "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.6.tgz", 250 | "integrity": "sha512-z3IzaNjdwUC2olLIB5/ITd0/setiaFMLYiZJle7xg5Fe9KWAceil7xszYfHHBtDFYLSgJduS2Ty0P1uJdPDJeA==", 251 | "dependencies": { 252 | "cookie": "0.4.1", 253 | "cookie-signature": "1.0.6" 254 | }, 255 | "engines": { 256 | "node": ">= 0.8.0" 257 | } 258 | }, 259 | "node_modules/cookie-parser/node_modules/cookie": { 260 | "version": "0.4.1", 261 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", 262 | "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==", 263 | "engines": { 264 | "node": ">= 0.6" 265 | } 266 | }, 267 | "node_modules/cookie-signature": { 268 | "version": "1.0.6", 269 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 270 | "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" 271 | }, 272 | "node_modules/cors": { 273 | "version": "2.8.5", 274 | "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", 275 | "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", 276 | "dependencies": { 277 | "object-assign": "^4", 278 | "vary": "^1" 279 | }, 280 | "engines": { 281 | "node": ">= 0.10" 282 | } 283 | }, 284 | "node_modules/debug": { 285 | "version": "2.6.9", 286 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 287 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 288 | "dependencies": { 289 | "ms": "2.0.0" 290 | } 291 | }, 292 | "node_modules/define-data-property": { 293 | "version": "1.1.1", 294 | "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", 295 | "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", 296 | "dependencies": { 297 | "get-intrinsic": "^1.2.1", 298 | "gopd": "^1.0.1", 299 | "has-property-descriptors": "^1.0.0" 300 | }, 301 | "engines": { 302 | "node": ">= 0.4" 303 | } 304 | }, 305 | "node_modules/depd": { 306 | "version": "2.0.0", 307 | "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 308 | "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", 309 | "engines": { 310 | "node": ">= 0.8" 311 | } 312 | }, 313 | "node_modules/destroy": { 314 | "version": "1.2.0", 315 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", 316 | "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", 317 | "engines": { 318 | "node": ">= 0.8", 319 | "npm": "1.2.8000 || >= 1.4.16" 320 | } 321 | }, 322 | "node_modules/dotenv": { 323 | "version": "16.3.1", 324 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", 325 | "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", 326 | "engines": { 327 | "node": ">=12" 328 | }, 329 | "funding": { 330 | "url": "https://github.com/motdotla/dotenv?sponsor=1" 331 | } 332 | }, 333 | "node_modules/ecdsa-sig-formatter": { 334 | "version": "1.0.11", 335 | "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", 336 | "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", 337 | "dependencies": { 338 | "safe-buffer": "^5.0.1" 339 | } 340 | }, 341 | "node_modules/ee-first": { 342 | "version": "1.1.1", 343 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 344 | "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" 345 | }, 346 | "node_modules/encodeurl": { 347 | "version": "1.0.2", 348 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 349 | "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", 350 | "engines": { 351 | "node": ">= 0.8" 352 | } 353 | }, 354 | "node_modules/escape-html": { 355 | "version": "1.0.3", 356 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 357 | "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" 358 | }, 359 | "node_modules/etag": { 360 | "version": "1.8.1", 361 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 362 | "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", 363 | "engines": { 364 | "node": ">= 0.6" 365 | } 366 | }, 367 | "node_modules/express": { 368 | "version": "4.18.2", 369 | "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", 370 | "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", 371 | "dependencies": { 372 | "accepts": "~1.3.8", 373 | "array-flatten": "1.1.1", 374 | "body-parser": "1.20.1", 375 | "content-disposition": "0.5.4", 376 | "content-type": "~1.0.4", 377 | "cookie": "0.5.0", 378 | "cookie-signature": "1.0.6", 379 | "debug": "2.6.9", 380 | "depd": "2.0.0", 381 | "encodeurl": "~1.0.2", 382 | "escape-html": "~1.0.3", 383 | "etag": "~1.8.1", 384 | "finalhandler": "1.2.0", 385 | "fresh": "0.5.2", 386 | "http-errors": "2.0.0", 387 | "merge-descriptors": "1.0.1", 388 | "methods": "~1.1.2", 389 | "on-finished": "2.4.1", 390 | "parseurl": "~1.3.3", 391 | "path-to-regexp": "0.1.7", 392 | "proxy-addr": "~2.0.7", 393 | "qs": "6.11.0", 394 | "range-parser": "~1.2.1", 395 | "safe-buffer": "5.2.1", 396 | "send": "0.18.0", 397 | "serve-static": "1.15.0", 398 | "setprototypeof": "1.2.0", 399 | "statuses": "2.0.1", 400 | "type-is": "~1.6.18", 401 | "utils-merge": "1.0.1", 402 | "vary": "~1.1.2" 403 | }, 404 | "engines": { 405 | "node": ">= 0.10.0" 406 | } 407 | }, 408 | "node_modules/fill-range": { 409 | "version": "7.0.1", 410 | "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", 411 | "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", 412 | "dev": true, 413 | "dependencies": { 414 | "to-regex-range": "^5.0.1" 415 | }, 416 | "engines": { 417 | "node": ">=8" 418 | } 419 | }, 420 | "node_modules/finalhandler": { 421 | "version": "1.2.0", 422 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", 423 | "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", 424 | "dependencies": { 425 | "debug": "2.6.9", 426 | "encodeurl": "~1.0.2", 427 | "escape-html": "~1.0.3", 428 | "on-finished": "2.4.1", 429 | "parseurl": "~1.3.3", 430 | "statuses": "2.0.1", 431 | "unpipe": "~1.0.0" 432 | }, 433 | "engines": { 434 | "node": ">= 0.8" 435 | } 436 | }, 437 | "node_modules/forwarded": { 438 | "version": "0.2.0", 439 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", 440 | "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", 441 | "engines": { 442 | "node": ">= 0.6" 443 | } 444 | }, 445 | "node_modules/fresh": { 446 | "version": "0.5.2", 447 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 448 | "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", 449 | "engines": { 450 | "node": ">= 0.6" 451 | } 452 | }, 453 | "node_modules/fsevents": { 454 | "version": "2.3.3", 455 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", 456 | "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", 457 | "dev": true, 458 | "hasInstallScript": true, 459 | "optional": true, 460 | "os": [ 461 | "darwin" 462 | ], 463 | "engines": { 464 | "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 465 | } 466 | }, 467 | "node_modules/function-bind": { 468 | "version": "1.1.2", 469 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", 470 | "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", 471 | "funding": { 472 | "url": "https://github.com/sponsors/ljharb" 473 | } 474 | }, 475 | "node_modules/get-intrinsic": { 476 | "version": "1.2.2", 477 | "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", 478 | "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", 479 | "dependencies": { 480 | "function-bind": "^1.1.2", 481 | "has-proto": "^1.0.1", 482 | "has-symbols": "^1.0.3", 483 | "hasown": "^2.0.0" 484 | }, 485 | "funding": { 486 | "url": "https://github.com/sponsors/ljharb" 487 | } 488 | }, 489 | "node_modules/glob-parent": { 490 | "version": "5.1.2", 491 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", 492 | "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", 493 | "dev": true, 494 | "dependencies": { 495 | "is-glob": "^4.0.1" 496 | }, 497 | "engines": { 498 | "node": ">= 6" 499 | } 500 | }, 501 | "node_modules/gopd": { 502 | "version": "1.0.1", 503 | "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", 504 | "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", 505 | "dependencies": { 506 | "get-intrinsic": "^1.1.3" 507 | }, 508 | "funding": { 509 | "url": "https://github.com/sponsors/ljharb" 510 | } 511 | }, 512 | "node_modules/has-flag": { 513 | "version": "3.0.0", 514 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 515 | "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", 516 | "dev": true, 517 | "engines": { 518 | "node": ">=4" 519 | } 520 | }, 521 | "node_modules/has-property-descriptors": { 522 | "version": "1.0.1", 523 | "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", 524 | "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", 525 | "dependencies": { 526 | "get-intrinsic": "^1.2.2" 527 | }, 528 | "funding": { 529 | "url": "https://github.com/sponsors/ljharb" 530 | } 531 | }, 532 | "node_modules/has-proto": { 533 | "version": "1.0.1", 534 | "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", 535 | "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", 536 | "engines": { 537 | "node": ">= 0.4" 538 | }, 539 | "funding": { 540 | "url": "https://github.com/sponsors/ljharb" 541 | } 542 | }, 543 | "node_modules/has-symbols": { 544 | "version": "1.0.3", 545 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", 546 | "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", 547 | "engines": { 548 | "node": ">= 0.4" 549 | }, 550 | "funding": { 551 | "url": "https://github.com/sponsors/ljharb" 552 | } 553 | }, 554 | "node_modules/hasown": { 555 | "version": "2.0.0", 556 | "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", 557 | "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", 558 | "dependencies": { 559 | "function-bind": "^1.1.2" 560 | }, 561 | "engines": { 562 | "node": ">= 0.4" 563 | } 564 | }, 565 | "node_modules/http-errors": { 566 | "version": "2.0.0", 567 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", 568 | "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", 569 | "dependencies": { 570 | "depd": "2.0.0", 571 | "inherits": "2.0.4", 572 | "setprototypeof": "1.2.0", 573 | "statuses": "2.0.1", 574 | "toidentifier": "1.0.1" 575 | }, 576 | "engines": { 577 | "node": ">= 0.8" 578 | } 579 | }, 580 | "node_modules/iconv-lite": { 581 | "version": "0.4.24", 582 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 583 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 584 | "dependencies": { 585 | "safer-buffer": ">= 2.1.2 < 3" 586 | }, 587 | "engines": { 588 | "node": ">=0.10.0" 589 | } 590 | }, 591 | "node_modules/ignore-by-default": { 592 | "version": "1.0.1", 593 | "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", 594 | "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", 595 | "dev": true 596 | }, 597 | "node_modules/inherits": { 598 | "version": "2.0.4", 599 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 600 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 601 | }, 602 | "node_modules/ip": { 603 | "version": "2.0.0", 604 | "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", 605 | "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==" 606 | }, 607 | "node_modules/ipaddr.js": { 608 | "version": "1.9.1", 609 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", 610 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", 611 | "engines": { 612 | "node": ">= 0.10" 613 | } 614 | }, 615 | "node_modules/is-binary-path": { 616 | "version": "2.1.0", 617 | "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", 618 | "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", 619 | "dev": true, 620 | "dependencies": { 621 | "binary-extensions": "^2.0.0" 622 | }, 623 | "engines": { 624 | "node": ">=8" 625 | } 626 | }, 627 | "node_modules/is-extglob": { 628 | "version": "2.1.1", 629 | "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", 630 | "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", 631 | "dev": true, 632 | "engines": { 633 | "node": ">=0.10.0" 634 | } 635 | }, 636 | "node_modules/is-glob": { 637 | "version": "4.0.3", 638 | "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", 639 | "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", 640 | "dev": true, 641 | "dependencies": { 642 | "is-extglob": "^2.1.1" 643 | }, 644 | "engines": { 645 | "node": ">=0.10.0" 646 | } 647 | }, 648 | "node_modules/is-number": { 649 | "version": "7.0.0", 650 | "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", 651 | "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", 652 | "dev": true, 653 | "engines": { 654 | "node": ">=0.12.0" 655 | } 656 | }, 657 | "node_modules/jsonwebtoken": { 658 | "version": "9.0.2", 659 | "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", 660 | "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", 661 | "dependencies": { 662 | "jws": "^3.2.2", 663 | "lodash.includes": "^4.3.0", 664 | "lodash.isboolean": "^3.0.3", 665 | "lodash.isinteger": "^4.0.4", 666 | "lodash.isnumber": "^3.0.3", 667 | "lodash.isplainobject": "^4.0.6", 668 | "lodash.isstring": "^4.0.1", 669 | "lodash.once": "^4.0.0", 670 | "ms": "^2.1.1", 671 | "semver": "^7.5.4" 672 | }, 673 | "engines": { 674 | "node": ">=12", 675 | "npm": ">=6" 676 | } 677 | }, 678 | "node_modules/jsonwebtoken/node_modules/ms": { 679 | "version": "2.1.3", 680 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 681 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" 682 | }, 683 | "node_modules/jwa": { 684 | "version": "1.4.1", 685 | "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", 686 | "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", 687 | "dependencies": { 688 | "buffer-equal-constant-time": "1.0.1", 689 | "ecdsa-sig-formatter": "1.0.11", 690 | "safe-buffer": "^5.0.1" 691 | } 692 | }, 693 | "node_modules/jws": { 694 | "version": "3.2.2", 695 | "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", 696 | "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", 697 | "dependencies": { 698 | "jwa": "^1.4.1", 699 | "safe-buffer": "^5.0.1" 700 | } 701 | }, 702 | "node_modules/kareem": { 703 | "version": "2.5.1", 704 | "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.5.1.tgz", 705 | "integrity": "sha512-7jFxRVm+jD+rkq3kY0iZDJfsO2/t4BBPeEb2qKn2lR/9KhuksYk5hxzfRYWMPV8P/x2d0kHD306YyWLzjjH+uA==", 706 | "engines": { 707 | "node": ">=12.0.0" 708 | } 709 | }, 710 | "node_modules/lodash.includes": { 711 | "version": "4.3.0", 712 | "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", 713 | "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" 714 | }, 715 | "node_modules/lodash.isboolean": { 716 | "version": "3.0.3", 717 | "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", 718 | "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" 719 | }, 720 | "node_modules/lodash.isinteger": { 721 | "version": "4.0.4", 722 | "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", 723 | "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" 724 | }, 725 | "node_modules/lodash.isnumber": { 726 | "version": "3.0.3", 727 | "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", 728 | "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" 729 | }, 730 | "node_modules/lodash.isplainobject": { 731 | "version": "4.0.6", 732 | "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", 733 | "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" 734 | }, 735 | "node_modules/lodash.isstring": { 736 | "version": "4.0.1", 737 | "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", 738 | "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" 739 | }, 740 | "node_modules/lodash.once": { 741 | "version": "4.1.1", 742 | "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", 743 | "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" 744 | }, 745 | "node_modules/lru-cache": { 746 | "version": "6.0.0", 747 | "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", 748 | "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", 749 | "dependencies": { 750 | "yallist": "^4.0.0" 751 | }, 752 | "engines": { 753 | "node": ">=10" 754 | } 755 | }, 756 | "node_modules/media-typer": { 757 | "version": "0.3.0", 758 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 759 | "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", 760 | "engines": { 761 | "node": ">= 0.6" 762 | } 763 | }, 764 | "node_modules/memory-pager": { 765 | "version": "1.5.0", 766 | "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", 767 | "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", 768 | "optional": true 769 | }, 770 | "node_modules/merge-descriptors": { 771 | "version": "1.0.1", 772 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 773 | "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" 774 | }, 775 | "node_modules/methods": { 776 | "version": "1.1.2", 777 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 778 | "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", 779 | "engines": { 780 | "node": ">= 0.6" 781 | } 782 | }, 783 | "node_modules/mime": { 784 | "version": "1.6.0", 785 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 786 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", 787 | "bin": { 788 | "mime": "cli.js" 789 | }, 790 | "engines": { 791 | "node": ">=4" 792 | } 793 | }, 794 | "node_modules/mime-db": { 795 | "version": "1.52.0", 796 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 797 | "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", 798 | "engines": { 799 | "node": ">= 0.6" 800 | } 801 | }, 802 | "node_modules/mime-types": { 803 | "version": "2.1.35", 804 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", 805 | "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", 806 | "dependencies": { 807 | "mime-db": "1.52.0" 808 | }, 809 | "engines": { 810 | "node": ">= 0.6" 811 | } 812 | }, 813 | "node_modules/minimatch": { 814 | "version": "3.1.2", 815 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", 816 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 817 | "dev": true, 818 | "dependencies": { 819 | "brace-expansion": "^1.1.7" 820 | }, 821 | "engines": { 822 | "node": "*" 823 | } 824 | }, 825 | "node_modules/mongodb": { 826 | "version": "5.9.0", 827 | "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-5.9.0.tgz", 828 | "integrity": "sha512-g+GCMHN1CoRUA+wb1Agv0TI4YTSiWr42B5ulkiAfLLHitGK1R+PkSAf3Lr5rPZwi/3F04LiaZEW0Kxro9Fi2TA==", 829 | "dependencies": { 830 | "bson": "^5.5.0", 831 | "mongodb-connection-string-url": "^2.6.0", 832 | "socks": "^2.7.1" 833 | }, 834 | "engines": { 835 | "node": ">=14.20.1" 836 | }, 837 | "optionalDependencies": { 838 | "@mongodb-js/saslprep": "^1.1.0" 839 | }, 840 | "peerDependencies": { 841 | "@aws-sdk/credential-providers": "^3.188.0", 842 | "@mongodb-js/zstd": "^1.0.0", 843 | "kerberos": "^1.0.0 || ^2.0.0", 844 | "mongodb-client-encryption": ">=2.3.0 <3", 845 | "snappy": "^7.2.2" 846 | }, 847 | "peerDependenciesMeta": { 848 | "@aws-sdk/credential-providers": { 849 | "optional": true 850 | }, 851 | "@mongodb-js/zstd": { 852 | "optional": true 853 | }, 854 | "kerberos": { 855 | "optional": true 856 | }, 857 | "mongodb-client-encryption": { 858 | "optional": true 859 | }, 860 | "snappy": { 861 | "optional": true 862 | } 863 | } 864 | }, 865 | "node_modules/mongodb-connection-string-url": { 866 | "version": "2.6.0", 867 | "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.6.0.tgz", 868 | "integrity": "sha512-WvTZlI9ab0QYtTYnuMLgobULWhokRjtC7db9LtcVfJ+Hsnyr5eo6ZtNAt3Ly24XZScGMelOcGtm7lSn0332tPQ==", 869 | "dependencies": { 870 | "@types/whatwg-url": "^8.2.1", 871 | "whatwg-url": "^11.0.0" 872 | } 873 | }, 874 | "node_modules/mongoose": { 875 | "version": "7.6.3", 876 | "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-7.6.3.tgz", 877 | "integrity": "sha512-moYP2qWCOdWRDeBxqB/zYwQmQnTBsF5DoolX5uPyI218BkiA1ujGY27P0NTd4oWIX+LLkZPw0LDzlc/7oh1plg==", 878 | "dependencies": { 879 | "bson": "^5.5.0", 880 | "kareem": "2.5.1", 881 | "mongodb": "5.9.0", 882 | "mpath": "0.9.0", 883 | "mquery": "5.0.0", 884 | "ms": "2.1.3", 885 | "sift": "16.0.1" 886 | }, 887 | "engines": { 888 | "node": ">=14.20.1" 889 | }, 890 | "funding": { 891 | "type": "opencollective", 892 | "url": "https://opencollective.com/mongoose" 893 | } 894 | }, 895 | "node_modules/mongoose/node_modules/ms": { 896 | "version": "2.1.3", 897 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 898 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" 899 | }, 900 | "node_modules/mpath": { 901 | "version": "0.9.0", 902 | "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz", 903 | "integrity": "sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==", 904 | "engines": { 905 | "node": ">=4.0.0" 906 | } 907 | }, 908 | "node_modules/mquery": { 909 | "version": "5.0.0", 910 | "resolved": "https://registry.npmjs.org/mquery/-/mquery-5.0.0.tgz", 911 | "integrity": "sha512-iQMncpmEK8R8ncT8HJGsGc9Dsp8xcgYMVSbs5jgnm1lFHTZqMJTUWTDx1LBO8+mK3tPNZWFLBghQEIOULSTHZg==", 912 | "dependencies": { 913 | "debug": "4.x" 914 | }, 915 | "engines": { 916 | "node": ">=14.0.0" 917 | } 918 | }, 919 | "node_modules/mquery/node_modules/debug": { 920 | "version": "4.3.4", 921 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", 922 | "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", 923 | "dependencies": { 924 | "ms": "2.1.2" 925 | }, 926 | "engines": { 927 | "node": ">=6.0" 928 | }, 929 | "peerDependenciesMeta": { 930 | "supports-color": { 931 | "optional": true 932 | } 933 | } 934 | }, 935 | "node_modules/mquery/node_modules/ms": { 936 | "version": "2.1.2", 937 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 938 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" 939 | }, 940 | "node_modules/ms": { 941 | "version": "2.0.0", 942 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 943 | "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" 944 | }, 945 | "node_modules/negotiator": { 946 | "version": "0.6.3", 947 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", 948 | "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", 949 | "engines": { 950 | "node": ">= 0.6" 951 | } 952 | }, 953 | "node_modules/nodemon": { 954 | "version": "3.0.1", 955 | "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.0.1.tgz", 956 | "integrity": "sha512-g9AZ7HmkhQkqXkRc20w+ZfQ73cHLbE8hnPbtaFbFtCumZsjyMhKk9LajQ07U5Ux28lvFjZ5X7HvWR1xzU8jHVw==", 957 | "dev": true, 958 | "dependencies": { 959 | "chokidar": "^3.5.2", 960 | "debug": "^3.2.7", 961 | "ignore-by-default": "^1.0.1", 962 | "minimatch": "^3.1.2", 963 | "pstree.remy": "^1.1.8", 964 | "semver": "^7.5.3", 965 | "simple-update-notifier": "^2.0.0", 966 | "supports-color": "^5.5.0", 967 | "touch": "^3.1.0", 968 | "undefsafe": "^2.0.5" 969 | }, 970 | "bin": { 971 | "nodemon": "bin/nodemon.js" 972 | }, 973 | "engines": { 974 | "node": ">=10" 975 | }, 976 | "funding": { 977 | "type": "opencollective", 978 | "url": "https://opencollective.com/nodemon" 979 | } 980 | }, 981 | "node_modules/nodemon/node_modules/debug": { 982 | "version": "3.2.7", 983 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", 984 | "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", 985 | "dev": true, 986 | "dependencies": { 987 | "ms": "^2.1.1" 988 | } 989 | }, 990 | "node_modules/nodemon/node_modules/ms": { 991 | "version": "2.1.3", 992 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 993 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", 994 | "dev": true 995 | }, 996 | "node_modules/nopt": { 997 | "version": "1.0.10", 998 | "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", 999 | "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", 1000 | "dev": true, 1001 | "dependencies": { 1002 | "abbrev": "1" 1003 | }, 1004 | "bin": { 1005 | "nopt": "bin/nopt.js" 1006 | }, 1007 | "engines": { 1008 | "node": "*" 1009 | } 1010 | }, 1011 | "node_modules/normalize-path": { 1012 | "version": "3.0.0", 1013 | "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", 1014 | "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", 1015 | "dev": true, 1016 | "engines": { 1017 | "node": ">=0.10.0" 1018 | } 1019 | }, 1020 | "node_modules/object-assign": { 1021 | "version": "4.1.1", 1022 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 1023 | "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", 1024 | "engines": { 1025 | "node": ">=0.10.0" 1026 | } 1027 | }, 1028 | "node_modules/object-inspect": { 1029 | "version": "1.13.1", 1030 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", 1031 | "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", 1032 | "funding": { 1033 | "url": "https://github.com/sponsors/ljharb" 1034 | } 1035 | }, 1036 | "node_modules/on-finished": { 1037 | "version": "2.4.1", 1038 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", 1039 | "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", 1040 | "dependencies": { 1041 | "ee-first": "1.1.1" 1042 | }, 1043 | "engines": { 1044 | "node": ">= 0.8" 1045 | } 1046 | }, 1047 | "node_modules/parseurl": { 1048 | "version": "1.3.3", 1049 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 1050 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", 1051 | "engines": { 1052 | "node": ">= 0.8" 1053 | } 1054 | }, 1055 | "node_modules/path-to-regexp": { 1056 | "version": "0.1.7", 1057 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 1058 | "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" 1059 | }, 1060 | "node_modules/picomatch": { 1061 | "version": "2.3.1", 1062 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", 1063 | "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", 1064 | "dev": true, 1065 | "engines": { 1066 | "node": ">=8.6" 1067 | }, 1068 | "funding": { 1069 | "url": "https://github.com/sponsors/jonschlinkert" 1070 | } 1071 | }, 1072 | "node_modules/proxy-addr": { 1073 | "version": "2.0.7", 1074 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", 1075 | "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", 1076 | "dependencies": { 1077 | "forwarded": "0.2.0", 1078 | "ipaddr.js": "1.9.1" 1079 | }, 1080 | "engines": { 1081 | "node": ">= 0.10" 1082 | } 1083 | }, 1084 | "node_modules/pstree.remy": { 1085 | "version": "1.1.8", 1086 | "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", 1087 | "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", 1088 | "dev": true 1089 | }, 1090 | "node_modules/punycode": { 1091 | "version": "2.3.0", 1092 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", 1093 | "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", 1094 | "engines": { 1095 | "node": ">=6" 1096 | } 1097 | }, 1098 | "node_modules/qs": { 1099 | "version": "6.11.0", 1100 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", 1101 | "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", 1102 | "dependencies": { 1103 | "side-channel": "^1.0.4" 1104 | }, 1105 | "engines": { 1106 | "node": ">=0.6" 1107 | }, 1108 | "funding": { 1109 | "url": "https://github.com/sponsors/ljharb" 1110 | } 1111 | }, 1112 | "node_modules/range-parser": { 1113 | "version": "1.2.1", 1114 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 1115 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", 1116 | "engines": { 1117 | "node": ">= 0.6" 1118 | } 1119 | }, 1120 | "node_modules/raw-body": { 1121 | "version": "2.5.1", 1122 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", 1123 | "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", 1124 | "dependencies": { 1125 | "bytes": "3.1.2", 1126 | "http-errors": "2.0.0", 1127 | "iconv-lite": "0.4.24", 1128 | "unpipe": "1.0.0" 1129 | }, 1130 | "engines": { 1131 | "node": ">= 0.8" 1132 | } 1133 | }, 1134 | "node_modules/readdirp": { 1135 | "version": "3.6.0", 1136 | "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", 1137 | "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", 1138 | "dev": true, 1139 | "dependencies": { 1140 | "picomatch": "^2.2.1" 1141 | }, 1142 | "engines": { 1143 | "node": ">=8.10.0" 1144 | } 1145 | }, 1146 | "node_modules/safe-buffer": { 1147 | "version": "5.2.1", 1148 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 1149 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 1150 | "funding": [ 1151 | { 1152 | "type": "github", 1153 | "url": "https://github.com/sponsors/feross" 1154 | }, 1155 | { 1156 | "type": "patreon", 1157 | "url": "https://www.patreon.com/feross" 1158 | }, 1159 | { 1160 | "type": "consulting", 1161 | "url": "https://feross.org/support" 1162 | } 1163 | ] 1164 | }, 1165 | "node_modules/safer-buffer": { 1166 | "version": "2.1.2", 1167 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 1168 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 1169 | }, 1170 | "node_modules/semver": { 1171 | "version": "7.5.4", 1172 | "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", 1173 | "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", 1174 | "dependencies": { 1175 | "lru-cache": "^6.0.0" 1176 | }, 1177 | "bin": { 1178 | "semver": "bin/semver.js" 1179 | }, 1180 | "engines": { 1181 | "node": ">=10" 1182 | } 1183 | }, 1184 | "node_modules/send": { 1185 | "version": "0.18.0", 1186 | "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", 1187 | "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", 1188 | "dependencies": { 1189 | "debug": "2.6.9", 1190 | "depd": "2.0.0", 1191 | "destroy": "1.2.0", 1192 | "encodeurl": "~1.0.2", 1193 | "escape-html": "~1.0.3", 1194 | "etag": "~1.8.1", 1195 | "fresh": "0.5.2", 1196 | "http-errors": "2.0.0", 1197 | "mime": "1.6.0", 1198 | "ms": "2.1.3", 1199 | "on-finished": "2.4.1", 1200 | "range-parser": "~1.2.1", 1201 | "statuses": "2.0.1" 1202 | }, 1203 | "engines": { 1204 | "node": ">= 0.8.0" 1205 | } 1206 | }, 1207 | "node_modules/send/node_modules/ms": { 1208 | "version": "2.1.3", 1209 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 1210 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" 1211 | }, 1212 | "node_modules/serve-static": { 1213 | "version": "1.15.0", 1214 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", 1215 | "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", 1216 | "dependencies": { 1217 | "encodeurl": "~1.0.2", 1218 | "escape-html": "~1.0.3", 1219 | "parseurl": "~1.3.3", 1220 | "send": "0.18.0" 1221 | }, 1222 | "engines": { 1223 | "node": ">= 0.8.0" 1224 | } 1225 | }, 1226 | "node_modules/set-function-length": { 1227 | "version": "1.1.1", 1228 | "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", 1229 | "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", 1230 | "dependencies": { 1231 | "define-data-property": "^1.1.1", 1232 | "get-intrinsic": "^1.2.1", 1233 | "gopd": "^1.0.1", 1234 | "has-property-descriptors": "^1.0.0" 1235 | }, 1236 | "engines": { 1237 | "node": ">= 0.4" 1238 | } 1239 | }, 1240 | "node_modules/setprototypeof": { 1241 | "version": "1.2.0", 1242 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", 1243 | "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" 1244 | }, 1245 | "node_modules/side-channel": { 1246 | "version": "1.0.4", 1247 | "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", 1248 | "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", 1249 | "dependencies": { 1250 | "call-bind": "^1.0.0", 1251 | "get-intrinsic": "^1.0.2", 1252 | "object-inspect": "^1.9.0" 1253 | }, 1254 | "funding": { 1255 | "url": "https://github.com/sponsors/ljharb" 1256 | } 1257 | }, 1258 | "node_modules/sift": { 1259 | "version": "16.0.1", 1260 | "resolved": "https://registry.npmjs.org/sift/-/sift-16.0.1.tgz", 1261 | "integrity": "sha512-Wv6BjQ5zbhW7VFefWusVP33T/EM0vYikCaQ2qR8yULbsilAT8/wQaXvuQ3ptGLpoKx+lihJE3y2UTgKDyyNHZQ==" 1262 | }, 1263 | "node_modules/simple-update-notifier": { 1264 | "version": "2.0.0", 1265 | "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", 1266 | "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", 1267 | "dev": true, 1268 | "dependencies": { 1269 | "semver": "^7.5.3" 1270 | }, 1271 | "engines": { 1272 | "node": ">=10" 1273 | } 1274 | }, 1275 | "node_modules/smart-buffer": { 1276 | "version": "4.2.0", 1277 | "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", 1278 | "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", 1279 | "engines": { 1280 | "node": ">= 6.0.0", 1281 | "npm": ">= 3.0.0" 1282 | } 1283 | }, 1284 | "node_modules/socks": { 1285 | "version": "2.7.1", 1286 | "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", 1287 | "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", 1288 | "dependencies": { 1289 | "ip": "^2.0.0", 1290 | "smart-buffer": "^4.2.0" 1291 | }, 1292 | "engines": { 1293 | "node": ">= 10.13.0", 1294 | "npm": ">= 3.0.0" 1295 | } 1296 | }, 1297 | "node_modules/sparse-bitfield": { 1298 | "version": "3.0.3", 1299 | "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", 1300 | "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", 1301 | "optional": true, 1302 | "dependencies": { 1303 | "memory-pager": "^1.0.2" 1304 | } 1305 | }, 1306 | "node_modules/statuses": { 1307 | "version": "2.0.1", 1308 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", 1309 | "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", 1310 | "engines": { 1311 | "node": ">= 0.8" 1312 | } 1313 | }, 1314 | "node_modules/supports-color": { 1315 | "version": "5.5.0", 1316 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 1317 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 1318 | "dev": true, 1319 | "dependencies": { 1320 | "has-flag": "^3.0.0" 1321 | }, 1322 | "engines": { 1323 | "node": ">=4" 1324 | } 1325 | }, 1326 | "node_modules/to-regex-range": { 1327 | "version": "5.0.1", 1328 | "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", 1329 | "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", 1330 | "dev": true, 1331 | "dependencies": { 1332 | "is-number": "^7.0.0" 1333 | }, 1334 | "engines": { 1335 | "node": ">=8.0" 1336 | } 1337 | }, 1338 | "node_modules/toidentifier": { 1339 | "version": "1.0.1", 1340 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", 1341 | "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", 1342 | "engines": { 1343 | "node": ">=0.6" 1344 | } 1345 | }, 1346 | "node_modules/touch": { 1347 | "version": "3.1.0", 1348 | "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", 1349 | "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", 1350 | "dev": true, 1351 | "dependencies": { 1352 | "nopt": "~1.0.10" 1353 | }, 1354 | "bin": { 1355 | "nodetouch": "bin/nodetouch.js" 1356 | } 1357 | }, 1358 | "node_modules/tr46": { 1359 | "version": "3.0.0", 1360 | "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", 1361 | "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", 1362 | "dependencies": { 1363 | "punycode": "^2.1.1" 1364 | }, 1365 | "engines": { 1366 | "node": ">=12" 1367 | } 1368 | }, 1369 | "node_modules/type-is": { 1370 | "version": "1.6.18", 1371 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 1372 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", 1373 | "dependencies": { 1374 | "media-typer": "0.3.0", 1375 | "mime-types": "~2.1.24" 1376 | }, 1377 | "engines": { 1378 | "node": ">= 0.6" 1379 | } 1380 | }, 1381 | "node_modules/undefsafe": { 1382 | "version": "2.0.5", 1383 | "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", 1384 | "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", 1385 | "dev": true 1386 | }, 1387 | "node_modules/undici-types": { 1388 | "version": "5.26.5", 1389 | "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", 1390 | "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" 1391 | }, 1392 | "node_modules/unpipe": { 1393 | "version": "1.0.0", 1394 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 1395 | "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", 1396 | "engines": { 1397 | "node": ">= 0.8" 1398 | } 1399 | }, 1400 | "node_modules/utils-merge": { 1401 | "version": "1.0.1", 1402 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 1403 | "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", 1404 | "engines": { 1405 | "node": ">= 0.4.0" 1406 | } 1407 | }, 1408 | "node_modules/vary": { 1409 | "version": "1.1.2", 1410 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 1411 | "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", 1412 | "engines": { 1413 | "node": ">= 0.8" 1414 | } 1415 | }, 1416 | "node_modules/webidl-conversions": { 1417 | "version": "7.0.0", 1418 | "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", 1419 | "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", 1420 | "engines": { 1421 | "node": ">=12" 1422 | } 1423 | }, 1424 | "node_modules/whatwg-url": { 1425 | "version": "11.0.0", 1426 | "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", 1427 | "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", 1428 | "dependencies": { 1429 | "tr46": "^3.0.0", 1430 | "webidl-conversions": "^7.0.0" 1431 | }, 1432 | "engines": { 1433 | "node": ">=12" 1434 | } 1435 | }, 1436 | "node_modules/ws": { 1437 | "version": "8.14.2", 1438 | "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", 1439 | "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", 1440 | "engines": { 1441 | "node": ">=10.0.0" 1442 | }, 1443 | "peerDependencies": { 1444 | "bufferutil": "^4.0.1", 1445 | "utf-8-validate": ">=5.0.2" 1446 | }, 1447 | "peerDependenciesMeta": { 1448 | "bufferutil": { 1449 | "optional": true 1450 | }, 1451 | "utf-8-validate": { 1452 | "optional": true 1453 | } 1454 | } 1455 | }, 1456 | "node_modules/yallist": { 1457 | "version": "4.0.0", 1458 | "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", 1459 | "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" 1460 | } 1461 | } 1462 | } 1463 | -------------------------------------------------------------------------------- /chatApp/api/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "start": "nodemon index.js" 4 | }, 5 | "dependencies": { 6 | "bcryptjs": "^2.4.3", 7 | "cookie-parser": "^1.4.6", 8 | "cors": "^2.8.5", 9 | "dotenv": "^16.3.1", 10 | "express": "^4.18.2", 11 | "jsonwebtoken": "^9.0.2", 12 | "mongoose": "^7.6.3", 13 | "ws": "^8.14.2" 14 | }, 15 | "devDependencies": { 16 | "nodemon": "^3.0.1" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /chatApp/api/uploads/1708189408875.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RajKumar-Developer/chatApp/fbb6113c731f889b28d892e49c861d0c928e92ea/chatApp/api/uploads/1708189408875.jpg -------------------------------------------------------------------------------- /chatApp/api/uploads/1708190956543.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RajKumar-Developer/chatApp/fbb6113c731f889b28d892e49c861d0c928e92ea/chatApp/api/uploads/1708190956543.jpg -------------------------------------------------------------------------------- /chatApp/api/uploads/1708191074940.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RajKumar-Developer/chatApp/fbb6113c731f889b28d892e49c861d0c928e92ea/chatApp/api/uploads/1708191074940.mp4 -------------------------------------------------------------------------------- /chatApp/api/uploads/1708191988390.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RajKumar-Developer/chatApp/fbb6113c731f889b28d892e49c861d0c928e92ea/chatApp/api/uploads/1708191988390.jpg -------------------------------------------------------------------------------- /chatApp/api/uploads/1708192085590.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RajKumar-Developer/chatApp/fbb6113c731f889b28d892e49c861d0c928e92ea/chatApp/api/uploads/1708192085590.jpg -------------------------------------------------------------------------------- /chatApp/api/uploads1708189089759.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RajKumar-Developer/chatApp/fbb6113c731f889b28d892e49c861d0c928e92ea/chatApp/api/uploads1708189089759.jpg -------------------------------------------------------------------------------- /chatApp/api/uploads1708189243630.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RajKumar-Developer/chatApp/fbb6113c731f889b28d892e49c861d0c928e92ea/chatApp/api/uploads1708189243630.jpg -------------------------------------------------------------------------------- /chatApp/client/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { browser: true, es2020: true }, 4 | extends: [ 5 | 'eslint:recommended', 6 | 'plugin:react/recommended', 7 | 'plugin:react/jsx-runtime', 8 | 'plugin:react-hooks/recommended', 9 | ], 10 | ignorePatterns: ['dist', '.eslintrc.cjs'], 11 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, 12 | settings: { react: { version: '18.2' } }, 13 | plugins: ['react-refresh'], 14 | rules: { 15 | 'react-refresh/only-export-components': [ 16 | 'warn', 17 | { allowConstantExport: true }, 18 | ], 19 | }, 20 | } 21 | -------------------------------------------------------------------------------- /chatApp/client/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /chatApp/client/README.md: -------------------------------------------------------------------------------- 1 | # React + Vite 2 | 3 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. 4 | 5 | Currently, two official plugins are available: 6 | 7 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh 8 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh 9 | -------------------------------------------------------------------------------- /chatApp/client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + React 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /chatApp/client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "client", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "autoprefixer": "^10.4.16", 14 | "axios": "^1.6.0", 15 | "lodash": "^4.17.21", 16 | "postcss": "^8.4.31", 17 | "react": "^18.2.0", 18 | "react-dom": "^18.2.0", 19 | "tailwindcss": "^3.3.5" 20 | }, 21 | "devDependencies": { 22 | "@types/react": "^18.2.15", 23 | "@types/react-dom": "^18.2.7", 24 | "@vitejs/plugin-react": "^4.0.3", 25 | "eslint": "^8.45.0", 26 | "eslint-plugin-react": "^7.32.2", 27 | "eslint-plugin-react-hooks": "^4.6.0", 28 | "eslint-plugin-react-refresh": "^0.4.3", 29 | "vite": "^4.4.5" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /chatApp/client/postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /chatApp/client/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chatApp/client/src/App.jsx: -------------------------------------------------------------------------------- 1 | // import Register from "./Register"; 2 | import axios from "axios"; 3 | import { UserContextProvider } from "./UserContext"; 4 | // import {useContext} from "react"; 5 | import Routes from "./Routes"; 6 | function App() { 7 | axios.defaults.baseURL = 'http://localhost:4000'; 8 | axios.defaults.withCredentials = true; 9 | // const {username}=useContext(UserContext); 10 | return ( 11 | 12 | 13 | 14 | ) 15 | } 16 | 17 | export default App 18 | -------------------------------------------------------------------------------- /chatApp/client/src/Avatar.jsx: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line react/prop-types 2 | export default function Avatar({userId,username,online}){ 3 | const colors=['bg-red-200','bg-green-200', 4 | 'bg-purple-200','bg-blue-200', 5 | 'bg-yellow-200','bg-teal-200'] 6 | const userIdBase10 = parseInt(userId,16); 7 | const colorIndex = userIdBase10 % colors.length ; 8 | const color = colors[colorIndex] 9 | return( 10 |
11 |
{username[0]}
12 | {online &&( 13 |
14 | )} 15 | {!online && ( 16 |
17 | )} 18 |
19 | ); 20 | } -------------------------------------------------------------------------------- /chatApp/client/src/Chat.jsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react-hooks/exhaustive-deps */ 2 | /* eslint-disable no-unused-vars */ 3 | import { useState, useEffect, useContext, useRef } from "react"; 4 | // import Avatar from "./Avatar"; 5 | import axios from "axios"; 6 | import Logo from "./Logo"; 7 | import { UserContext } from "./UserContext"; 8 | import uniqBy from "lodash/uniqBy"; 9 | import Contact from "./Contact"; 10 | export default function Chat() { 11 | const [ws, setWs] = useState(null); 12 | const [onlinePeople, setOnlinePeople] = useState({}); 13 | const [selectedUserId, setSelectedUserId] = useState(null); 14 | const { username, id, setId, setUsername } = useContext(UserContext); 15 | const messagesBoxRef = useRef(); 16 | const [offlinePeople, setOfflinePeople] = useState({}); 17 | const divUnderMessages = useRef(); 18 | const [messages, setMessages] = useState([]); 19 | const [newMessageText, setNewMessageText] = useState(""); 20 | useEffect(() => { 21 | connectToWs(); 22 | }, []); 23 | 24 | function connectToWs() { 25 | const ws = new WebSocket("ws://localhost:4000"); 26 | setWs(ws); 27 | ws.addEventListener("message", handleMessage); 28 | ws.addEventListener("close", () => { 29 | setTimeout(() => { 30 | console.log("Disconnected, Trying to connect"); 31 | connectToWs(); 32 | }, 1000); 33 | }); 34 | } 35 | 36 | function showOnlinePeople(peopleArray) { 37 | const people = {}; 38 | peopleArray.forEach(({ userId, username }) => { 39 | people[userId] = username; 40 | }); 41 | setOnlinePeople(people); 42 | } 43 | function handleMessage(ev) { 44 | const messageData = JSON.parse(ev.data); 45 | if ("online" in messageData) { 46 | showOnlinePeople(messageData.online); 47 | } else if ("text" in messageData) { 48 | if (messageData.sender === selectedUserId) { 49 | setMessages((prev) => [...prev, { ...messageData }]); 50 | } 51 | } 52 | } 53 | 54 | function logout() { 55 | axios.post("/logout").then(() => { 56 | setWs(null); 57 | setId(null); 58 | setUsername(null); 59 | }); 60 | } 61 | 62 | function sendMessage(ev, file = null) { 63 | if (ev) ev.preventDefault(); 64 | console.log("sending"); 65 | ws.send( 66 | JSON.stringify({ 67 | recipient: selectedUserId, 68 | text: newMessageText, 69 | file, 70 | }) 71 | ); 72 | setNewMessageText(""); 73 | setMessages((prev) => [ 74 | ...prev, 75 | { 76 | text: newMessageText, 77 | sender: id, 78 | recipient: selectedUserId, 79 | _id: Date.now(), 80 | }, 81 | ]); 82 | if (file) { 83 | axios.get("/messages/" + selectedUserId).then((res) => { 84 | setMessages(res.data); 85 | }); 86 | }else{ 87 | setNewMessageText(''); 88 | setMessages(prev => ([...prev , { 89 | text:newMessageText, 90 | sender:id, 91 | recipient:selectedUserId, 92 | _id:Date.now(), 93 | }])) 94 | } 95 | } 96 | 97 | function sendFile(ev) { 98 | const reader = new FileReader(); 99 | reader.readAsDataURL(ev.target.files[0]); 100 | reader.onload = () => { 101 | sendMessage(null, { 102 | name: ev.target.files[0].name, 103 | data: reader.result, 104 | }); 105 | }; 106 | } 107 | 108 | useEffect(() => { 109 | const div = divUnderMessages.current; 110 | // div.scrollTop = div.scrollHeight; 111 | if (div) { 112 | div.scrollIntoView({ behavior: "smooth", block: "end" }); 113 | } 114 | }, [messages]); 115 | 116 | useEffect(() => { 117 | axios.get("/people").then((res) => { 118 | const offlinePeopleArr = res.data 119 | .filter((p) => p._id !== id) 120 | .filter((p) => !Object.keys(onlinePeople).includes(p._id)); 121 | const offlinePeople = {}; 122 | offlinePeopleArr.forEach((p) => { 123 | offlinePeople[p._id] = p; 124 | }); 125 | setOfflinePeople(offlinePeople); 126 | }); 127 | }, [onlinePeople]); 128 | 129 | useEffect(() => { 130 | if (selectedUserId) { 131 | axios.get("/messages/" + selectedUserId).then((res) => { 132 | setMessages(res.data); 133 | }); 134 | } 135 | }); 136 | 137 | const onlinePeopleExclOurUser = { ...onlinePeople }; 138 | delete onlinePeopleExclOurUser[id]; 139 | 140 | const messagesWithoutDupes = uniqBy(messages, "_id"); 141 | 142 | return ( 143 |
144 |
145 |
146 | 147 | {Object.keys(onlinePeopleExclOurUser).map((userId) => ( 148 | setSelectedUserId(userId)} 154 | selected={userId === selectedUserId} 155 | /> 156 | ))} 157 | {Object.keys(offlinePeople).map((userId) => ( 158 | setSelectedUserId(userId)} 164 | selected={userId === selectedUserId} 165 | /> 166 | ))} 167 |
168 |
169 | 170 | 178 | 183 | 184 | {username} 185 | 186 | 192 |
193 |
194 |
195 |
196 | {!selectedUserId && ( 197 |
198 |
199 | ← Select a person from the sidebar 200 |
201 |
202 | )} 203 | 204 | {!!selectedUserId && ( 205 |
206 |
207 |
208 | {messagesWithoutDupes.map((message) => ( 209 |
215 |
223 | {message.text} 224 | {message.file && ( 225 | 249 | )} 250 |
251 |
252 | ))} 253 |
254 |
255 |
256 |
257 | )} 258 |
259 | {!!selectedUserId && ( 260 |
261 | setNewMessageText(ev.target.value)} 265 | placeholder="Type Your message here" 266 | className="bg=white flex-grow border rounded-sm p-2" 267 | /> 268 | 288 | 307 |
308 | )} 309 |
310 |
311 | ); 312 | } 313 | -------------------------------------------------------------------------------- /chatApp/client/src/Contact.jsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/prop-types */ 2 | import Avatar from "./Avatar"; 3 | 4 | function Contact({ id, username, onClick, selected, online }) { 5 | return ( 6 |
onClick(id)} 7 | className={"border-b border-gray-100 flex item-center gap-2 cursor-pointer "+( selected ? 'bg-blue-50': '')} 8 | key={id}> 9 | {selected && ( 10 |
11 | )} 12 |
13 | 14 | {username} 15 |
16 | 17 |
18 | ) 19 | } 20 | 21 | export default Contact 22 | -------------------------------------------------------------------------------- /chatApp/client/src/Logo.jsx: -------------------------------------------------------------------------------- 1 | 2 | function Logo() { 3 | return ( 4 |
5 | 6 | 7 | 8 | 9 | 10 | MernChat 11 |
12 | ) 13 | } 14 | 15 | export default Logo 16 | -------------------------------------------------------------------------------- /chatApp/client/src/RegisterAndLoginForm.jsx: -------------------------------------------------------------------------------- 1 | import { useState, useContext } from "react"; 2 | import axios from "axios"; 3 | import { UserContext } from "./UserContext"; // Updated import 4 | 5 | function RegisterAndLoginForm() { 6 | const [username, setUsername] = useState(""); 7 | const [password, setPassword] = useState(""); 8 | const [isloginOrRegister, setIsLoginOrRegister] = useState("login"); 9 | const { setUsername: setLoggedInUsername, setId } = useContext(UserContext); 10 | 11 | async function handleSubmit(ev) { 12 | const url = isloginOrRegister === "register" ? "register" : "login"; 13 | ev.preventDefault(); 14 | const { data } = await axios.post(url, { username, password }); 15 | setLoggedInUsername(username); 16 | setId(data.id); 17 | } 18 | 19 | return ( 20 |
21 |
22 | setUsername(ev.target.value)} 25 | type="text" 26 | placeholder="username" 27 | className="block w-full rounded-sm p-2 mb-2 border" 28 | /> 29 | setPassword(ev.target.value)} 32 | type="password" 33 | placeholder="password" 34 | className="block w-full rounded-sm p-2 mb-2 border" 35 | /> 36 | 39 |
40 | {isloginOrRegister === "register" && ( 41 |
42 | Already a member? 43 | 46 |
47 | )} 48 | {isloginOrRegister === "login" && ( 49 |
50 | Dont have a account? 51 | 54 |
55 | )} 56 |
57 |
58 |
59 | ); 60 | } 61 | 62 | export default RegisterAndLoginForm; 63 | -------------------------------------------------------------------------------- /chatApp/client/src/Routes.jsx: -------------------------------------------------------------------------------- 1 | import RegisterAndLoginForm from "./RegisterAndLoginForm"; 2 | import { useContext } from "react"; 3 | import { UserContext } from "./UserContext"; 4 | import Chat from "./Chat"; 5 | export default function Routes() { 6 | // eslint-disable-next-line no-unused-vars 7 | const { username, id } = useContext(UserContext); 8 | if (username) { 9 | return ; 10 | } 11 | return ; 12 | } 13 | -------------------------------------------------------------------------------- /chatApp/client/src/UserContext.jsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/prop-types */ 2 | import { createContext, useEffect, useState } from "react"; 3 | import axios from "axios"; 4 | export const UserContext = createContext({}); 5 | 6 | export function UserContextProvider({ children }) { 7 | const [username, setUsername] = useState(null); 8 | const [id, setId] = useState(null); 9 | useEffect(()=>{ 10 | axios.get('/profile',{withCredentials:true}).then(response=>{ 11 | setId(response.data.userId); 12 | setUsername(response.data.username) 13 | }); 14 | },[]); 15 | return ( 16 | 17 | {children} 18 | 19 | ) 20 | } 21 | -------------------------------------------------------------------------------- /chatApp/client/src/assets/react.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chatApp/client/src/index.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | -------------------------------------------------------------------------------- /chatApp/client/src/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App.jsx' 4 | import './index.css' 5 | 6 | ReactDOM.createRoot(document.getElementById('root')).render( 7 | 8 | 9 | , 10 | ) 11 | -------------------------------------------------------------------------------- /chatApp/client/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | export default { 3 | content: [ 4 | "./src/*.jsx" 5 | ], 6 | theme: { 7 | extend: {}, 8 | }, 9 | plugins: [], 10 | } 11 | 12 | -------------------------------------------------------------------------------- /chatApp/client/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }) 8 | --------------------------------------------------------------------------------