SLMS Documentation
Complete technical documentation for the Smart Library Management System — frontend, backend, and API reference.
Smart Library Management System (SLMS)
Welcome to the complete technical documentation for SLMS — a full-stack digital platform designed to automate library operations, empower users with self-service capabilities, and provide data-driven insights for academic institutions.
Architecture at a Glance
┌──────────────────────────────────────────────────────┐
│ Frontend (Next.js) │
│ React 19 · Tailwind CSS 4 · Shadcn UI · App Router │
│ Role-Based Portals: Admin | Librarian | Student | │
│ Staff | Setup Wizard | Auth Pages │
└──────────────────────┬───────────────────────────────┘
│ Axios HTTP Client (JWT Bearer)
▼
┌──────────────────────────────────────────────────────┐
│ Backend (Express.js) │
│ Node.js · REST API v1 · Dual-Token JWT Auth │
│ Mongoose ODM · Nodemailer · node-cron Jobs │
│ Routes: auth | users | books | circulation | fines │
│ reservations | notifications | reports | audit │
└──────────────────────┬───────────────────────────────┘
│ Mongoose ODM
▼
┌──────────────────────────────────────────────────────┐
│ MongoDB Atlas (Cloud) │
│ 12 Collections: users, books, bookcopies, │
│ transactions, fines, categories, reservations, │
│ notifications, auditlogs, refreshtokens, │
│ blacklistedtokens, systemconfigs │
└──────────────────────────────────────────────────────┘Documentation Map
Getting Started
- Project Overview — What SLMS is, its goals, and scope
- Technology Stack — Every framework, library, and tool used
- Getting Started Guide — Install, configure, and run locally
Backend Modules
- Backend Architecture — High-level server design and directory structure
- Server Entry Point —
server.jsbreakdown and middleware chain - Database Models — All 12 Mongoose schemas with field definitions
- Authentication Module — JWT dual-token auth and RBAC authorization
- Controllers — Request handlers for each API domain
- Routes — Route definitions with method, path, and access control
- Services — Business logic layer (Email service, User service)
- Utilities — Database connection, email templates, error handling
- Scheduled Jobs — Cron jobs for fine calculation and overdue detection
Frontend Modules
- Frontend Architecture — Next.js App Router structure and design patterns
- Root Layout — Provider hierarchy and global configuration
- Authentication Pages — Login, Register, Forgot Password, Setup Wizard
- Admin Portal — All admin dashboard pages and CRUD interfaces
- Librarian Portal — Librarian desk operations
- Student Portal — Student self-service dashboard
- Staff Portal — Faculty borrowing portal
- Components — Shared components (Sidebar, TopNav, ThemeToggle)
- State Management — AuthContext and React Context patterns
- API Client — Axios instance with interceptors
- Design System — Theme tokens, CSS variables, dark mode
API Reference
- API Documentation — Complete REST API overview
- Auth Endpoints — Setup, Login, Refresh, Logout, Get Profile
- Users Endpoints — CRUD operations for user management
- Books Endpoints — Catalogue and copy management
- Circulation Endpoints — Issue, Return, History, Active loans
- Fines Endpoints — Fine listing and payment
- Dashboard Endpoints — Aggregate statistics and analytics
- Reservations Endpoints — Book hold requests and fulfillment
- Notifications Endpoints — In-app notification management
- Reports Endpoints — CSV export for circulation and fines
- Audit Endpoints — Security audit log retrieval
- System Config Endpoints — Runtime configuration management
Operations
- Deployment — Vercel deployment guide and environment variables