Skip to content

Kaif-Zaki/RAD-Final-Coursework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“š Book Club Library Management System

React TypeScript Node.js MongoDB Tailwind CSS

🌟 A Modern Full-Stack Library Management Solution for Book Club Library, Colombo, Sri Lanka

Efficiently manage books, readers, and lending processes with a robust digital platform


🎯 Overview

Book Club Library is a comprehensive web application designed specifically for the newly established Book Club Library in Colombo, Sri Lanka. This full-stack solution streamlines library operations by providing digital tools for managing books, readers, and lending processes with modern web technologies.

✨ Key Features

πŸ“– Core Management Systems

  • Reader Management: Complete CRUD operations for library members
  • Book Catalog: Comprehensive book inventory management
  • Lending System: Track book loans and returns with due date calculations
  • Overdue Management: Monitor and manage overdue books with notifications

πŸ” Security & Authentication

  • JWT-based authentication and authorization
  • Secure password management with bcrypt
  • Role-based access control for library staff

πŸ“§ Notification System

  • Email notifications for overdue books using Nodemailer
  • Automated reminder system for library members

πŸ“Š Additional Features

  • Audit Logging: Track all system activities for accountability
  • Search & Filter: Advanced search capabilities for books and readers
  • Responsive Design: Mobile-friendly interface built with Tailwind CSS
  • Dashboard Analytics: Overview of library statistics and activities

πŸ› οΈ Technology Stack

Layer Technology
Frontend React 18, TypeScript, Tailwind CSS
Backend Node.js, Express.js, TypeScript
Database MongoDB with Mongoose ODM
Authentication JWT (JSON Web Tokens)
Email Service Nodemailer
Development Nodemon, Vite
Security bcrypt for password hashing

πŸ“ Project Structure

Book-Club-Library/
β”œβ”€β”€ client/                    # Frontend (React + TypeScript)
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ assets/           # Static assets
β”‚   β”‚   β”œβ”€β”€ components/       # Reusable React components
β”‚   β”‚   β”œβ”€β”€ context/          # React context providers
β”‚   β”‚   β”œβ”€β”€ pages/            # Page components
β”‚   β”‚   β”œβ”€β”€ services/         # API service functions
β”‚   β”‚   β”œβ”€β”€ types/            # TypeScript type definitions
β”‚   β”‚   β”œβ”€β”€ App.tsx           # Main App component
β”‚   β”‚   β”œβ”€β”€ App.css           # Global styles
β”‚   β”‚   β”œβ”€β”€ index.css         # Tailwind CSS imports
β”‚   β”‚   β”œβ”€β”€ main.tsx          # React entry point
β”‚   β”‚   └── router.tsx        # Application routing
β”‚   β”œβ”€β”€ .gitignore
β”‚   β”œβ”€β”€ eslint.config.js
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ package-lock.json
β”‚   β”œβ”€β”€ README.md
β”‚   β”œβ”€β”€ tsconfig.app.json
β”‚   β”œβ”€β”€ tsconfig.json
β”‚   β”œβ”€β”€ tsconfig.node.json
β”‚   └── vite.config.ts        # Vite configuration
β”‚
β”œβ”€β”€ server/                   # Backend (Node.js + TypeScript)
β”‚   β”œβ”€β”€ node_modules/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ controllers/      # Route controllers
β”‚   β”‚   β”œβ”€β”€ db/              # Database configuration
β”‚   β”‚   β”œβ”€β”€ errors/          # Error handling
β”‚   β”‚   β”œβ”€β”€ middlewares/     # Express middlewares
β”‚   β”‚   β”œβ”€β”€ models/          # MongoDB models
β”‚   β”‚   β”œβ”€β”€ routes/          # API routes
β”‚   β”‚   β”œβ”€β”€ utils/           # Utility functions
β”‚   β”‚   └── index.ts         # Server entry point
β”‚   β”œβ”€β”€ .env                 # Environment variables
β”‚   β”œβ”€β”€ nodemon.json         # Nodemon configuration
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ package-lock.json
β”‚   └── tsconfig.json
β”‚
└── postman/                 # API Documentation
    └── Book-Club-API.json   # Postman collection

πŸš€ Quick Start

