From a5c73ad907455ac4d5526ef204ff342f4c6a91ee Mon Sep 17 00:00:00 2001 From: Alvin <524715@vistacollege.nl> Date: Tue, 21 Oct 2025 20:54:03 +0200 Subject: [PATCH] init --- .gitignore | 2 + README.md | 9 + create_user.js | Bin 0 -> 150 bytes example-env | 3 + middleware/auth.js | 29 + models/Item.js | 33 + models/Reservation.js | 31 + models/User.js | 34 + package-lock.json | 1769 +++++++++++++++++ package.json | 22 + public/add-item.html | 92 + public/admin-reservations.html | 93 + public/admin.html | 152 ++ public/css/style.css | 444 +++++ public/favicon.svg | 16 + public/images/default-item.png | Bin 0 -> 22553 bytes .../items/item-1761070418185-318281261.jpg | Bin 0 -> 14216 bytes public/index.html | 42 + public/js/add-item.js | 108 + public/js/admin-add-item.js | 0 public/js/admin-reservations.js | 188 ++ public/js/admin.js | 436 ++++ public/js/auth.js | 36 + public/js/register.js | 60 + public/js/student-reservations.js | 175 ++ public/js/student.js | 240 +++ public/register.html | 54 + public/student-reservations.html | 89 + public/student.html | 129 ++ routes/auth.js | 86 + routes/items.js | 117 ++ routes/reservations.js | 208 ++ routes/upload.js | 43 + seed.js | 73 + server.js | 86 + 35 files changed, 4899 insertions(+) create mode 100644 .gitignore create mode 100644 create_user.js create mode 100644 example-env create mode 100644 middleware/auth.js create mode 100644 models/Item.js create mode 100644 models/Reservation.js create mode 100644 models/User.js create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 public/add-item.html create mode 100644 public/admin-reservations.html create mode 100644 public/admin.html create mode 100644 public/css/style.css create mode 100644 public/favicon.svg create mode 100644 public/images/default-item.png create mode 100644 public/images/items/item-1761070418185-318281261.jpg create mode 100644 public/index.html create mode 100644 public/js/add-item.js create mode 100644 public/js/admin-add-item.js create mode 100644 public/js/admin-reservations.js create mode 100644 public/js/admin.js create mode 100644 public/js/auth.js create mode 100644 public/js/register.js create mode 100644 public/js/student-reservations.js create mode 100644 public/js/student.js create mode 100644 public/register.html create mode 100644 public/student-reservations.html create mode 100644 public/student.html create mode 100644 routes/auth.js create mode 100644 routes/items.js create mode 100644 routes/reservations.js create mode 100644 routes/upload.js create mode 100644 seed.js create mode 100644 server.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..713d500 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +.env diff --git a/README.md b/README.md index e69de29..bcc0cbe 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,9 @@ +# Challenge 15: Magazijn App Maken + +--- + +[<-- Terug naar hoofd-README](../../../../../README.md) + +--- + +Dit is de projectmap voor Challenge 15. \ No newline at end of file diff --git a/create_user.js b/create_user.js new file mode 100644 index 0000000000000000000000000000000000000000..411331c0a0ea302dc8024c34cdde97db7c905341 GIT binary patch literal 150 zcmYj~u?oUK5JX=s_z!XfN#L-wh+Td_EJ6gaIAaI_late6A^v*IBsMn7&g{OK@6hw0 zVuj;MOGC#_+l37!K^MnUGoQZ#F>iiEAjSMq2Fsn7*vUVzXU&$HBR3*43b|H^Ub<3R S%1O?oy&4Q>J|ya1vS0+)U>dss literal 0 HcmV?d00001 diff --git a/example-env b/example-env new file mode 100644 index 0000000..1ca9899 --- /dev/null +++ b/example-env @@ -0,0 +1,3 @@ +PORT=your_webserver_port +MONGODB_URI=mongodb://username:password@ip-or-domain:27017/your_database +JWT_SECRET=your_jwt_secret_key \ No newline at end of file diff --git a/middleware/auth.js b/middleware/auth.js new file mode 100644 index 0000000..f8b996e --- /dev/null +++ b/middleware/auth.js @@ -0,0 +1,29 @@ +const jwt = require('jsonwebtoken'); +const User = require('../models/User'); + +const auth = async (req, res, next) => { + try { + const token = req.header('Authorization').replace('Bearer ', ''); + const decoded = jwt.verify(token, process.env.JWT_SECRET); + const user = await User.findOne({ _id: decoded.userId }); + + if (!user) { + throw new Error(); + } + + req.token = token; + req.user = user; + next(); + } catch (error) { + res.status(401).send({ error: 'Please authenticate' }); + } +}; + +const adminOnly = async (req, res, next) => { + if (req.user.role !== 'admin') { + return res.status(403).send({ error: 'Access denied' }); + } + next(); +}; + +module.exports = { auth, adminOnly }; \ No newline at end of file diff --git a/models/Item.js b/models/Item.js new file mode 100644 index 0000000..927e894 --- /dev/null +++ b/models/Item.js @@ -0,0 +1,33 @@ +const mongoose = require('mongoose'); + +const itemSchema = new mongoose.Schema({ + name: { + type: String, + required: true + }, + description: { + type: String, + default: '' + }, + location: { + type: String, + enum: ['Heerlen', 'Maastricht', 'Sittard'], + required: true + }, + quantity: { + type: Number, + required: true, + min: 0 + }, + imageUrl: { + type: String, + default: '/images/default-item.png' + }, + reserved: { + type: Number, + default: 0, + min: 0 + } +}, { timestamps: true }); + +module.exports = mongoose.model('Item', itemSchema); \ No newline at end of file diff --git a/models/Reservation.js b/models/Reservation.js new file mode 100644 index 0000000..90fbce0 --- /dev/null +++ b/models/Reservation.js @@ -0,0 +1,31 @@ +const mongoose = require('mongoose'); + +const reservationSchema = new mongoose.Schema({ + itemId: { + type: mongoose.Schema.Types.ObjectId, + ref: 'Item', + required: true + }, + quantity: { + type: Number, + required: true, + min: 1, + default: 1 + }, + userId: { + type: mongoose.Schema.Types.ObjectId, + ref: 'User', + required: true + }, + status: { + type: String, + enum: ['PENDING', 'APPROVED', 'REJECTED', 'RETURNED', 'ARCHIVED'], + default: 'PENDING' + }, + reservedDate: { + type: Date, + default: Date.now + } +}, { timestamps: true }); + +module.exports = mongoose.model('Reservation', reservationSchema); \ No newline at end of file diff --git a/models/User.js b/models/User.js new file mode 100644 index 0000000..cac7326 --- /dev/null +++ b/models/User.js @@ -0,0 +1,34 @@ +const mongoose = require('mongoose'); + +const userSchema = new mongoose.Schema({ + username: { + type: String, + required: true, + unique: true + }, + password: { + type: String, + required: true + }, + email: { + type: String, + required: function() { + return this.role === 'student'; + }, + sparse: true, + unique: true, + validate: { + validator: function(email) { + return /^\d{6}@vistacollege\.nl$/.test(email); + }, + message: 'Email must be in the format: 123456@vistacollege.nl' + } + }, + role: { + type: String, + enum: ['admin', 'student'], + required: true + } +}, { timestamps: true }); + +module.exports = mongoose.model('User', userSchema); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..aab4f26 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1769 @@ +{ + "name": "school-warehouse-system", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "school-warehouse-system", + "version": "1.0.0", + "dependencies": { + "bcryptjs": "^2.4.3", + "cors": "^2.8.5", + "dotenv": "^16.3.1", + "express": "^4.18.2", + "jsonwebtoken": "^9.0.2", + "mongoose": "^7.6.3", + "multer": "^2.0.2" + }, + "devDependencies": { + "nodemon": "^3.0.1" + } + }, + "node_modules/@mongodb-js/saslprep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.3.1.tgz", + "integrity": "sha512-6nZrq5kfAz0POWyhljnbWQQJQ5uT8oE2ddX303q1uY0tWsivWKgBDXBBvuFPwOqRRalXJuVO9EjOdVtuhLX0zg==", + "license": "MIT", + "optional": true, + "dependencies": { + "sparse-bitfield": "^3.0.3" + } + }, + "node_modules/@types/node": { + "version": "24.7.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.7.0.tgz", + "integrity": "sha512-IbKooQVqUBrlzWTi79E8Fw78l8k1RNtlDDNWsFZs7XonuQSJ8oNYfEeclhprUldXISRMLzBpILuKgPlIxm+/Yw==", + "license": "MIT", + "dependencies": { + "undici-types": "~7.14.0" + } + }, + "node_modules/@types/webidl-conversions": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", + "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==", + "license": "MIT" + }, + "node_modules/@types/whatwg-url": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.2.tgz", + "integrity": "sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/webidl-conversions": "*" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/append-field": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", + "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==", + "license": "MIT" + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "license": "MIT" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/bcryptjs": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", + "integrity": "sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==", + "license": "MIT" + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/body-parser": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/bson": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/bson/-/bson-5.5.1.tgz", + "integrity": "sha512-ix0EwukN2EpC0SRWIj/7B5+A6uQMQy6KMREI9qQqvgpkV2frH63T0UDVd1SYedL6dNCmDBYB3QtXi4ISk9YT+g==", + "license": "Apache-2.0", + "engines": { + "node": ">=14.20.1" + } + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", + "license": "BSD-3-Clause" + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "license": "MIT" + }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "engines": [ + "node >= 6.0" + ], + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.0.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", + "license": "MIT" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/dotenv": { + "version": "16.6.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", + "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.3", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.7.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.3.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.12", + "proxy-addr": "~2.0.7", + "qs": "6.13.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.19.0", + "serve-static": "1.16.2", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true, + "license": "ISC" + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ip-address": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.0.1.tgz", + "integrity": "sha512-NWv9YLW4PoW2B7xtzaS3NCot75m6nK7Icdv0o3lfMceJVRfSoQwqD4wEH5rLwoKJwUiZ/rfpiVBhnaF0FK4HoA==", + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/jsonwebtoken": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "license": "MIT", + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jsonwebtoken/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/jwa": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.2.tgz", + "integrity": "sha512-eeH5JO+21J78qMvTIDdBXidBd6nG2kZjg5Ohz/1fpa28Z4CcsWUzJ1ZZyFq/3z3N17aZy+ZuBoHljASbL1WfOw==", + "license": "MIT", + "dependencies": { + "buffer-equal-constant-time": "^1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "license": "MIT", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/kareem": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.5.1.tgz", + "integrity": "sha512-7jFxRVm+jD+rkq3kY0iZDJfsO2/t4BBPeEb2qKn2lR/9KhuksYk5hxzfRYWMPV8P/x2d0kHD306YyWLzjjH+uA==", + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", + "license": "MIT" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", + "license": "MIT" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", + "license": "MIT" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", + "license": "MIT" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "license": "MIT" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + "license": "MIT" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + "license": "MIT" + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/memory-pager": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", + "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", + "license": "MIT", + "optional": true + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/mongodb": { + "version": "5.9.2", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-5.9.2.tgz", + "integrity": "sha512-H60HecKO4Bc+7dhOv4sJlgvenK4fQNqqUIlXxZYQNbfEWSALGAwGoyJd/0Qwk4TttFXUOHJ2ZJQe/52ScaUwtQ==", + "license": "Apache-2.0", + "dependencies": { + "bson": "^5.5.0", + "mongodb-connection-string-url": "^2.6.0", + "socks": "^2.7.1" + }, + "engines": { + "node": ">=14.20.1" + }, + "optionalDependencies": { + "@mongodb-js/saslprep": "^1.1.0" + }, + "peerDependencies": { + "@aws-sdk/credential-providers": "^3.188.0", + "@mongodb-js/zstd": "^1.0.0", + "kerberos": "^1.0.0 || ^2.0.0", + "mongodb-client-encryption": ">=2.3.0 <3", + "snappy": "^7.2.2" + }, + "peerDependenciesMeta": { + "@aws-sdk/credential-providers": { + "optional": true + }, + "@mongodb-js/zstd": { + "optional": true + }, + "kerberos": { + "optional": true + }, + "mongodb-client-encryption": { + "optional": true + }, + "snappy": { + "optional": true + } + } + }, + "node_modules/mongodb-connection-string-url": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.6.0.tgz", + "integrity": "sha512-WvTZlI9ab0QYtTYnuMLgobULWhokRjtC7db9LtcVfJ+Hsnyr5eo6ZtNAt3Ly24XZScGMelOcGtm7lSn0332tPQ==", + "license": "Apache-2.0", + "dependencies": { + "@types/whatwg-url": "^8.2.1", + "whatwg-url": "^11.0.0" + } + }, + "node_modules/mongoose": { + "version": "7.8.7", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-7.8.7.tgz", + "integrity": "sha512-5Bo4CrUxrPITrhMKsqUTOkXXo2CoRC5tXxVQhnddCzqDMwRXfyStrxj1oY865g8gaekSBhxAeNkYyUSJvGm9Hw==", + "license": "MIT", + "dependencies": { + "bson": "^5.5.0", + "kareem": "2.5.1", + "mongodb": "5.9.2", + "mpath": "0.9.0", + "mquery": "5.0.0", + "ms": "2.1.3", + "sift": "16.0.1" + }, + "engines": { + "node": ">=14.20.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mongoose" + } + }, + "node_modules/mongoose/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/mpath": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz", + "integrity": "sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mquery": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/mquery/-/mquery-5.0.0.tgz", + "integrity": "sha512-iQMncpmEK8R8ncT8HJGsGc9Dsp8xcgYMVSbs5jgnm1lFHTZqMJTUWTDx1LBO8+mK3tPNZWFLBghQEIOULSTHZg==", + "license": "MIT", + "dependencies": { + "debug": "4.x" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/mquery/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/mquery/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/multer": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/multer/-/multer-2.0.2.tgz", + "integrity": "sha512-u7f2xaZ/UG8oLXHvtF/oWTRvT44p9ecwBBqTwgJVq0+4BW1g8OW01TyMEGWBHbyMOYVHXslaut7qEQ1meATXgw==", + "license": "MIT", + "dependencies": { + "append-field": "^1.0.0", + "busboy": "^1.6.0", + "concat-stream": "^2.0.0", + "mkdirp": "^0.5.6", + "object-assign": "^4.1.1", + "type-is": "^1.6.18", + "xtend": "^4.0.2" + }, + "engines": { + "node": ">= 10.16.0" + } + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nodemon": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.10.tgz", + "integrity": "sha512-WDjw3pJ0/0jMFmyNDp3gvY2YizjLmmOUQo6DEBY+JgdvW/yQ9mEeSw6H5ythl5Ny2ytb7f9C2nIbjSxMNzbJXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^4", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nodemon/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/nodemon/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", + "license": "MIT" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true, + "license": "MIT" + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/serve-static": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.19.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/sift": { + "version": "16.0.1", + "resolved": "https://registry.npmjs.org/sift/-/sift-16.0.1.tgz", + "integrity": "sha512-Wv6BjQ5zbhW7VFefWusVP33T/EM0vYikCaQ2qR8yULbsilAT8/wQaXvuQ3ptGLpoKx+lihJE3y2UTgKDyyNHZQ==", + "license": "MIT" + }, + "node_modules/simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.8.7", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.7.tgz", + "integrity": "sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A==", + "license": "MIT", + "dependencies": { + "ip-address": "^10.0.1", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/sparse-bitfield": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", + "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "memory-pager": "^1.0.2" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/touch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", + "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", + "dev": true, + "license": "ISC", + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/tr46": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "license": "MIT", + "dependencies": { + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", + "license": "MIT" + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true, + "license": "MIT" + }, + "node_modules/undici-types": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.14.0.tgz", + "integrity": "sha512-QQiYxHuyZ9gQUIrmPo3IA+hUl4KYk8uSA7cHrcKd/l3p1OTpZcM0Tbp9x7FAtXdAYhlasd60ncPpgu6ihG6TOA==", + "license": "MIT" + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-url": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "license": "MIT", + "dependencies": { + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..32a0cf7 --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "school-warehouse-system", + "version": "1.0.0", + "description": "School warehouse management system", + "main": "server.js", + "scripts": { + "start": "node server.js", + "dev": "nodemon server.js" + }, + "dependencies": { + "bcryptjs": "^2.4.3", + "cors": "^2.8.5", + "dotenv": "^16.3.1", + "express": "^4.18.2", + "jsonwebtoken": "^9.0.2", + "mongoose": "^7.6.3", + "multer": "^2.0.2" + }, + "devDependencies": { + "nodemon": "^3.0.1" + } +} diff --git a/public/add-item.html b/public/add-item.html new file mode 100644 index 0000000..ba96f01 --- /dev/null +++ b/public/add-item.html @@ -0,0 +1,92 @@ + + + + + + Add New Item - Admin + + + + + + + + +
+
+
+
+
+

