Skip to content

Magar0/Library-management-system-NextJs

Repository files navigation


Project Banner Project Banner
next.js TypeScript postgresql upstash tailwindcss

A University Library Management System with Admin Panel

  1. 🤖 Introduction
  2. ⚙️ Tech Stack
  3. 🔋 Features
  4. 🤸 Quick Start
  5. 🎥 Youtube
  6. 🟢 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.

🔐 Authentication & Security

  • 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

📚 Book Management

  • 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

👤 User Features

  • 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

🤖 Automation & Workflows

  • Onboarding Workflows: Automated welcome emails (Nodemailer) + inactivity follow-ups

⚡ Performance & Scalability

  • 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

🛠️ Advanced Features

  • 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-NextJs

Installation

Install the project dependencies using npm:

npm install

Set 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:migrate

Seed the Database (Optional)

npm run seed

Running the Project

npm run dev

Open 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

About

Library Management System with industry-standard practices; from rate-limiting, DDoS protection, caching,optimizations, multi-media uploads, complex db queries, and advanced error handling to automated workflows with custom notifications.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors