The Digital Archivist is a full-stack library management system for managing books, students, circulation, fines, notices, notifications, and library-wide settings. The project uses a static HTML/CSS/JavaScript frontend served by an Express backend with MongoDB persistence.
public/contains the frontend pages, styles, and browser scripts.public/pages/auth/contains login, signup, and forgot-password pages.public/pages/admin/contains admin dashboards for books, users, transactions, and settings.public/pages/student/contains student dashboard, catalog browsing, account, and borrowed-books views.backend/src/server.jsstarts the Express API, connects to MongoDB, seeds a default admin account, and serves the frontend.backend/src/routes/defines API routes for auth, books, users, transactions, students, settings, notices, and notifications.backend/src/models/defines Mongoose models for users, books, transactions, settings, notices, and notifications.backend/src/middleware/handles JWT auth, role checks, maintenance mode, and book-cover uploads.
- JWT-based authentication with student, librarian, and admin roles.
- Student registration, login, profile updates, and password changes.
- Admin user management with status updates and password reset support.
- Book catalog CRUD with categories, filters, cover-image uploads, soft delete, and restore.
- Circulation workflow for borrowing, returning, renewing, overdue tracking, and fine payments.
- Student catalog browsing, active loans, history, holds, and dashboard stats.
- Library settings for loan days, fine policy, registration, maintenance mode, and library details.
- Notices and unread notification badges for admins and students.
- Security middleware including Helmet, CORS, request rate limiting, and password hashing.
- Frontend: HTML, CSS, JavaScript
- Backend: Node.js, Express
- Database: MongoDB with Mongoose
- Authentication: JWT, bcryptjs
- Uploads: Multer
- Utilities: dotenv, dayjs, morgan, compression, express-validator
git clone https://github.com/RajHarsh03/Library-Management-System.git
cd Library-Management-Systemcd backend
npm installCreate a .env file inside the backend/ directory:
PORT=5000
NODE_ENV=development
MONGODB_URI=mongodb://localhost:27017/digital_archivist
JWT_SECRET=change_this_secret
JWT_EXPIRE=7d
ADMIN_EMAIL=admin@archivist.sys
ADMIN_PASSWORD=admin123
CORS_ORIGIN=*
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=500npm run devThe app will be available at:
http://localhost:5000
The health check endpoint is:
http://localhost:5000/api/health
On startup, the backend creates a default admin account if no admin exists:
Email: admin@archivist.sys
Password: admin123
You can override these values with ADMIN_EMAIL and ADMIN_PASSWORD in backend/.env.
Run these from the backend/ directory:
npm start
npm run dev
npm test
npm run lintPOST /api/auth/register- register a userPOST /api/auth/login- log in and receive a JWTGET /api/auth/me- get the current user profileGET /api/books- browse/search booksPOST /api/books- create a book as admin or librarianGET /api/users- manage users as adminPOST /api/transactions/borrow- issue a bookPOST /api/transactions/return- return a bookGET /api/student/dashboard- student dashboard dataGET /api/settings/public- public library settingsGET /api/notifications/unread-count- unread notification countGET /api/notices- active notices
/login/signup/forgot-password/admin/dashboard/admin/books/admin/users/admin/transactions/admin/settings/student/dashboard/student/browse/student/my-books/student/account
Library Management System/
|-- backend/
| |-- package.json
| `-- src/
| |-- config/
| |-- controllers/
| |-- middleware/
| |-- models/
| |-- routes/
| |-- utils/
| `-- server.js
|-- public/
| |-- pages/
| |-- scripts/
| `-- styles/
|-- vercel.json
`-- README.md
- The frontend API helper uses the current origin and calls endpoints under
/api. - Uploaded book covers are stored in
public/uploads/covers. - MongoDB must be running locally or available through the configured
MONGODB_URI. - In production, do not keep the default admin password or default JWT secret.
If you make an enhancement, bug fix, or useful improvement, please open a pull request so it can be reviewed and merged into the project.
This project is free to use, modify, and distribute under the MIT License. You may use it for learning, personal projects, academic work, or as a starting point for your own library management system.