A modern, full-featured library management system built with Next.js and React. Manage books, track issues/returns, handle student bookings, calculate fines, and send email notifications β all with a dark-themed interface.
- User Registration with auto-generated unique student IDs
- Browse and search books (with images)
- Book reservation with a 6-hour pickup window
- View issued books and due dates
- Track fines (βΉ10/day after a 7-day grace period)
- Request reissue (extend return date)
- Receive email notifications for bookings, issues, returns, and due reminders
- Add, edit, and delete books (with internet images)
- Issue and return books with quick search by student name, email, or ID
- Approve and manage student bookings
- Set custom due dates (1β7 days) when issuing
- Handle reissues and extend due dates
- Generate and export overdue reports
- View email log for scheduled and sent emails
- Add and remove librarian accounts
- View circulation statistics and system analytics
- Generate and print monthly reports
- Delete old transaction records
- Track totals: books, issues, returns, and fines
- Frontend: Next.js 16, React 19, TypeScript
- Styling: Tailwind CSS v4, shadcn/ui components
- State Management: Zustand
- Email Service: Nodemailer with Gmail SMTP
- Storage: Browser localStorage (client-side, no backend required)
- Deployment: Vercel
- Node.js 18+ and npm
- Gmail account with App Password enabled (for SMTP)
- Vercel account (optional, for deployment)
- Clone the repository
git clone https://github.com/PUSHPAK-JAISWAL/Library_Management_System.git
cd Library_Management_System- Install dependencies
npm install- Create environment file
.env.localin project root and add:
# Gmail SMTP Configuration
GMAIL_SENDER_EMAIL=your_email@gmail.com
GMAIL_APP_PASSWORD=your_app_password_here
NEXT_PUBLIC_APP_URL=http://localhost:3000How to get a Gmail App Password:
-
Go to Google Account > Security
-
Enable 2-Step Verification
-
Create an App Password for "Mail"
-
Use the generated 16-character password as
GMAIL_APP_PASSWORD -
Run development server
npm run devOpen http://localhost:3000 in your browser.
- Email: admin@lib.com
- Password: password
Recommended first steps:
- Log in as admin.
- Create librarian accounts.
- Add books to the catalogue.
- Share student signup link with students.
- Students register and start booking books.
Workflows:
- Students sign up β browse books β book β receive booking email β librarian issues book β student tracks dues and returns/reissues as needed.
- Librarians manage books, bookings, issues/returns, and generate reports.
- Admin manages librarians, views statistics, and cleans old data.
library-management-system/
βββ app/
β βββ api/
β β βββ send-email/route.ts
β βββ actions/
β β βββ email-config.ts
β βββ globals.css
β βββ layout.tsx
β βββ page.tsx
βββ components/
β βββ admin/
β βββ auth/
β βββ librarian/
β βββ student/
β βββ notifications/
β βββ ui/
βββ hooks/
β βββ use-email-notifications.ts
βββ lib/
β βββ store.ts
β βββ email-scheduler.ts
βββ package.json
- Role-based access: separate permissions for students, librarians, and admins
- Unique student IDs are auto-generated
- All application data persists in the browser's localStorage (client-side only)
- Email sending uses Gmail SMTP with App Passwords β keep credentials secure
- Passwords used in the app are stored locally β for production or multi-user setups, add a backend and secure storage
The app sends automatic emails for:
- Booking confirmations
- Book issue notifications
- Return confirmations
- Reissue notifications
- Due reminders (development default: short/demo intervals; adjust for production)
Data stored in localStorage includes:
- Books and inventory
- Student accounts and bookings
- Issue/return history and transactions
- Fine calculations and email logs
Note: localStorage persists per browser and device. Back up/export data if needed.
- Push your code to GitHub.
- Go to https://vercel.com and import the repository.
- Add environment variables in Vercel:
- GMAIL_SENDER_EMAIL
- GMAIL_APP_PASSWORD
- NEXT_PUBLIC_APP_URL
- Deploy via Vercel UI or CLI:
npm install -g vercel
vercelEmails not sending:
- Verify Gmail App Password and 2-Step Verification are enabled
- Ensure
GMAIL_SENDER_EMAILmatches the Gmail account - Check browser console / server logs for errors
Data not persisting:
- Ensure localStorage is enabled in the browser
- Clear cache or try incognito to check different results
Students cannot sign up:
- Ensure signup route/page is accessible
- Verify email format and uniqueness logic
- Check console for runtime errors
- Backend database integration (Postgres/MongoDB)
- Centralized authentication and secure password storage
- Advanced search and filtering
- Book recommendations and analytics
- SMS notifications and push notifications
- Mobile app and QR code scanning
- Multi-library / multi-branch support
This project is open source under the MIT License. See LICENSE file for details.
Contributions are welcome! Suggested workflow:
- Fork the repository
- Create a feature branch: git checkout -b feat/your-feature
- Implement changes and add tests where applicable
- Commit, push, and open a Pull Request describing the changes
Please follow the existing coding style and include tests for new features or bug fixes.
For issues and questions, please open an issue on GitHub with:
- Steps to reproduce
- Expected vs actual behavior
- Error messages / stack traces
- Environment (OS, Node.js version, browser)