A full-stack Library Management System for modern libraries, built with React, Node.js, Express, MongoDB, and Tailwind CSS. BookVault enables users and admins to manage books, borrowing, overdue reminders, waitlists, and more, with a beautiful responsive UI and advanced features.
- Features
- Tech Stack
- Project Structure
- Setup & Installation
- Environment Variables
- Deployment
- API Endpoints
- Usage Guide
- Troubleshooting
- Credits
- License
- User authentication (register/login/logout)
- Admin dashboard with statistics, book management, and user management
- Borrow/return books, overdue reminders via email
- Waitlist and notifications for unavailable books
- Customizable library rules (admin settings: max books, loan period, fine)
- Book image upload and viewing
- Search, filter, and sort books
- Borrow history and fine tracking
- Responsive UI with dark/light mode toggle
- Role-based access control (admin/user)
- RESTful API with error handling
- Daily cron jobs for overdue reminders
- Frontend: React, Tailwind CSS, Axios, React Router
- Backend: Node.js, Express, MongoDB (Mongoose), dotenv, cors, nodemailer, node-cron
- Deployment: Vercel (frontend & backend), Netlify, Render, Railway
Library/
backend/ # Express + MongoDB API
routes/ # API route handlers
models/ # Mongoose models
controllers/# Business logic
scheduler/ # Cron jobs
uploads/ # Book cover images
.env # Backend environment variables
server.js # Main server file
frontend/ # React + Tailwind CSS SPA
src/ # React source code
public/ # Static assets
.env # Frontend environment variables
vite.config.js # Vite config
README.md # Frontend documentation
- Install dependencies:
cd backend npm install - Set up
.envwith your MongoDB URI and other secrets:MONGO_URI=your_mongodb_uri PORT=5000 EMAIL_USER=your_email@example.com EMAIL_PASS=your_email_password
- Start the server:
npm start
- Install dependencies:
cd frontend npm install - Set API base URL in
.env:VITE_API_URL=https://your-backend-domain.com
- Start the React app:
npm run dev
- Backend:
MONGO_URI- MongoDB connection stringPORT- Server portEMAIL_USER,EMAIL_PASS- For sending overdue reminders
- Frontend:
VITE_API_URL- Base URL for backend API
- Frontend: Deploy the
frontendbuild folder to Vercel, Netlify, or similar. - Backend: Deploy the
backendto Vercel, Render, Railway, or similar. - Ensure CORS is enabled on the backend for your frontend domain.
- For Vercel SPA routing, add a
vercel.json:{ "rewrites": [ { "source": "/(.*)", "destination": "/index.html" } ] }
POST /api/users/register- Register a new userPOST /api/users/login- LoginGET /api/books- List/search booksPOST /api/borrow/request/:bookId- Request to borrow a bookPUT /api/borrow/:id/return- Return a bookGET /api/borrow/me- Get user's borrow recordsGET /api/admin/stats- Admin dashboard statsPOST /api/books/:bookId/waitlist- Join waitlist for a bookGET /api/admin/settings- Get library rulesPUT /api/admin/settings- Update library rules- ...and more (see backend routes)
- Register and login
- Browse/search books
- Request to borrow available books
- Join waitlist for unavailable books
- View borrow history and fines
- Toggle dark/light mode
- Login as admin
- View dashboard stats
- Add/edit/delete books
- Approve/reject borrow requests
- Update library rules (max books, loan period, fine)
- View all borrow records and user activities
- White screen or missing books: Check API URL in frontend
.envand CORS settings in backend. - Network errors: Ensure backend is deployed and accessible, and API URL is correct.
- MIME type errors: For Vercel, use correct SPA rewrite in
vercel.json. - Email not sending: Check email credentials in backend
.env. - MongoDB connection issues: Verify
MONGO_URIand database access.
- Project by Shanidhya01
- UI/UX inspired by modern library systems
- Powered by open-source technologies
MIT