A modern, full-featured digital library platform built with Next.js and React. This application allows users to browse, borrow, and read digital books (EPUB and PDF formats) with administrative tools for library management.
E-Library is a comprehensive library management system designed for educational institutions. It provides:
-
User Features:
- User authentication and profile management
- Browse and search digital book catalog
- Borrow and reserve books
- Read books in-browser with EPUB and PDF readers
- View reading history and loan status
- Submit book reviews and ratings
- Share books with others
-
Admin Features:
- Manage book inventory
- Track borrowing and loan history
- Manage student accounts and user permissions
- View analytics and usage statistics
- Upload and manage digital resources
- Next.js 16 - React framework for production with App Router
- React 19 - UI library
- TypeScript - Type-safe JavaScript
- Prisma 7.8 - Type-safe database ORM
- Superbase - Database with Prisma adapter
- Better Auth 1.6 - Simple and secure authentication
- Prisma Adapter - Integration with Prisma for auth
- AWS SDK S3 - Cloud file storage and management
- EPUB.js - EPUB format reader
- React-PDF - PDF document viewer
- Tailwind CSS 4 - Utility-first CSS framework
- Radix UI - Accessible, unstyled UI primitives
- Lucide React - Icon library
- shadcn/ui - Pre-built component library
- next-themes - Theme management (dark/light mode)
- React Hook Form 7 - Performant form library
- Zod 4 - Schema validation
- @hookform/resolvers - Form resolver for Zod
- TanStack React Table 8 - Headless UI for tables
- Recharts 3 - Chart library for analytics
- DnD Kit - Drag and drop library
- React Dropzone - File upload handling
- Sonner - Toast notifications
- Vaul - Drawer component
- use-debounce - Debounce hook
- date-fns 4 - Date manipulation
- clsx - Conditional className utility
- uuid - UUID generation
- class-variance-authority - Variant management for styles
- Node.js 18+ and npm/yarn/pnpm installed
- PostgreSQL database (local or cloud)
- AWS S3 credentials (for file storage)
- Clone the repository
git clone https://github.com/RHEM-01/e-library.git
cd e-library- Install dependencies
npm install- Set up environment variables
Create a .env.local file in the root directory with:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/elibrary"
# AWS S3
NEXT_PUBLIC_AWS_REGION="your-region"
AWS_ACCESS_KEY_ID="your-access-key"
AWS_SECRET_ACCESS_KEY="your-secret-key"
AWS_S3_BUCKET_NAME="your-bucket-name"
# Auth
BETTER_AUTH_SECRET="your-secret-key"
BETTER_AUTH_URL="http://localhost:3000"- Set up the database
npm run buildThis command will:
- Generate Prisma client
- Run database migrations
- Build the Next.js application
- Run the development server
npm run devOpen http://localhost:3000 to view the application.
app/
├── (admin)/ # Admin dashboard routes
├── (users)/ # User-facing routes
├── api/ # API routes
├── auth/ # Authentication pages
└── layout.tsx # Root layout
components/
├── reader/ # EPUB and PDF reader components
├── ui/ # Shadcn UI components
└── web/ # Custom application components
lib/
├── actions/ # Server actions for data mutations
├── schemas/ # Zod validation schemas
├── utils/ # Utility functions
└── prisma.ts # Prisma client configuration
prisma/
├── schema.prisma # Database schema
└── migrations/ # Database migration files
npm run dev- Start development server on port 3000npm run build- Generate Prisma client, run migrations, and build for productionnpm start- Start production servernpm run lint- Run ESLint to check code qualitynpm run test- Run tests with Vitest (if configured)
- Secure Authentication - User registration and login with Better Auth
- Digital Reading - Support for EPUB and PDF formats with built-in readers
- Responsive Design - Mobile-friendly interface with TailwindCSS
- Admin Dashboard - Manage books, users, loans, and view statistics
- Cloud Storage - AWS S3 integration for file management
- Dark Mode - Theme switching with next-themes
- Real-time Notifications - Toast notifications with Sonner
- Data Tables - Advanced tables with sorting and filtering
- Form Validation - Type-safe form handling with Zod and React Hook Form
The application can be deployed to any Node.js hosting platform. Recommended options:
- Vercel - Optimized for Next.js
- Railway - Full-stack deployment
- Render - Modern cloud platform
- AWS - Scalable infrastructure
Ensure you set all environment variables on your hosting platform before deploying.
This project is private and for educational use.