A comprehensive, modern library management system built with Next.js 15, featuring role-based access control for Members and Librarians. This system streamlines book circulation, inventory management, and member services with a beautiful, responsive user interface.
Librarium provides a complete solution for managing library resources, tracking book circulation, and handling member reservations. The system supports distinct user roles, each with tailored dashboards and functionalities to meet their specific needs.
- Multi-Role System: Separate dashboards for Members (Users) and Librarians (Admins)
- Smart Circulation: Efficient tracking of book issues, returns, and overdue fines
- Catalog Management: Comprehensive management of Books, Authors, Genres, and Racks
- Responsive Design: Modern UI built with TailwindCSS 4 and Radix UI components
- Type-Safe: Full TypeScript implementation with Zod validation
- Database-Driven: PostgreSQL with Prisma ORM for robust data management
- Catalog Browsing: Browse available books, filter by genre, author, or subject
- Smart Search: Advanced search functionality to find resources quickly
- Reservation System: Reserve books that are currently borrowed
- Borrow History: View current loans and past borrowing history
- Fine Tracking: Track and view outstanding fines
- Profile Management: Update personal information and preferences
- Dashboard Overview: Real-time statistics on total books, active members, and circulation
- Resource Management: Add, update, and remove Books, Authors, Genres, and Subjects
- Inventory Control: Manage physical items, rack locations, and status (Available, Lost, Damaged)
- Circulation Desk: Streamlined process for issuing and returning books
- Member Management: Manage member accounts, roles, and statuses
- Fine Management: Track and settle member fines
- Reports & Analytics: View circulation trends and inventory reports
- Next.js 15 - React framework with App Router
- React 19 - UI library
- TypeScript - Type-safe development
- TailwindCSS 4 - Utility-first CSS framework
- Radix UI - Accessible component primitives
- Shadcn/ui - High-quality component library
- Recharts - Chart library for analytics
- React Hook Form - Form management
- Zod - Schema validation
- Motion - Animation library
- Next.js API Routes - Server-side API endpoints
- Better Auth - Authentication and session management
- Prisma - Type-safe database ORM
- PostgreSQL - Relational database
- ESLint - Code linting
- Turbopack - Fast bundler for development
Before you begin, ensure you have the following installed:
- Node.js 20.x or higher
- npm, yarn, pnpm, or bun package manager
- PostgreSQL database (local or cloud instance)
git clone <repository-url>
cd library-systemnpm install
# or
yarn install
# or
pnpm installCreate a .env file in the root directory and add the following variables:
# Database
DATABASE_URL="postgresql://username:password@localhost:5432/library_db?schema=public"
# Better Auth Configuration
BETTER_AUTH_URL="http://localhost:3000"
BETTER_AUTH_SECRET="your_secret_key"
# Next.js
NEXT_PUBLIC_APP_URL="http://localhost:3000"Generate Prisma Client and run migrations:
# Generate Prisma Client
npx prisma generate
# Push schema to database
npm run db:push
# (Optional) Seed the database with initial data
npm run db:seednpm run devOpen http://localhost:3000 in your browser to see the application.
library-system/
├── app/ # Next.js App Router pages
│ ├── api/ # API routes
│ │ ├── auth/ # Authentication API
│ │ ├── books/ # Books API
│ │ ├── transactions/ # Transactions API
│ │ └── users/ # User API
│ ├── dashboard/ # Dashboard pages
│ │ ├── admin/ # Admin dashboard
│ │ └── user/ # User dashboard
│ ├── auth/ # Auth pages (Login/Signup)
│ └── page.tsx # Landing page
├── components/ # React components
│ ├── auth/ # Authentication components
│ ├── dashboard/ # Dashboard components
│ ├── ui/ # UI components (Shadcn)
│ └── ...
├── lib/ # Utility functions and configurations
│ ├── auth.ts # Auth configuration
│ ├── prisma.ts # Prisma client
│ └── utils.ts # Utility functions
├── prisma/ # Database schema and migrations
│ ├── schema.prisma # Prisma schema
│ └── seed.ts # Database seeder
├── public/ # Static assets
└── package.json # Dependencies and scripts
The system uses Better Auth for secure authentication:
- Sign Up: Users register with name, email, and password
- Sign In: Secure login with credentials
- Role-Based Access: Automatic routing based on user role (USER, ADMIN)
- Session Management: Secure session handling
The system uses PostgreSQL with the following main models:
- User: System users with roles (User, Admin)
- Resource: Book titles and metadata
- Item: Physical copies of books
- Transaction: Borrow and return records
- Reservation: Book reservation requests
- Author/Genre/Subject: Metadata for categorization
- Rack: Physical location tracking
# Development
npm run dev # Start development server with Turbopack
# Production
npm run build # Build for production
npm run start # Start production server
# Database
npm run db:push # Push schema changes to DB
npm run db:seed # Seed databaseThis project is private and proprietary.