├── .gitignore ├── images ├── background.jpg └── profile-pic.jpg ├── controllers ├── logout.js ├── signup.js ├── login.js ├── customer.js └── admin.js ├── package.json ├── views ├── admin │ ├── partials │ │ ├── template.html │ │ ├── sidebar.html │ │ └── navbar.html │ ├── home.ejs │ ├── change-password.ejs │ ├── customers-profile.ejs │ ├── profile.ejs │ ├── customers.ejs │ ├── profile-edit.ejs │ ├── books-delete.ejs │ ├── customers-delete.ejs │ ├── books-issue.ejs │ ├── books-requested.ejs │ ├── books-add.ejs │ ├── books-edit.ejs │ ├── customers-add.ejs │ ├── customers-edit.ejs │ ├── books.ejs │ └── issued-books.ejs ├── customer │ ├── partials │ │ ├── template.html │ │ ├── sidebar.html │ │ └── navbar.html │ ├── home.ejs │ ├── change-password.ejs │ ├── borrow-history.ejs │ ├── profile.ejs │ ├── books-request.ejs │ ├── borrowed-books.ejs │ ├── profile-edit.ejs │ └── books.ejs ├── partials │ ├── footer.html │ └── header.html ├── login.ejs └── signup.ejs ├── css ├── signup.css ├── login.css ├── admin.css └── customer.css ├── models ├── config.js ├── userModel.js └── bookModel.js ├── app.js ├── validation_rules └── rules.js └── library_management_system.sql /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /images/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafin007/Library-Management-System-Nodejs/HEAD/images/background.jpg -------------------------------------------------------------------------------- /images/profile-pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafin007/Library-Management-System-Nodejs/HEAD/images/profile-pic.jpg -------------------------------------------------------------------------------- /controllers/logout.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | 4 | router.get('/', (req, res)=> { 5 | req.session.destroy(); 6 | res.redirect('/login'); 7 | }); 8 | 9 | module.exports = router; 10 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "nodemon app.js" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "async-validator-2": "^1.0.0", 14 | "body-parser": "^1.18.3", 15 | "ejs": "^2.6.1", 16 | "express": "^4.16.3", 17 | "express-session": "^1.15.6", 18 | "mysql": "^2.15.0", 19 | "nodemon": "^1.17.5" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /views/admin/partials/template.html: -------------------------------------------------------------------------------- 1 | <%-include('../partials/header.html')%> 2 | 3 |