- 🤖 Introduction
- ⚙️ Tech Stack
- 🔋 Features
- 🤸 Quick Start
- 🎥 Youtube
- 🟢 Live Page
Built with Next.js, TypeScript, and Postgres, the University Library Management System is a production-grade platform featuring a public-facing app and an admin interface. It offers advanced functionalities like seamless book borrowing with reminders and receipts, robust user management, automated workflows, and a modern, optimized tech stack for real-world scalability.
Clicke here to watch a short youtube video of my project
👉 Frontend: Next.js (TypeScript), TailwindCSS, ShadCN, Framer Motion, ImageKit, Redux Toolkit.
👉 Backend: Next.js API Routes, Drizzle ORM (type-safe queries), PostgresSql, Upstash.
👉 Email Handling: Nodemailer for transactional emails.
- Open-source Authentication: Personalized onboarding flow with email notifications (NextAuth.js)
- Role-Based Access Control: Admins approve/reject users and assign roles (User/Admin)
- DDoS Protection & Rate-Limiting: Secure API endpoints against abuse
- Home Page: Highlighted books and newly added books with 3D effects
- Book Detail Pages: Availability tracking, summaries, videos, and similar book suggestions
- Admin Book CRUD: Add, edit, or delete books with pagination support
- Infinite Scrolling and Pagination: Smooth browsing for large book catalogs
- Profile Page: Manage accounts, track borrowed books, and download receipts
- Borrowing System: Request/return books with due-date reminders
- Borrowing History: View past transactions and receipts
- Onboarding Workflows: Automated welcome emails (Nodemailer) + inactivity follow-ups
- Database Management: PostgreSQL with Neon for serverless scalability
- Efficient Caching: Upstash Redis for fast data retrieval and triggers
- Real-time Media Processing: ImageKit for optimized book covers/videos
- Admin Dashboard:
- Approve/reject users
- Manage all books, users, and borrowing records
- Role switching (promote/demote users)
- Code Architecture: Modular, reusable components with TypeScript
- PDF Receipt Generation: Automatic receipts for borrowed books and many more, including code architecture and reusability
Follow these steps to set up the project locally on your machine.
Prerequisites
Make sure you have the following installed on your machine:
Cloning the Repository
git clone [https://github.com/Magar0/Library-management-system-NextJs.git]
cd Library-management-system-NextJsInstallation
Install the project dependencies using npm:
npm installSet Up Environment Variables
Create a new file named .env in the root of your project and add the following content:
NEXT_PUBLIC_IMAGEKIT_PUBLIC_KEY=
IMAGEKIT_PRIVATE_KEY=
NEXT_PUBLIC_IMAGEKIT_URL_ENDPOINT=
NEXT_PUBLIC_API_ENDPOINT=
NEXT_PUBLIC_PROD_API_ENDPOINT=
DATABASE_URL=
UPSTASH_REDIS_ENDPOINT=
UPSTASH_REDIS_TOKEN=
AUTH_SECRET=
# Required for workflow
QSTASH_URL=
QSTASH_TOKEN=
# nodemailer.. must be gmail account
SMTP_MAIL=
SMTP_PASSWORD=Replace the placeholder values with your actual ImageKit, NeonDB, Upstash, and SMTP credentials. You can obtain these credentials by signing up on the ImageKit, NeonDB, Upstash.
Database Setup
npm run db:generate
npm run db:migrateSeed the Database (Optional)
npm run seedRunning the Project
npm run devOpen http://localhost:3000 in your browser to view the project.
***Note
To run Qstash workflow , you will need a domain url not localhost. You can use this dummy account to get admin privilege
email:admin@gmail.com
password:12345678
