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