Add New Item

+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ + +
+ +
+
+ + +
+
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/public/admin-reservations.html b/public/admin-reservations.html new file mode 100644 index 0000000..80187e3 --- /dev/null +++ b/public/admin-reservations.html @@ -0,0 +1,93 @@ + + + + + + Manage Reservations - Admin + + + + + + + + +
+

Manage Reservations

+ +
+
+
Filter Reservations
+
+
+
+
+ + +
+
+ + +
+
+
+ + + + + + + + + + + + + + + +
StudentItem NameQuantityLocationReserved DateStatusActions
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/public/admin.html b/public/admin.html new file mode 100644 index 0000000..762e940 --- /dev/null +++ b/public/admin.html @@ -0,0 +1,152 @@ + + + + + + Warehouse Dashboard - Admin + + + + + + + + +
+
+
+
+
+

Inventory Management

+ + Add New Item + +
+
+ + +
+
+ +
+ +
+ +
+
+ + + + + + + + + + + + + + + +
ImageItem NameDescriptionLocationQuantityReservedActions
+
+
+
+
+ +
+ + + + + + + + + \ No newline at end of file diff --git a/public/css/style.css b/public/css/style.css new file mode 100644 index 0000000..d1d4e0c --- /dev/null +++ b/public/css/style.css @@ -0,0 +1,444 @@ +/* Vista College Colors */ +:root { + --vista-white: #FEFEFE; + --vista-grey: #CCCECF; + --vista-coral: #D3705A; + --vista-peach: #CD977E; + --vista-blue: #1F4952; +} + +/* Custom styles */ +.navbar { + margin-bottom: 2rem; + background-color: var(--vista-blue) !important; +} + +.navbar-dark .navbar-nav .nav-link { + color: var(--vista-white); +} + +.navbar-dark .navbar-nav .nav-link:hover { + color: var(--vista-grey); +} + +.card { + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); + height: 100%; + background-color: var(--vista-white); + border: none; +} + +.table { + background-color: var(--vista-white); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); +} + +/* Grid view styles */ +.item-card { + transition: transform 0.2s; +} + +.item-card:hover { + transform: translateY(-5px); +} + +.item-image { + width: 100%; + height: 200px; + object-fit: cover; + border-top-left-radius: calc(0.375rem - 1px); + border-top-right-radius: calc(0.375rem - 1px); +} + +.item-card .card-body { + display: flex; + flex-direction: column; +} + +.item-card .card-footer { + background-color: transparent; + border-top: none; + padding-top: 0; +} + +/* Image preview */ +#imagePreview img { + max-width: 200px; + max-height: 200px; + object-fit: contain; + border-radius: 4px; +} + +/* List view image thumbnail */ +.item-thumbnail { + width: 50px; + height: 50px; + object-fit: cover; + border-radius: 4px; +} + +.btn { + margin: 2px; +} + +.btn-primary { + background-color: var(--vista-coral); + border-color: var(--vista-coral); +} + +.btn-primary:hover { + background-color: var(--vista-peach); + border-color: var(--vista-peach); +} + +.btn-outline-primary { + color: var(--vista-coral); + border-color: var(--vista-coral); +} + +.btn-outline-primary:hover { + background-color: var(--vista-coral); + border-color: var(--vista-coral); +} + +.btn-outline-primary.active { + background-color: var(--vista-coral) !important; + border-color: var(--vista-coral) !important; +} + +.form-control:focus, .form-select:focus { + border-color: var(--vista-coral); + box-shadow: 0 0 0 0.25rem rgba(211, 112, 90, 0.25); +} + +body { + background-color: var(--vista-grey); +} + +.navbar-brand { + font-weight: bold; + color: var(--vista-white) !important; +} + +.card-header { + background-color: var(--vista-blue); + border-bottom: none; + color: var(--vista-white); +} + +.table-responsive { + border-radius: 0.25rem; +} + +.table-striped tbody tr:nth-of-type(odd) { + background-color: rgba(204, 206, 207, 0.1); +} + +.badge.bg-success { + background-color: var(--vista-coral) !important; +} + +.badge.bg-secondary { + background-color: var(--vista-grey) !important; +} + +/* Modal styling */ +.modal-header { + background-color: var(--vista-blue); + color: var(--vista-white); +} + +.modal-header .btn-close { + color: var(--vista-white); + opacity: 1; +} + +/* Modal image styling */ +.modal-image-container { + display: flex; + justify-content: center; + align-items: center; + height: 300px; + margin-bottom: 1rem; + background-color: var(--vista-grey); + border-radius: 4px; + overflow: hidden; +} + +.modal-item-image { + max-width: 100%; + max-height: 100%; + object-fit: contain; +} + +/* Status badges */ +.badge { + padding: 0.5em 1em; +} + +.reservation-pending { + background-color: #ffc107; + color: #000; +} + +.reservation-approved { + background-color: var(--vista-coral); + color: var(--vista-white); +} + +.reservation-rejected { + background-color: var(--vista-grey); + color: var(--vista-blue); +} + +/* Table styling */ +.table-dark { + background-color: var(--vista-blue) !important; + color: var(--vista-white) !important; +} + +.table-dark th { + border-color: rgba(255, 255, 255, 0.1); + font-weight: 600; + padding: 12px 8px; + font-size: 0.9rem; + background-color: var(--vista-blue) !important; + color: var(--vista-white) !important; +} + +.table tbody tr:hover { + background-color: rgba(211, 112, 90, 0.1) !important; +} + +.table td { + vertical-align: middle; + padding: 12px 8px; + font-size: 0.9rem; + border-color: var(--vista-grey) !important; +} + +.table-striped tbody tr:nth-of-type(odd) { + background-color: rgba(204, 206, 207, 0.05) !important; +} + +.table-striped tbody tr:nth-of-type(even) { + background-color: var(--vista-white) !important; +} + +/* Specific column widths for reservations table */ +.reservations-table th:nth-child(1), /* Student */ +.reservations-table td:nth-child(1) { + width: 12%; + min-width: 90px; +} + +.reservations-table th:nth-child(2), /* Item Name */ +.reservations-table td:nth-child(2) { + width: 22%; + min-width: 130px; +} + +.reservations-table th:nth-child(3), /* Quantity */ +.reservations-table td:nth-child(3) { + width: 8%; + min-width: 60px; + text-align: center; +} + +.reservations-table th:nth-child(4), /* Location */ +.reservations-table td:nth-child(4) { + width: 12%; + min-width: 90px; + text-align: center; +} + +.reservations-table th:nth-child(5), /* Reserved Date */ +.reservations-table td:nth-child(5) { + width: 13%; + min-width: 100px; + text-align: center; +} + +.reservations-table th:nth-child(6), /* Status */ +.reservations-table td:nth-child(6) { + width: 10%; + min-width: 80px; + text-align: center; +} + +.reservations-table th:nth-child(7), /* Actions */ +.reservations-table td:nth-child(7) { + width: 23%; + min-width: 140px; + text-align: center; +} + +/* Badge styling for better visibility */ +.badge { + font-size: 0.75rem; + padding: 0.4em 0.8em; + font-weight: 600; +} + +/* Vista-colored status badges */ +.reservation-pending { + background-color: #ffc107 !important; + color: var(--vista-blue) !important; + border: 1px solid var(--vista-peach); +} + +.reservation-approved { + background-color: var(--vista-coral) !important; + color: var(--vista-white) !important; + border: 1px solid var(--vista-coral); +} + +.reservation-rejected { + background-color: var(--vista-grey) !important; + color: var(--vista-blue) !important; + border: 1px solid var(--vista-grey); +} + +.reservation-returned { + background-color: var(--vista-peach) !important; + color: var(--vista-white) !important; + border: 1px solid var(--vista-peach); +} + +.reservation-archived { + background-color: #6c757d !important; + color: var(--vista-white) !important; + border: 1px solid #6c757d; +} + +/* Specific column widths for student reservations table */ +.student-reservations-table th:nth-child(1), /* Item Name */ +.student-reservations-table td:nth-child(1) { + width: 25%; + min-width: 150px; +} + +.student-reservations-table th:nth-child(2), /* Quantity */ +.student-reservations-table td:nth-child(2) { + width: 10%; + min-width: 70px; + text-align: center; +} + +.student-reservations-table th:nth-child(3), /* Location */ +.student-reservations-table td:nth-child(3) { + width: 15%; + min-width: 100px; + text-align: center; +} + +.student-reservations-table th:nth-child(4), /* Reserved Date */ +.student-reservations-table td:nth-child(4) { + width: 15%; + min-width: 110px; + text-align: center; +} + +.student-reservations-table th:nth-child(5), /* Status */ +.student-reservations-table td:nth-child(5) { + width: 15%; + min-width: 100px; + text-align: center; +} + +.student-reservations-table th:nth-child(6), /* Actions */ +.student-reservations-table td:nth-child(6) { + width: 20%; + min-width: 120px; + text-align: center; +} + +/* Quantity badge styling */ +.badge.bg-info { + background-color: var(--vista-blue) !important; + color: var(--vista-white) !important; + font-weight: 700; + font-size: 0.8rem; +} + +/* Button group styling */ +.btn-group-sm .btn { + font-size: 0.7rem; + padding: 0.2rem 0.4rem; + border-radius: 0.2rem; +} + +.btn-group .btn { + white-space: nowrap; + margin: 0 1px; +} + +.btn-group .btn i { + font-size: 0.8rem; +} + +/* Responsive button text */ +@media (max-width: 768px) { + .btn-group .btn { + font-size: 0.65rem; + padding: 0.15rem 0.3rem; + } + + .btn-group .btn .btn-text { + display: none; + } +} + +/* Action buttons with Vista colors */ +.btn-success { + background-color: var(--vista-coral) !important; + border-color: var(--vista-coral) !important; + color: var(--vista-white) !important; +} + +.btn-success:hover { + background-color: var(--vista-peach) !important; + border-color: var(--vista-peach) !important; + color: var(--vista-white) !important; +} + +.btn-danger { + background-color: var(--vista-grey) !important; + border-color: var(--vista-grey) !important; + color: var(--vista-blue) !important; +} + +.btn-danger:hover { + background-color: #999 !important; + border-color: #999 !important; + color: var(--vista-white) !important; +} + +.btn-warning { + background-color: var(--vista-peach) !important; + border-color: var(--vista-peach) !important; + color: var(--vista-white) !important; +} + +.btn-warning:hover { + background-color: var(--vista-coral) !important; + border-color: var(--vista-coral) !important; + color: var(--vista-white) !important; +} + +.btn-info { + background-color: var(--vista-blue) !important; + border-color: var(--vista-blue) !important; + color: var(--vista-white) !important; +} + +.btn-info:hover { + background-color: var(--vista-peach) !important; + border-color: var(--vista-peach) !important; + color: var(--vista-white) !important; +} + +/* Small button spacing */ +.btn-sm { + margin: 0 2px; +} \ No newline at end of file diff --git a/public/favicon.svg b/public/favicon.svg new file mode 100644 index 0000000..898a8fb --- /dev/null +++ b/public/favicon.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/default-item.png b/public/images/default-item.png new file mode 100644 index 0000000000000000000000000000000000000000..9eb137f1c3008bee2ac85188ce0fb498dbca56e6 GIT binary patch literal 22553 zcmY&fWmH_v&tI&i(Bc$#_ZD||cU`fdvPf4?p~m{J6&LLcUiQ!`^)ow`+vCS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*3&^czpSyL>DoWWi0fX*$Crxiu@R<+OHp7#}MBg4O8m zO}$=OQI%knf}QDm_b|X*XY4z&^i=X5^#5{!DjsJl3XYXRLf<);NRz^0P0Tdwg6Xvd zpw|gwnJ1fUVj2{)N`0aS(}edqTMnXsW+dVIR7??He77t{d}qsA*GvYPo?b-C_7cL z^FjuN`OYD-Kel8fAB!B*$g7%3#9!IqP*Jmw*Tg||IE9E&*kcV;#Z*tM<`!1s=V$D1 z^+Lm*M6rU?c123@Q@2GLBzmCgC-hJ}Z_~Mw9IXH+_PA@{V1fmzK3Ov+QY?pC74`N0 zx^*a3%U-6iQtQFP09KRwo~g>qI{Dq$z8dreE4aj=Z9ax_DA>{JwYFba4i2L;Er4a4vaJx=)jyFXTH*}1*y}Uv@Ge=2sSrvBYh;=5ZU$gETltH`~6ddTl(Ws zZnDP@@YBGT{F}`^$V}37&!q(8l2<1QFB5``CiJtM-7V6d?blCo9^E|_PYgNa6Tks{ zQQJN!-t3xvmA6ls`zTLwphG@s_-JgV5e=32H#%5B00VHJ%4tq>y!8F0=;!gNjTJ>! z(g7ml3bPG5{(RY?f@x(H1r~+5(-GP$`+bZFX=MZoT*{V>(8LEa-8U=9iuPRj?5=_6 zU^8S%1oT~URES5RJk2h1)G{QEifX-5ul9%XT&pCJiSVG86iJ;&l=gfGq{IPn=FnmE zQ*fiY>)n9{5yqn3Niap~f#SMwc&oW`q5@czbkDg8M*dm*@PFU?$Cm2<-V^Bc)c*h& C%M|qh literal 0 HcmV?d00001 diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..a2f9a1d --- /dev/null +++ b/public/index.html @@ -0,0 +1,42 @@ + + + + + + School Warehouse System + + + + + +
+
+
+
+
+

Login

+
+
+
+
+ + +
+
+ + +
+
+ +

New student? Register here

+
+
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/public/js/add-item.js b/public/js/add-item.js new file mode 100644 index 0000000..f1873ef --- /dev/null +++ b/public/js/add-item.js @@ -0,0 +1,108 @@ +// Add Item page functionality + +// Check authentication +function checkAuth() { + const token = localStorage.getItem('token'); + const role = localStorage.getItem('userRole'); + + if (!token || role !== 'admin') { + window.location.href = '/index.html'; + } +} + +// Initialize page +function initializePage() { + checkAuth(); + setupEventListeners(); + displayUserInfo(); + setupImagePreview(); +} + +// Display user info +function displayUserInfo() { + const username = localStorage.getItem('username'); + document.getElementById('userInfo').textContent = `Admin: ${username}`; +} + +// Set up event listeners +function setupEventListeners() { + document.getElementById('addItemForm').addEventListener('submit', addItem); + document.getElementById('logoutBtn').addEventListener('click', logout); +} + +// Handle logout +function logout() { + localStorage.removeItem('token'); + localStorage.removeItem('userRole'); + localStorage.removeItem('username'); + window.location.href = '/index.html'; +} + +// Set up image preview +function setupImagePreview() { + const imageInput = document.getElementById('itemImage'); + const previewContainer = document.getElementById('imagePreview'); + const removeButton = document.getElementById('removeImage'); + + imageInput.addEventListener('change', () => { + const file = imageInput.files[0]; + if (file) { + const reader = new FileReader(); + reader.onload = (e) => { + previewContainer.innerHTML = `Preview`; + removeButton.style.display = 'block'; + }; + reader.readAsDataURL(file); + } else { + previewContainer.innerHTML = ''; + removeButton.style.display = 'none'; + } + }); + + // Handle remove button click + removeButton.addEventListener('click', () => { + imageInput.value = ''; + previewContainer.innerHTML = ''; + removeButton.style.display = 'none'; + }); +} + +// Add new item +async function addItem(e) { + e.preventDefault(); + + const formData = new FormData(); + formData.append('name', document.getElementById('itemName').value); + formData.append('location', document.getElementById('itemLocation').value); + formData.append('description', document.getElementById('itemDescription').value); + formData.append('quantity', document.getElementById('itemQuantity').value); + + const imageFile = document.getElementById('itemImage').files[0]; + if (imageFile) { + formData.append('image', imageFile); + } + + try { + const response = await fetch('/api/items', { + method: 'POST', + headers: { + 'Authorization': `Bearer ${localStorage.getItem('token')}` + }, + body: formData + }); + + if (response.ok) { + alert('Item added successfully!'); + window.location.href = 'admin.html'; + } else { + const error = await response.json(); + alert(error.message || 'Failed to add item'); + } + } catch (error) { + console.error('Error adding item:', error); + alert('Failed to add item'); + } +} + +// Initialize the page when loaded +document.addEventListener('DOMContentLoaded', initializePage); \ No newline at end of file diff --git a/public/js/admin-add-item.js b/public/js/admin-add-item.js new file mode 100644 index 0000000..e69de29 diff --git a/public/js/admin-reservations.js b/public/js/admin-reservations.js new file mode 100644 index 0000000..a73aed9 --- /dev/null +++ b/public/js/admin-reservations.js @@ -0,0 +1,188 @@ +// Admin reservations page functionality +let reservations = []; + +// Check authentication +function checkAuth() { + const token = localStorage.getItem('token'); + const role = localStorage.getItem('userRole'); + + if (!token || role !== 'admin') { + window.location.href = '/index.html'; + } +} + +// Initialize page +async function initializePage() { + checkAuth(); + await loadReservations(); + setupEventListeners(); + displayUserInfo(); +} + +// Display user info +function displayUserInfo() { + const username = localStorage.getItem('username'); + document.getElementById('userInfo').textContent = `Admin: ${username}`; +} + +// Load and filter reservations +async function loadReservations() { + try { + const response = await fetch('/api/reservations', { + headers: { + 'Authorization': `Bearer ${localStorage.getItem('token')}` + } + }); + reservations = await response.json(); + filterAndDisplayReservations(); + } catch (error) { + console.error('Error loading reservations:', error); + alert('Failed to load reservations'); + } +} + +// Filter and display reservations +function filterAndDisplayReservations() { + const locationFilter = document.getElementById('locationFilter').value; + const statusFilter = document.getElementById('statusFilter').value; + + const filteredReservations = reservations.filter(reservation => { + const locationMatch = locationFilter === 'all' || reservation.location === locationFilter; + const statusMatch = statusFilter === 'all' || reservation.status === statusFilter; + return locationMatch && statusMatch; + }); + + const reservationsList = document.getElementById('reservationsList'); + reservationsList.innerHTML = filteredReservations.map(reservation => ` + + ${reservation.studentName} + ${reservation.itemName} + ${reservation.quantity || 1} + ${reservation.location} + ${new Date(reservation.reservedDate).toLocaleDateString('en-US', { + year: 'numeric', + month: 'short', + day: 'numeric' + })} + ${reservation.status} + +
+ ${reservation.status === 'PENDING' ? ` + + + ` : reservation.status === 'APPROVED' ? ` + + ` : reservation.status === 'RETURNED' ? ` + + ` : ''} + +
+ + + `).join(''); +} + +// Update reservation status +async function updateReservation(reservationId, status) { + try { + const response = await fetch(`/api/reservations/${reservationId}`, { + method: 'PATCH', + headers: { + 'Content-Type': 'application/json', + 'Authorization': `Bearer ${localStorage.getItem('token')}` + }, + body: JSON.stringify({ status }) + }); + + if (response.ok) { + await loadReservations(); + } else { + const error = await response.json(); + alert(error.message || 'Failed to update reservation'); + } + } catch (error) { + console.error('Error updating reservation:', error); + alert('Failed to update reservation'); + } +} + +// Delete reservation +async function deleteReservation(reservationId) { + if (!confirm('Are you sure you want to delete this reservation?')) return; + + try { + const response = await fetch(`/api/reservations/${reservationId}`, { + method: 'DELETE', + headers: { + 'Authorization': `Bearer ${localStorage.getItem('token')}` + } + }); + + if (response.ok) { + await loadReservations(); + } else { + const error = await response.json(); + alert(error.message || 'Failed to delete reservation'); + } + } catch (error) { + console.error('Error deleting reservation:', error); + alert('Failed to delete reservation'); + } +} + +// Archive reservation +async function archiveReservation(reservationId) { + if (!confirm('Are you sure you want to archive this reservation? It will be hidden from the list but remain in the database.')) return; + + try { + const response = await fetch(`/api/reservations/${reservationId}/archive`, { + method: 'PATCH', + headers: { + 'Authorization': `Bearer ${localStorage.getItem('token')}` + } + }); + + if (response.ok) { + await loadReservations(); + // Show success message + const alert = document.createElement('div'); + alert.className = 'alert alert-success alert-dismissible fade show'; + alert.innerHTML = ` + Reservation archived successfully! + + `; + const container = document.querySelector('.container'); + container.prepend(alert); + setTimeout(() => alert.remove(), 3000); + } else { + const error = await response.json(); + alert(error.message || 'Failed to archive reservation'); + } + } catch (error) { + console.error('Error archiving reservation:', error); + alert('Failed to archive reservation'); + } +} + +// Set up event listeners +function setupEventListeners() { + document.getElementById('locationFilter').addEventListener('change', filterAndDisplayReservations); + document.getElementById('statusFilter').addEventListener('change', filterAndDisplayReservations); + document.getElementById('logoutBtn').addEventListener('click', () => { + localStorage.clear(); + window.location.href = '/index.html'; + }); +} + +// Initialize the page when DOM is loaded +document.addEventListener('DOMContentLoaded', initializePage); \ No newline at end of file diff --git a/public/js/admin.js b/public/js/admin.js new file mode 100644 index 0000000..7eee780 --- /dev/null +++ b/public/js/admin.js @@ -0,0 +1,436 @@ +// Admin dashboard functionality +let items = []; +let reservations = []; +let currentView = 'grid'; // Default view mode + +// Check authentication +function checkAuth() { + const token = localStorage.getItem('token'); + const role = localStorage.getItem('userRole'); + + if (!token || role !== 'admin') { + window.location.href = '/index.html'; + } +} + +// Initialize page +async function initializePage() { + try { + checkAuth(); + await loadItems(); + displayUserInfo(); + setupEventListeners(); // Move this after displayUserInfo to ensure DOM is ready + console.log('Page initialization complete'); + } catch (error) { + console.error('Error during page initialization:', error); + throw error; // Re-throw to be caught by the outer try-catch + } +} + +// Display user info +function displayUserInfo() { + const username = localStorage.getItem('username'); + document.getElementById('userInfo').textContent = `Admin: ${username}`; +} + +// Load items from server +async function loadItems() { + try { + console.log('Loading items...'); + const response = await fetch('/api/items', { + headers: { + 'Authorization': `Bearer ${localStorage.getItem('token')}` + } + }); + + const data = await response.json(); + console.log('Received items:', data); + + if (!response.ok) { + throw new Error(data.message || 'Failed to load items'); + } + + items = data; + displayItems(); + } catch (error) { + console.error('Error loading items:', error); + alert('Failed to load items: ' + error.message); + } +} + +// Display items based on current view mode +function displayItems() { + if (currentView === 'grid') { + displayGridView(); + } else { + displayListView(); + } +} + +// Display items in grid view +function displayGridView() { + const itemsGrid = document.getElementById('itemsGrid'); + document.getElementById('itemsList').classList.add('d-none'); + itemsGrid.classList.remove('d-none'); + + itemsGrid.innerHTML = items.map(item => ` +
+
+ ${item.name} +
+
${item.name}
+

${item.description || 'No description available'}

+

Location: ${item.location}

+

Quantity: ${item.quantity}

+

Reserved: ${item.reserved || 0}

+
+ +
+
+ `).join(''); +} + +// Display items in list view +function displayListView() { + const itemsList = document.getElementById('itemsList'); + const itemsGrid = document.getElementById('itemsGrid'); + itemsGrid.classList.add('d-none'); + itemsList.classList.remove('d-none'); + + const itemsListBody = document.getElementById('itemsListBody'); + itemsListBody.innerHTML = items.map(item => ` + + ${item.name} + ${item.name} + ${item.description || 'No description available'} + ${item.location} + ${item.quantity} + ${item.reserved || 0} + + + + + + `).join(''); +} + +// Load reservations +async function loadReservations() { + try { + const response = await fetch('/api/reservations', { + headers: { + 'Authorization': `Bearer ${localStorage.getItem('token')}` + } + }); + reservations = await response.json(); + displayReservations(); + } catch (error) { + console.error('Error loading reservations:', error); + alert('Failed to load reservations'); + } +} + +// Display reservations in table +function displayReservations() { + const reservationsList = document.getElementById('reservationsList'); + reservationsList.innerHTML = reservations.map(reservation => ` + + ${reservation.studentName} + ${reservation.itemName} + ${reservation.location} + ${new Date(reservation.reservedDate).toLocaleDateString()} + ${reservation.status} + + ${reservation.status === 'PENDING' ? ` + + + ` : ''} + + + `).join(''); +} + + +// Delete item +async function deleteItem(itemId) { + if (!confirm('Are you sure you want to delete this item?')) return; + + try { + const response = await fetch(`/api/items/${itemId}`, { + method: 'DELETE', + headers: { + 'Authorization': `Bearer ${localStorage.getItem('token')}` + } + }); + + if (response.ok) { + await loadItems(); + } else { + const error = await response.json(); + alert(error.message || 'Failed to delete item'); + } + } catch (error) { + console.error('Error deleting item:', error); + alert('Failed to delete item'); + } +} + +// Update reservation status +async function updateReservation(reservationId, status) { + try { + const response = await fetch(`/api/reservations/${reservationId}`, { + method: 'PATCH', + headers: { + 'Content-Type': 'application/json', + 'Authorization': `Bearer ${localStorage.getItem('token')}` + }, + body: JSON.stringify({ status }) + }); + + if (response.ok) { + await loadReservations(); + await loadItems(); // Refresh items to update quantities + } else { + const error = await response.json(); + alert(error.message || 'Failed to update reservation'); + } + } catch (error) { + console.error('Error updating reservation:', error); + alert('Failed to update reservation'); + } +} + +// Edit item functionality +let editModal = null; + +// Initialize Bootstrap modal when DOM is loaded +function initializeModal() { + const modalElement = document.getElementById('editItemModal'); + if (!modalElement) { + console.error('Modal element not found in the DOM'); + return; + } + try { + editModal = new bootstrap.Modal(modalElement); + console.log('Modal initialized successfully'); + } catch (error) { + console.error('Error initializing modal:', error); + } +} + +async function editItem(itemId) { + try { + console.log('Fetching item with ID:', itemId); // Debug log + const response = await fetch(`/api/items/${itemId}`, { + headers: { + 'Authorization': `Bearer ${localStorage.getItem('token')}` + } + }); + + const data = await response.json(); + console.log('Response data:', data); // Debug log + + if (!response.ok) { + console.error('Server error:', data); + throw new Error(data.message || 'Failed to fetch item'); + } + + if (!data || !data._id) { + throw new Error('Invalid item data received'); + } + + document.getElementById('editItemId').value = data._id; + document.getElementById('editItemName').value = data.name; + document.getElementById('editItemDescription').value = data.description || ''; + document.getElementById('editItemLocation').value = data.location; + document.getElementById('editItemQuantity').value = data.quantity; + + // Show current image if it exists + const imagePreview = document.getElementById('editImagePreview'); + const removeButton = document.getElementById('editRemoveImage'); + imagePreview.innerHTML = ''; + + if (data.imageUrl) { + const img = document.createElement('img'); + img.src = data.imageUrl; + img.classList.add('modal-item-image'); + imagePreview.appendChild(img); + removeButton.style.display = 'block'; + imagePreview.dataset.currentImageUrl = data.imageUrl; + } else { + removeButton.style.display = 'none'; + imagePreview.dataset.currentImageUrl = ''; + } + + // Show the modal + if (!editModal) { + console.log('Modal not initialized, attempting to initialize now'); + initializeModal(); + } + + if (editModal) { + editModal.show(); + } else { + throw new Error('Could not initialize modal. Please try again.'); + } + } catch (error) { + console.error('Error fetching item:', error); + alert('Error loading item details: ' + error.message); + } +} + +async function submitEditItem() { + const itemId = document.getElementById('editItemId').value; + const formData = new FormData(); + formData.append('name', document.getElementById('editItemName').value); + formData.append('description', document.getElementById('editItemDescription').value); + formData.append('location', document.getElementById('editItemLocation').value); + formData.append('quantity', document.getElementById('editItemQuantity').value); + + const imagePreview = document.getElementById('editImagePreview'); + const imageFile = document.getElementById('editItemImage').files[0]; + const currentImageUrl = imagePreview.dataset.currentImageUrl; + + try { + // Handle image update + if (imageFile) { + // Upload new image + const imageFormData = new FormData(); + imageFormData.append('image', imageFile); + + const uploadResponse = await fetch('/api/upload', { + method: 'POST', + headers: { + 'Authorization': `Bearer ${localStorage.getItem('token')}` + }, + body: imageFormData + }); + + if (!uploadResponse.ok) { + throw new Error('Failed to upload image'); + } + + const { imageUrl } = await uploadResponse.json(); + formData.append('imageUrl', imageUrl); + } else if (!currentImageUrl) { + // If no new image and no current image, explicitly set imageUrl to null + formData.append('imageUrl', ''); + } + } catch (error) { + console.error('Error uploading image:', error); + alert('Failed to upload image'); + return; + } + + try { + const response = await fetch(`/api/items/${itemId}`, { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + 'Authorization': `Bearer ${localStorage.getItem('token')}` + }, + body: JSON.stringify(Object.fromEntries(formData)) + }); + + if (!response.ok) { + throw new Error('Update failed'); + } + + await loadItems(); // Refresh the items list + bootstrap.Modal.getInstance(document.getElementById('editItemModal')).hide(); + alert('Item updated successfully'); + } catch (error) { + console.error('Error updating item:', error); + alert('Error updating item'); + } +} + +// Set up event listeners +function setupEventListeners() { + // Common elements + const logoutBtn = document.getElementById('logoutBtn'); + if (logoutBtn) { + logoutBtn.addEventListener('click', () => { + localStorage.clear(); + window.location.href = '/index.html'; + }); + } + + // View mode toggle + const viewModeBtns = document.querySelectorAll('.view-mode-btn'); + if (viewModeBtns.length > 0) { + viewModeBtns.forEach(btn => { + btn.addEventListener('click', function() { + document.querySelectorAll('.view-mode-btn').forEach(b => b.classList.remove('active')); + this.classList.add('active'); + currentView = this.dataset.mode; + displayItems(); + }); + }); + } + + // Edit form elements + const editItemImage = document.getElementById('editItemImage'); + if (editItemImage) { + editItemImage.addEventListener('change', function(e) { + const file = e.target.files[0]; + const imagePreview = document.getElementById('editImagePreview'); + const removeButton = document.getElementById('editRemoveImage'); + + if (file) { + const reader = new FileReader(); + reader.onload = function(e) { + imagePreview.innerHTML = ''; + const img = document.createElement('img'); + img.src = e.target.result; + img.classList.add('modal-item-image'); + imagePreview.appendChild(img); + removeButton.style.display = 'block'; + }; + reader.readAsDataURL(file); + } else { + imagePreview.innerHTML = ''; + if (!imagePreview.dataset.currentImageUrl) { + removeButton.style.display = 'none'; + } + } + }); + } + + // Remove image button + const editRemoveImage = document.getElementById('editRemoveImage'); + if (editRemoveImage) { + editRemoveImage.addEventListener('click', function() { + const imagePreview = document.getElementById('editImagePreview'); + const imageInput = document.getElementById('editItemImage'); + const removeButton = document.getElementById('editRemoveImage'); + + imagePreview.innerHTML = ''; + imageInput.value = ''; + imagePreview.dataset.currentImageUrl = ''; + removeButton.style.display = 'none'; + }); + } +} + +// Initialize the page when DOM is loaded +document.addEventListener('DOMContentLoaded', async () => { + try { + console.log('Initializing page...'); + await initializePage(); + console.log('Page initialized'); + + // Ensure modal is initialized after Bootstrap is loaded + setTimeout(() => { + console.log('Initializing modal...'); + initializeModal(); + console.log('Modal initialized'); + }, 100); + } catch (error) { + console.error('Error during page initialization:', error); + alert('Error initializing page: ' + error.message); + } +}); \ No newline at end of file diff --git a/public/js/auth.js b/public/js/auth.js new file mode 100644 index 0000000..f83b00e --- /dev/null +++ b/public/js/auth.js @@ -0,0 +1,36 @@ +// Authentication related functions +document.getElementById('loginForm').addEventListener('submit', async (e) => { + e.preventDefault(); + const username = document.getElementById('username').value.toLowerCase(); // Convert to lowercase + const password = document.getElementById('password').value; + + try { + const response = await fetch('/api/auth/login', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ username, password }) + }); + + const data = await response.json(); + + if (response.ok) { + localStorage.setItem('token', data.token); + localStorage.setItem('userRole', data.role); + localStorage.setItem('username', data.username.toLowerCase()); + + // Redirect based on role + if (data.role === 'admin') { + window.location.href = '/admin.html'; + } else { + window.location.href = '/student.html'; + } + } else { + alert(data.message || 'Login failed'); + } + } catch (error) { + console.error('Login error:', error); + alert('An error occurred during login'); + } +}); \ No newline at end of file diff --git a/public/js/register.js b/public/js/register.js new file mode 100644 index 0000000..fbe433a --- /dev/null +++ b/public/js/register.js @@ -0,0 +1,60 @@ +// Registration form handling +document.getElementById('registrationForm').addEventListener('submit', async (e) => { + e.preventDefault(); + + const username = document.getElementById('username').value.toLowerCase(); // Convert to lowercase + const email = document.getElementById('email').value; + const password = document.getElementById('password').value; + const confirmPassword = document.getElementById('confirmPassword').value; + + // Validate username (only allow alphanumeric and underscores) + const usernameRegex = /^[a-z0-9_]+$/; + if (!usernameRegex.test(username)) { + alert('Username can only contain letters, numbers, and underscores'); + return; + } + + // Validate password match + if (password !== confirmPassword) { + alert('Passwords do not match!'); + return; + } + + // Validate email format + const emailRegex = /^\d+@vistacollege\.nl$/; + if (!emailRegex.test(email)) { + alert('Email must be in the format: studentnumber@vistacollege.nl'); + return; + } + + try { + const response = await fetch('/api/auth/register', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + username, + email, + password + }) + }); + + const data = await response.json(); + + if (response.ok) { + // Store the token and user info + localStorage.setItem('token', data.token); + localStorage.setItem('userRole', data.role); + localStorage.setItem('username', data.username.toLowerCase()); + + // Redirect to student dashboard + window.location.href = '/student.html'; + } else { + alert(data.message || 'Registration failed'); + } + } catch (error) { + console.error('Registration error:', error); + alert('An error occurred during registration'); + } +}); \ No newline at end of file diff --git a/public/js/student-reservations.js b/public/js/student-reservations.js new file mode 100644 index 0000000..995cf68 --- /dev/null +++ b/public/js/student-reservations.js @@ -0,0 +1,175 @@ +// Student reservations page functionality +let reservations = []; + +// Check authentication +function checkAuth() { + const token = localStorage.getItem('token'); + const role = localStorage.getItem('userRole'); + + if (!token || role !== 'student') { + window.location.href = '/index.html'; + } +} + +// Initialize page +async function initializePage() { + checkAuth(); + await loadReservations(); + setupEventListeners(); + displayUserInfo(); +} + +// Display user info +function displayUserInfo() { + const username = localStorage.getItem('username'); + document.getElementById('userInfo').textContent = `Student: ${username}`; +} + +// Load and filter reservations +async function loadReservations() { + try { + const response = await fetch('/api/reservations/my', { + headers: { + 'Authorization': `Bearer ${localStorage.getItem('token')}` + } + }); + + if (!response.ok) { + const errorData = await response.json(); + throw new Error(errorData.message || `HTTP ${response.status}`); + } + + reservations = await response.json(); + filterAndDisplayReservations(); + } catch (error) { + console.error('Error loading reservations:', error); + // Display a user-friendly error message + const reservationsList = document.getElementById('reservationsList'); + reservationsList.innerHTML = ` + + + + Failed to load reservations: ${error.message} +
Please try refreshing the page + + + `; + } +} + +// Filter and display reservations +function filterAndDisplayReservations() { + const locationFilter = document.getElementById('locationFilter').value; + const statusFilter = document.getElementById('statusFilter').value; + + const filteredReservations = reservations.filter(reservation => { + const locationMatch = locationFilter === 'all' || reservation.location === locationFilter; + const statusMatch = statusFilter === 'all' || reservation.status === statusFilter; + return locationMatch && statusMatch; + }); + + const reservationsList = document.getElementById('reservationsList'); + reservationsList.innerHTML = filteredReservations.map(reservation => ` + + ${reservation.itemName} + ${reservation.quantity || 1} + ${reservation.location} + ${new Date(reservation.reservedDate).toLocaleDateString('en-US', { + year: 'numeric', + month: 'short', + day: 'numeric' + })} + ${reservation.status} + + ${reservation.status === 'PENDING' ? ` + + ` : reservation.status === 'APPROVED' ? ` + + ` : reservation.status === 'REJECTED' ? ` + Rejected + ` : reservation.status === 'RETURNED' ? ` + Returned + ` : ''} + + + `).join(''); +} + +// Delete (cancel) reservation +async function deleteReservation(reservationId) { + if (!confirm('Are you sure you want to cancel this reservation?')) return; + + try { + const response = await fetch(`/api/reservations/${reservationId}`, { + method: 'DELETE', + headers: { + 'Authorization': `Bearer ${localStorage.getItem('token')}` + } + }); + + if (response.ok) { + await loadReservations(); + } else { + const error = await response.json(); + alert(error.message || 'Failed to cancel reservation'); + } + } catch (error) { + console.error('Error canceling reservation:', error); + alert('Failed to cancel reservation'); + } +} + +// Return reservation (mark as returned) +async function returnReservation(reservationId) { + if (!confirm('Are you sure you want to return this item?')) return; + + try { + const response = await fetch(`/api/reservations/${reservationId}`, { + method: 'PATCH', + headers: { + 'Content-Type': 'application/json', + 'Authorization': `Bearer ${localStorage.getItem('token')}` + }, + body: JSON.stringify({ status: 'RETURNED' }) + }); + + if (response.ok) { + // Successfully returned, reload reservations + await loadReservations(); + // Show success message + const alert = document.createElement('div'); + alert.className = 'alert alert-success alert-dismissible fade show mt-3'; + alert.innerHTML = ` + Item returned successfully! + + `; + const container = document.querySelector('.container'); + const h2Element = container.querySelector('h2'); + h2Element.insertAdjacentElement('afterend', alert); + setTimeout(() => alert.remove(), 3000); + } else { + const error = await response.json(); + throw new Error(error.message || 'Failed to return item'); + } + } catch (error) { + console.error('Error returning item:', error); + alert(`Failed to return item: ${error.message}`); + } +} + +// Set up event listeners +function setupEventListeners() { + document.getElementById('locationFilter').addEventListener('change', filterAndDisplayReservations); + document.getElementById('statusFilter').addEventListener('change', filterAndDisplayReservations); + document.getElementById('logoutBtn').addEventListener('click', () => { + localStorage.clear(); + window.location.href = '/index.html'; + }); +} + +// Initialize the page when DOM is loaded +document.addEventListener('DOMContentLoaded', initializePage); \ No newline at end of file diff --git a/public/js/student.js b/public/js/student.js new file mode 100644 index 0000000..c4f8a2e --- /dev/null +++ b/public/js/student.js @@ -0,0 +1,240 @@ +// Student dashboard functionality +let items = []; + +// Check authentication +function checkAuth() { + const token = localStorage.getItem('token'); + const role = localStorage.getItem('userRole'); + + if (!token || role !== 'student') { + window.location.href = '/index.html'; + } +} + +// Initialize page +async function initializePage() { + checkAuth(); + await loadItems(); + setupEventListeners(); + displayUserInfo(); + initializeModal(); +} + +// Display user info +function displayUserInfo() { + const username = localStorage.getItem('username'); + document.getElementById('userInfo').textContent = `Student: ${username}`; +} + +// Load items from server +async function loadItems() { + try { + const response = await fetch('/api/items', { + headers: { + 'Authorization': `Bearer ${localStorage.getItem('token')}` + } + }); + items = await response.json(); + displayItems(); + } catch (error) { + console.error('Error loading items:', error); + alert('Failed to load items'); + } +} + +let itemDetailsModal = null; +let currentItem = null; + +// Initialize Bootstrap modal +function initializeModal() { + const modalElement = document.getElementById('itemDetailsModal'); + itemDetailsModal = new bootstrap.Modal(modalElement); + + // Set up modal reserve button + document.getElementById('modalReserveButton').addEventListener('click', () => { + if (currentItem) { + const quantity = parseInt(document.getElementById('reserveQuantity').value); + reserveItem(currentItem._id, quantity); + } + }); +} + +// Show item details in modal +function showItemDetails(item) { + currentItem = item; + const availableQuantity = item.quantity - (item.reserved || 0); + + // Set modal content + document.getElementById('modalItemImage').src = item.imageUrl || '/images/default-item.png'; + document.getElementById('modalItemName').textContent = item.name; + document.getElementById('modalItemDescription').textContent = item.description || 'No description available'; + document.getElementById('modalItemLocation').textContent = item.location; + document.getElementById('modalItemQuantity').textContent = availableQuantity; + + // Populate quantity select + const quantitySelect = document.getElementById('reserveQuantity'); + quantitySelect.innerHTML = ''; + for (let i = 1; i <= availableQuantity; i++) { + const option = document.createElement('option'); + option.value = i; + option.textContent = i; + quantitySelect.appendChild(option); + } + + // Show/hide reserve button and quantity select based on availability + const reserveButton = document.getElementById('modalReserveButton'); + const quantityGroup = document.getElementById('quantitySelectGroup'); + if (availableQuantity > 0) { + reserveButton.style.display = 'block'; + quantityGroup.style.display = 'block'; + reserveButton.disabled = false; + } else { + reserveButton.style.display = 'none'; + quantityGroup.style.display = 'none'; + } + + itemDetailsModal.show(); +} + +// Track current view mode +let currentViewMode = localStorage.getItem('studentViewMode') || 'grid'; + +// Display items based on current view mode +function displayItems() { + const locationFilter = document.getElementById('locationFilter').value; + const filteredItems = locationFilter === 'all' + ? items + : items.filter(item => item.location === locationFilter); + + // Update view mode buttons active state + const viewButtons = document.querySelectorAll('.view-mode-btn'); + viewButtons.forEach(btn => { + btn.classList.toggle('active', btn.getAttribute('data-mode') === currentViewMode); + }); + + // Show/hide appropriate containers + document.getElementById('itemsGrid').classList.toggle('d-none', currentViewMode !== 'grid'); + document.getElementById('itemsList').classList.toggle('d-none', currentViewMode !== 'list'); + + if (currentViewMode === 'grid') { + // Display items in grid view + const gridContainer = document.getElementById('itemsGrid'); + gridContainer.innerHTML = filteredItems.map(item => ` +
+
+ ${item.name} +
+
${item.name}
+

${item.description || 'No description available'}

+

+ Location: ${item.location}
+ Available: ${item.quantity - (item.reserved || 0)} +

+ ${item.quantity - (item.reserved || 0) > 0 ? + 'Available' : + 'Not Available' + } +
+
+
+ `).join(''); + } else { + // Display items in list view + const itemsListBody = document.getElementById('itemsListBody'); + itemsListBody.innerHTML = filteredItems.map(item => ` + + ${item.name} + ${item.name} + ${item.description || 'No description available'} + ${item.location} + ${item.quantity - (item.reserved || 0)} + + ${item.quantity - (item.reserved || 0) > 0 ? + 'Available' : + 'Not Available' + } + + + `).join(''); + } +} + +// Load user's reservations +async function loadMyReservations() { + try { + const response = await fetch('/api/reservations/my', { + headers: { + 'Authorization': `Bearer ${localStorage.getItem('token')}` + } + }); + myReservations = await response.json(); + displayMyReservations(); + } catch (error) { + console.error('Error loading reservations:', error); + alert('Failed to load reservations'); + } +} + +// Display user's reservations +function displayMyReservations() { + const reservationsList = document.getElementById('reservationsList'); + reservationsList.innerHTML = myReservations.map(reservation => ` + + ${reservation.itemName} + ${reservation.location} + ${new Date(reservation.reservedDate).toLocaleDateString()} + ${reservation.status} + + `).join(''); +} + +// Reserve an item +async function reserveItem(itemId, quantity = 1) { + try { + const response = await fetch('/api/reservations', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'Authorization': `Bearer ${localStorage.getItem('token')}` + }, + body: JSON.stringify({ itemId, quantity }) + }); + + if (response.ok) { + await loadItems(); + itemDetailsModal.hide(); + // Redirect to reservations page after successful reservation + window.location.href = '/student-reservations.html'; + } else { + const error = await response.json(); + alert(error.message || 'Failed to reserve item'); + } + } catch (error) { + console.error('Error reserving item:', error); + alert('Failed to reserve item'); + } +} + +// Switch view mode +function switchViewMode(mode) { + currentViewMode = mode; + localStorage.setItem('studentViewMode', mode); + displayItems(); +} + +// Set up event listeners +function setupEventListeners() { + document.getElementById('locationFilter').addEventListener('change', displayItems); + document.getElementById('logoutBtn').addEventListener('click', () => { + localStorage.clear(); + window.location.href = '/index.html'; + }); + + // View mode toggle listeners + document.querySelectorAll('.view-mode-btn').forEach(btn => { + btn.addEventListener('click', () => switchViewMode(btn.getAttribute('data-mode'))); + }); +} + +// Initialize the page when DOM is loaded +document.addEventListener('DOMContentLoaded', initializePage); \ No newline at end of file diff --git a/public/register.html b/public/register.html new file mode 100644 index 0000000..270542b --- /dev/null +++ b/public/register.html @@ -0,0 +1,54 @@ + + + + + + Student Registration - School Warehouse System + + + + + +
+
+
+
+
+

Student Registration

+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +

Already have an account? Login here

+
+
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/public/student-reservations.html b/public/student-reservations.html new file mode 100644 index 0000000..d3ccd9a --- /dev/null +++ b/public/student-reservations.html @@ -0,0 +1,89 @@ + + + + + + My Reservations - Student + + + + + + + + +
+

My Reservations

+ +
+
+
Filter Reservations
+
+
+
+
+ + +
+
+ + +
+
+
+ + + + + + + + + + + + + + +
Item NameQuantityLocationReserved DateStatusActions
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/public/student.html b/public/student.html new file mode 100644 index 0000000..881e617 --- /dev/null +++ b/public/student.html @@ -0,0 +1,129 @@ + + + + + + Warehouse Dashboard - Student + + + + + + + + +
+
+
+

Available Items

+
+
+ +
+
+
+ + +
+
+
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + +
ImageItem NameDescriptionLocationQuantity AvailableAction
+
+
+ +
+ + + + + + + + \ No newline at end of file diff --git a/routes/auth.js b/routes/auth.js new file mode 100644 index 0000000..903a72a --- /dev/null +++ b/routes/auth.js @@ -0,0 +1,86 @@ +const express = require('express'); +const bcrypt = require('bcryptjs'); +const jwt = require('jsonwebtoken'); +const User = require('../models/User'); +const router = express.Router(); + +// Register new student +router.post('/register', async (req, res) => { + try { + const { username, password, email } = req.body; + + // Check if email already exists + const existingEmail = await User.findOne({ email }); + if (existingEmail) { + return res.status(400).json({ message: 'Email already registered' }); + } + + // Check if username already exists + const existingUsername = await User.findOne({ username }); + if (existingUsername) { + return res.status(400).json({ message: 'Username already taken' }); + } + + // Hash password + const hashedPassword = await bcrypt.hash(password, 10); + + // Create new student user + const user = new User({ + username, + password: hashedPassword, + email, + role: 'student' // Force role to be student + }); + + await user.save(); + + // Create and send token + const token = jwt.sign({ userId: user._id }, process.env.JWT_SECRET, { expiresIn: '24h' }); + + res.status(201).json({ + message: 'Student account created successfully', + token, + role: user.role, + username: user.username + }); + } catch (error) { + if (error.name === 'ValidationError') { + return res.status(400).json({ + message: 'Invalid email format. Email must be in the format: 123456@vistacollege.nl' + }); + } + res.status(500).json({ message: 'Server error' }); + } +}); + +// Login +router.post('/login', async (req, res) => { + try { + const { username, password } = req.body; + + const user = await User.findOne({ username: username.toLowerCase() }); + + if (!user) { + return res.status(401).json({ message: 'Invalid credentials' }); + } + + const passwordMatch = await bcrypt.compare(password, user.password); + + if (!passwordMatch) { + return res.status(401).json({ message: 'Invalid credentials' }); + } + + const token = jwt.sign({ userId: user._id }, process.env.JWT_SECRET, { expiresIn: '24h' }); + + res.json({ + token, + role: user.role, + username: user.username + }); + } catch (error) { + console.error('Login error:', error); + res.status(500).json({ message: 'Server error' }); + } +}); + +module.exports = router; \ No newline at end of file diff --git a/routes/items.js b/routes/items.js new file mode 100644 index 0000000..f07e5b6 --- /dev/null +++ b/routes/items.js @@ -0,0 +1,117 @@ +const express = require('express'); +const multer = require('multer'); +const path = require('path'); +const { auth, adminOnly } = require('../middleware/auth'); +const Item = require('../models/Item'); +const router = express.Router(); + +// Configure multer for image upload +const storage = multer.diskStorage({ + destination: (req, file, cb) => { + cb(null, 'public/images/items/'); + }, + filename: (req, file, cb) => { + const uniqueSuffix = Date.now() + '-' + Math.round(Math.random() * 1E9); + cb(null, 'item-' + uniqueSuffix + path.extname(file.originalname)); + } +}); + +const upload = multer({ + storage: storage, + fileFilter: (req, file, cb) => { + if (file.mimetype.startsWith('image/')) { + cb(null, true); + } else { + cb(new Error('Not an image! Please upload an image.'), false); + } + } +}); + +// Get all items +router.get('/', auth, async (req, res) => { + try { + const items = await Item.find(); + res.json(items); + } catch (error) { + res.status(500).json({ message: 'Server error' }); + } +}); + +// Get single item by ID +router.get('/:id', auth, async (req, res) => { + try { + const item = await Item.findById(req.params.id); + if (!item) { + return res.status(404).json({ message: 'Item not found' }); + } + res.json(item); + } catch (error) { + res.status(500).json({ message: 'Server error' }); + } +}); + +// Add new item (admin only) +router.post('/', auth, adminOnly, upload.single('image'), async (req, res) => { + try { + const itemData = { + name: req.body.name, + description: req.body.description, + location: req.body.location, + quantity: parseInt(req.body.quantity) + }; + + // If an image was uploaded, set the imageUrl + if (req.file) { + itemData.imageUrl = `/images/items/${req.file.filename}`; + } + + const item = new Item(itemData); + await item.save(); + res.status(201).json(item); + } catch (error) { + res.status(400).json({ message: error.message }); + } +}); + +// Update item (admin only) +router.put('/:id', auth, adminOnly, upload.single('image'), async (req, res) => { + try { + const updateData = { + name: req.body.name, + description: req.body.description, + location: req.body.location, + quantity: parseInt(req.body.quantity) + }; + + // If an image was uploaded, set the new imageUrl + if (req.file) { + updateData.imageUrl = `/images/items/${req.file.filename}`; + } else if (req.body.imageUrl !== undefined) { + // If imageUrl is explicitly provided (including empty string for removal) + updateData.imageUrl = req.body.imageUrl || '/images/default-item.png'; + } + + const item = await Item.findByIdAndUpdate(req.params.id, updateData, { new: true }); + if (!item) { + return res.status(404).json({ message: 'Item not found' }); + } + res.json(item); + } catch (error) { + res.status(400).json({ message: error.message }); + } +}); + +// Delete item (admin only) +router.delete('/:id', auth, adminOnly, async (req, res) => { + try { + const item = await Item.findByIdAndDelete(req.params.id); + if (!item) { + return res.status(404).json({ message: 'Item not found' }); + } + res.json({ message: 'Item deleted successfully' }); + } catch (error) { + res.status(500).json({ message: error.message }); + } +}); + +module.exports = router; \ No newline at end of file diff --git a/routes/reservations.js b/routes/reservations.js new file mode 100644 index 0000000..6a3aef7 --- /dev/null +++ b/routes/reservations.js @@ -0,0 +1,208 @@ +const express = require('express'); +const { auth, adminOnly } = require('../middleware/auth'); +const Reservation = require('../models/Reservation'); +const Item = require('../models/Item'); +const router = express.Router(); + +// Get all reservations (admin only) +router.get('/', auth, adminOnly, async (req, res) => { + try { + const reservations = await Reservation.find({ status: { $ne: 'ARCHIVED' } }) + .populate('userId', 'username') + .populate('itemId') + .exec(); + + if (!reservations) { + return res.json([]); // Return empty array if no reservations + } + + const formattedReservations = reservations + .filter(reservation => reservation.userId && reservation.itemId) // Filter out any invalid references + .map(reservation => ({ + _id: reservation._id, + studentName: reservation.userId.username, + itemName: reservation.itemId.name, + location: reservation.itemId.location, + status: reservation.status, + quantity: reservation.quantity || 1, + reservedDate: reservation.reservedDate + })); + + res.json(formattedReservations); + } catch (error) { + console.error('Error fetching reservations:', error); + res.status(500).json({ + message: 'Failed to load reservations', + error: error.message + }); + } +}); + +// Get user's reservations +router.get('/my', auth, async (req, res) => { + try { + const reservations = await Reservation.find({ + userId: req.user._id, + status: { $ne: 'ARCHIVED' } + }).populate('itemId'); + + // Filter out reservations with deleted items and format the response + const formattedReservations = reservations + .filter(reservation => reservation.itemId) // Only include reservations with valid items + .map(reservation => ({ + _id: reservation._id, + itemName: reservation.itemId.name, + location: reservation.itemId.location, + status: reservation.status, + quantity: reservation.quantity || 1, + reservedDate: reservation.reservedDate + })); + + res.json(formattedReservations); + } catch (error) { + console.error('Error fetching user reservations:', error); + res.status(500).json({ + message: 'Failed to load reservations', + error: error.message + }); + } +}); + +// Create reservation +router.post('/', auth, async (req, res) => { + try { + const item = await Item.findById(req.body.itemId); + if (!item) { + return res.status(404).json({ message: 'Item not found' }); + } + + const requestedQuantity = parseInt(req.body.quantity) || 1; + if (item.quantity < item.reserved + requestedQuantity) { + return res.status(400).json({ message: 'Requested quantity is not available' }); + } + + const reservation = new Reservation({ + itemId: req.body.itemId, + userId: req.user._id, + quantity: requestedQuantity + }); + + await reservation.save(); + item.reserved += requestedQuantity; + await item.save(); + + res.status(201).json(reservation); + } catch (error) { + res.status(400).json({ message: error.message }); + } +}); + +// Update reservation status (admin can update any, students can only mark as returned) +router.patch('/:id', auth, async (req, res) => { + try { + const reservation = await Reservation.findById(req.params.id).populate('userId'); + if (!reservation) { + return res.status(404).json({ message: 'Reservation not found' }); + } + + // Check authorization + const isAdmin = req.user.role === 'admin'; + const isOwner = reservation.userId._id.toString() === req.user._id.toString(); + const isReturning = req.body.status === 'RETURNED'; + + if (!isAdmin && (!isOwner || !isReturning)) { + return res.status(403).json({ + message: 'Not authorized. Students can only return their own items.' + }); + } + + // Additional validation for students + if (!isAdmin && isReturning && reservation.status !== 'APPROVED') { + return res.status(400).json({ + message: 'Can only return approved items' + }); + } + + const item = await Item.findById(reservation.itemId); + if (!item) { + return res.status(404).json({ message: 'Item not found' }); + } + + const oldStatus = reservation.status; + const newStatus = req.body.status; + reservation.status = newStatus; + + // Include quantity in the update if provided + if (req.body.quantity !== undefined) { + reservation.quantity = req.body.quantity; + } + + await reservation.save(); + + // Update item reserved count based on status change + if (oldStatus === 'PENDING' && newStatus === 'REJECTED') { + item.reserved = Math.max(0, item.reserved - (reservation.quantity || 1)); + await item.save(); + } else if (oldStatus === 'APPROVED' && newStatus === 'RETURNED') { + item.reserved = Math.max(0, item.reserved - (reservation.quantity || 1)); + await item.save(); + } + + res.json(reservation); + } catch (error) { + console.error('Error updating reservation:', error); + res.status(400).json({ message: error.message }); + } +}); + +// Delete reservation (admin can delete any, students can only delete their own) +router.delete('/:id', auth, async (req, res) => { + try { + const reservation = await Reservation.findById(req.params.id).populate('userId'); + if (!reservation) { + return res.status(404).json({ message: 'Reservation not found' }); + } + + // Check if user is authorized to delete this reservation + if (req.user.role !== 'admin' && reservation.userId._id.toString() !== req.user._id.toString()) { + return res.status(403).json({ message: 'Not authorized to delete this reservation' }); + } + + // Update item's reserved count + const item = await Item.findById(reservation.itemId); + if (item) { + item.reserved = Math.max(0, item.reserved - 1); // Ensure it doesn't go below 0 + await item.save(); + } + + await Reservation.findByIdAndDelete(req.params.id); + res.json({ message: 'Reservation deleted successfully' }); + } catch (error) { + res.status(500).json({ message: error.message }); + } +}); + +// Archive reservation (admin only) +router.patch('/:id/archive', auth, adminOnly, async (req, res) => { + try { + const reservation = await Reservation.findById(req.params.id); + if (!reservation) { + return res.status(404).json({ message: 'Reservation not found' }); + } + + // Only allow archiving of returned reservations + if (reservation.status !== 'RETURNED') { + return res.status(400).json({ message: 'Can only archive returned reservations' }); + } + + reservation.status = 'ARCHIVED'; + await reservation.save(); + + res.json({ message: 'Reservation archived successfully' }); + } catch (error) { + console.error('Error archiving reservation:', error); + res.status(500).json({ message: error.message }); + } +}); + +module.exports = router; \ No newline at end of file diff --git a/routes/upload.js b/routes/upload.js new file mode 100644 index 0000000..e283e8e --- /dev/null +++ b/routes/upload.js @@ -0,0 +1,43 @@ +const express = require('express'); +const multer = require('multer'); +const path = require('path'); +const { auth, adminOnly } = require('../middleware/auth'); +const router = express.Router(); + +// Configure multer for image upload +const storage = multer.diskStorage({ + destination: (req, file, cb) => { + cb(null, 'public/images/items/'); + }, + filename: (req, file, cb) => { + const uniqueSuffix = Date.now() + '-' + Math.round(Math.random() * 1E9); + cb(null, 'item-' + uniqueSuffix + path.extname(file.originalname)); + } +}); + +const upload = multer({ + storage: storage, + fileFilter: (req, file, cb) => { + if (file.mimetype.startsWith('image/')) { + cb(null, true); + } else { + cb(new Error('Not an image! Please upload an image.'), false); + } + } +}); + +// Upload image route +router.post('/', auth, adminOnly, upload.single('image'), async (req, res) => { + try { + if (!req.file) { + return res.status(400).json({ message: 'No file uploaded' }); + } + + const imageUrl = `/images/items/${req.file.filename}`; + res.json({ imageUrl }); + } catch (error) { + res.status(500).json({ message: error.message }); + } +}); + +module.exports = router; \ No newline at end of file diff --git a/seed.js b/seed.js new file mode 100644 index 0000000..c0e1d85 --- /dev/null +++ b/seed.js @@ -0,0 +1,73 @@ +const bcrypt = require('bcryptjs'); +const mongoose = require('mongoose'); +require('dotenv').config(); + +const User = require('./models/User'); +const Item = require('./models/Item'); + +async function seedDatabase() { + try { + // Connect to MongoDB + await mongoose.connect(process.env.MONGODB_URI); + console.log('Connected to MongoDB'); + + // Clear existing data + await User.deleteMany({}); + await Item.deleteMany({}); + + // Create admin user + const adminPassword = await bcrypt.hash('admin123', 10); + await User.create({ + username: 'admin', + password: adminPassword, + role: 'admin' + }); + + // Create test student + const studentPassword = await bcrypt.hash('student123', 10); + await User.create({ + username: 'student', + password: studentPassword, + role: 'student' + }); + + // Create some test items + const items = [ + { + name: 'Laptop', + location: 'Heerlen', + quantity: 5 + }, + { + name: 'Projector', + location: 'Maastricht', + quantity: 3 + }, + { + name: 'Microscope', + location: 'Sittard', + quantity: 4 + }, + { + name: 'Tablet', + location: 'Heerlen', + quantity: 10 + }, + { + name: 'Camera', + location: 'Maastricht', + quantity: 2 + } + ]; + + await Item.insertMany(items); + + console.log('Database seeded successfully'); + process.exit(0); + } catch (error) { + console.error('Error seeding database:', error); + process.exit(1); + } +} + +seedDatabase(); \ No newline at end of file diff --git a/server.js b/server.js new file mode 100644 index 0000000..c325b1a --- /dev/null +++ b/server.js @@ -0,0 +1,86 @@ +const express = require('express'); +const mongoose = require('mongoose'); +const cors = require('cors'); +const path = require('path'); +const os = require('os'); +require('dotenv').config(); + +const app = express(); + +// Load models first +const User = require('./models/User'); +const Item = require('./models/Item'); +const Reservation = require('./models/Reservation'); + +// Middleware +app.use(cors()); +app.use(express.json()); +app.use(express.static('public')); + +// Connect to MongoDB +mongoose.connect(process.env.MONGODB_URI) + .then(async () => { + console.log('Database connected and models initialized successfully'); + }) + .catch(err => { + console.error('MongoDB connection error:', err); + // Don't exit, just log the error + }); + +// Routes +app.use('/api/auth', require('./routes/auth')); +app.use('/api/items', require('./routes/items')); +app.use('/api/reservations', require('./routes/reservations')); +app.use('/api/upload', require('./routes/upload')); + +// Error handling middleware +app.use((err, req, res, next) => { + console.error('Error:', err); + res.status(500).json({ + message: 'Internal server error', + error: process.env.NODE_ENV === 'development' ? err.message : undefined + }); +}); + +// Serve static files +app.get('*', (req, res) => { + res.sendFile(path.join(__dirname, 'public', 'index.html')); +}); + +const PORT = process.env.PORT || 3000; + +// Get local IP addresses +function getLocalIPs() { + const interfaces = os.networkInterfaces(); + const addresses = []; + + for (const interfaceName in interfaces) { + const interface = interfaces[interfaceName]; + for (const address of interface) { + // Skip internal and non-IPv4 addresses + if (address.family === 'IPv4' && !address.internal) { + addresses.push(address.address); + } + } + } + return addresses; +} + +// Handle uncaught exceptions +process.on('uncaughtException', (err) => { + console.error('Uncaught Exception:', err); +}); + +// Handle unhandled promise rejections +process.on('unhandledRejection', (reason, promise) => { + console.error('Unhandled Rejection at:', promise, 'reason:', reason); +}); + +app.listen(PORT, () => { + const localIPs = getLocalIPs(); + console.log(`Server is running on:`); + console.log(`- Local: http://localhost:${PORT}`); + localIPs.forEach(ip => { + console.log(`- Network: http://${ip}:${PORT}`); + }); +}); \ No newline at end of file