Prerequisites

  • Node.js (v16 or higher)
  • MongoDB (local or MongoDB Atlas)
  • npm or yarn package manager

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/book-club-library.git
    cd book-club-library
  2. Backend Setup

    cd server
    npm install
  3. Environment Configuration Create a .env file in the server directory:

    # Database
    MONGODB_URI=mongodb://localhost:27017/book-club-library
    
    # JWT
    JWT_SECRET=your-super-secret-jwt-key
    JWT_EXPIRES_IN=7d
    
    # Email Configuration (Nodemailer)
    EMAIL_HOST=smtp.gmail.com
    EMAIL_PORT=587
    EMAIL_USER=your-email@gmail.com
    EMAIL_PASS=your-app-password
    
    # Server Configuration
    PORT=3000
    NODE_ENV=development
  4. Frontend Setup

    cd ../client
    npm install
  5. Start Development Servers

    Backend (Port 3000):

    cd server
    npm run dev

    Frontend (Port 5173):

    cd client
    npm run dev

πŸ“‘ API Documentation

πŸ”— Postman Collection

Import the Postman collection for complete API documentation:

πŸ›£οΈ Main API Endpoints

Method Endpoint Description
Authentication
POST /auth/login User login
POST /auth/register User registration
POST /auth/forgot-password Request password reset
Readers
GET /readers Get all readers
POST /readers Add new reader
PUT /readers/:id Update reader
DELETE /readers/:id Delete reader
Books
GET /books Get all books
POST /books Add new book
PUT /books/:id Update book
DELETE /books/:id Delete book
Lending
GET /lending Get lending records
POST /lending Create lending record
PUT /lending/:id/return Mark book as returned
GET /lending/overdue Get overdue books
POST /notifications/overdue Send overdue notifications

🎨 Features Overview

πŸ‘₯ Reader Management

  • View complete list of registered library members
  • Add new readers with detailed information
  • Edit existing reader profiles
  • Remove readers from the system
  • Search and filter functionality

πŸ“š Book Management

  • Comprehensive book catalog display
  • Add new books to the library collection
  • Edit book information and details
  • Remove books from inventory
  • Category-based organization

πŸ”„ Lending Management

  • Issue books to registered readers
  • Track all lending transactions
  • View complete lending history
  • Process book returns
  • Calculate and display due dates automatically

⏰ Overdue Management

  • Identify readers with overdue books
  • Display detailed overdue information
  • Send automated email notifications
  • Track overdue duration and penalties

πŸ”’ Security Features

  • JWT-based authentication system
  • Secure password hashing with bcrypt
  • Role-based access control
  • Session management and token refresh

🎯 Core Functionalities

Authentication Flow

  1. Staff login with secure credentials
  2. JWT token generation and validation
  3. Protected routes and middleware
  4. Session management

Book Lending Process

  1. Select reader and available book
  2. Automatic due date calculation
  3. Create lending record
  4. Track lending status
  5. Process returns and update records

Notification System

  1. Identify overdue books automatically
  2. Generate email notifications
  3. Send reminders to readers
  4. Track notification history

πŸ”§ Development

Available Scripts

Backend:

npm run dev        # Start development server with nodemon
npm run build      # Build TypeScript to JavaScript
npm start          # Start production server

Frontend:

npm run dev        # Start Vite development server
npm run build      # Build for production
npm run preview    # Preview production build
npm run lint       # Run ESLint

Code Style

  • TypeScript for type safety
  • ESLint for code linting
  • Consistent naming conventions
  • Modular architecture

🌐 Deployment

Environment Variables

Ensure all environment variables are properly configured:

  • Database connection strings
  • JWT secrets
  • Email service credentials
  • API endpoints

Production Build

# Backend
cd server
npm run build
npm start

# Frontend
cd client
npm run build
# Serve the dist folder with your preferred web server

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘¨β€πŸ’» Author

Your Name

πŸ™ Acknowledgments

  • Book Club Library, Colombo, Sri Lanka for the project requirements
  • Open source community for the amazing tools and libraries
  • Contributors and testers who helped improve this application

Made with ❀️ for Book Club Library Management

Β© 2025 Book Club Library System. All rights reserved.

About

Book club Library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages