Skip to content

RHEM-01/e-library

Repository files navigation

E-Library Management System

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.

📋 Project Overview

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

🛠️ Tech Stack

Core Framework

Database & ORM

Authentication

File Storage & Processing

UI & Styling

Forms & Validation

Data Management & Tables

Interaction & UX

Utilities

Development Tools

🚀 Getting Started

Prerequisites

  • Node.js 18+ and npm/yarn/pnpm installed
  • PostgreSQL database (local or cloud)
  • AWS S3 credentials (for file storage)

Installation

  1. Clone the repository
git clone https://github.com/RHEM-01/e-library.git
cd e-library
  1. Install dependencies
npm install
  1. 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"
  1. Set up the database
npm run build

This command will:

  • Generate Prisma client
  • Run database migrations
  • Build the Next.js application
  1. Run the development server
npm run dev

Open http://localhost:3000 to view the application.

📁 Project Structure

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

📦 Available Scripts

  • npm run dev - Start development server on port 3000
  • npm run build - Generate Prisma client, run migrations, and build for production
  • npm start - Start production server
  • npm run lint - Run ESLint to check code quality
  • npm run test - Run tests with Vitest (if configured)

🔑 Key Features

  • 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

📚 Learn More

🚢 Deployment

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.

📄 License

This project is private and for educational use.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors