Skip to content

A modern library management app built with Next.js and TypeScript that runs entirely client-side using browser storage. It provides student, librarian, and admin workflows for managing books, bookings, issues, returns, fines, and email notifications, making it easy to run a small-scale library without a backend.

License

Notifications You must be signed in to change notification settings

ajayy3/Library_Management_System

Β 
Β 

Library Management System

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.

🌟 Features

For Students

  • 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

For Librarians

  • 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

For Admin

  • 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

πŸ› οΈ Tech Stack

  • 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

πŸ“‹ Prerequisites

  • Node.js 18+ and npm
  • Gmail account with App Password enabled (for SMTP)
  • Vercel account (optional, for deployment)

πŸš€ Installation

  1. Clone the repository
git clone https://github.com/PUSHPAK-JAISWAL/Library_Management_System.git
cd Library_Management_System
  1. Install dependencies
npm install
  1. Create environment file .env.local in 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:3000

How to get a Gmail App Password:

  1. Go to Google Account > Security

  2. Enable 2-Step Verification

  3. Create an App Password for "Mail"

  4. Use the generated 16-character password as GMAIL_APP_PASSWORD

  5. Run development server

npm run dev

Open http://localhost:3000 in your browser.

πŸ“– Usage

Default Admin Account

Recommended first steps:

  1. Log in as admin.
  2. Create librarian accounts.
  3. Add books to the catalogue.
  4. Share student signup link with students.
  5. 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.

πŸ“ Project Structure (high level)

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

πŸ” Security & Data Notes

  • 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

πŸ“§ Email Notifications

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 Storage

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.

πŸš€ Deployment (Vercel)

  1. Push your code to GitHub.
  2. Go to https://vercel.com and import the repository.
  3. Add environment variables in Vercel:
    • GMAIL_SENDER_EMAIL
    • GMAIL_APP_PASSWORD
    • NEXT_PUBLIC_APP_URL
  4. Deploy via Vercel UI or CLI:
npm install -g vercel
vercel

πŸ› Troubleshooting

Emails not sending:

  • Verify Gmail App Password and 2-Step Verification are enabled
  • Ensure GMAIL_SENDER_EMAIL matches 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

πŸ“Š Future Enhancements

  • 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

πŸ“ License

This project is open source under the MIT License. See LICENSE file for details.

🀝 Contributing

Contributions are welcome! Suggested workflow:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feat/your-feature
  3. Implement changes and add tests where applicable
  4. 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.

πŸ“ž Support

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)

πŸ”— Links


About

A modern library management app built with Next.js and TypeScript that runs entirely client-side using browser storage. It provides student, librarian, and admin workflows for managing books, bookings, issues, returns, fines, and email notifications, making it easy to run a small-scale library without a backend.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 91.7%
  • CSS 8.0%
  • JavaScript 0.3%