├── .gitignore ├── images └── profile.png ├── public ├── image │ └── profile │ │ └── profile.png ├── stylesheet │ └── app.css └── assets │ ├── js │ └── popper.min.js │ └── css │ └── font-awesome.min.css ├── .env ├── utils └── delete_image.js ├── models ├── book.js ├── comment.js ├── issue.js ├── activity.js └── user.js ├── views ├── partials │ ├── footer.html │ ├── alerts.html │ ├── header.html │ ├── adminNav.html │ └── userNav.html ├── admin │ ├── adminLogin.html │ ├── book.html │ ├── addBook.html │ ├── notification.html │ ├── user.html │ ├── bookInventory.html │ ├── activities.html │ ├── users.html │ ├── profile.html │ └── index.html ├── landing.html ├── user │ ├── userLogin.html │ ├── notification.html │ ├── userSignup.html │ ├── return-renew.html │ ├── bookDetails.html │ ├── profile.html │ └── index.html ├── signup.html └── books.html ├── routes ├── books.js ├── auth.js ├── users.js ├── index.js └── admin.js ├── middleware └── index.js ├── resize.js ├── LICENSE ├── seed.js ├── package.json ├── controllers ├── auth.js ├── books.js ├── admin.js └── user.js ├── README.md └── server.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env 3 | TODO.md -------------------------------------------------------------------------------- /images/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azad71/Library-Management-System/HEAD/images/profile.png -------------------------------------------------------------------------------- /public/image/profile/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azad71/Library-Management-System/HEAD/public/image/profile/profile.png -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | SESSION_SECRET=$2y$12$nNYIs5iStm9gAsdgDGv3l.OyZN3Reav7U.YfwYW/L/171cjIHgjbm 2 | ADMIN_SECRET=opensesame 3 | DB_URL= mongodb://127.0.0.1:27017/library 4 | PORT=5005 5 | -------------------------------------------------------------------------------- /utils/delete_image.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | 3 | const deleteImage = (imagePath, next) => { 4 | fs.unlink(imagePath, (err) => { 5 | if (err) { 6 | console.log("Failed to delete image at delete profile"); 7 | return; 8 | } 9 | }); 10 | }; 11 | 12 | module.exports = deleteImage; 13 | -------------------------------------------------------------------------------- /models/book.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const bookSchema = new mongoose.Schema({ 4 | title: String, 5 | ISBN: String, 6 | stock: Number, 7 | author: String, 8 | description: String, 9 | category: String, 10 | comments: [ 11 | { 12 | type: mongoose.Schema.Types.ObjectId, 13 | ref: "Comment", 14 | }, 15 | ], 16 | }); 17 | 18 | module.exports = mongoose.model("Book", bookSchema); 19 | -------------------------------------------------------------------------------- /views/partials/footer.html: -------------------------------------------------------------------------------- 1 | 2 |