Skip to content

rdev-stack/online-library-system

Repository files navigation

📚 LibraryOS — Online Library Management System


🎯 Overview

A full-featured Online Library Management System built as part of a technical assignment. Goes beyond the base requirements by adding JWT-secured role-based access, fine calculation, membership plans, physical copy tracking, scheduled jobs, real-time metrics, and a complete dark-themed frontend — all containerised and ready to run with a single command.


🛠 Tech Stack

Layer Technology
Language Java 8
Framework Spring Boot 2.7.18
Database MySQL 8
ORM JPA / Hibernate
Security Spring Security + JWT
Build Maven
Containerisation Docker + Docker Compose
Metrics Micrometer + Prometheus + Grafana

✅ Features

Assignment Requirements — All Implemented

# Requirement Status
1 Get list of all users with details
2 Get list of all books — filter by category / status / name / author
3 Login user (name, email, password, membership months)
4 Add book to library
5 Update book status when user takes or returns
6 Check and update user membership validity
7 Membership validation before issuing a book
8 User profile with books currently held + reading history
9 Category-wise book issue percentage for reporting

Additional Features

  • 🔐 Role-based access — GUEST / USER / ADMIN with JWT
  • 📦 Physical copy tracking — each book has individual BookCopy rows with rack location
  • 💰 Fine calculation — per-day fine based on membership plan
  • 📅 Membership plans — BASIC / STANDARD / PREMIUM with configurable limits
  • ⏰ Scheduled jobs — nightly overdue marking + membership expiry
  • 📊 Dashboard analytics — KPIs, top categories, most issued books, borrower rankings
  • 📈 Prometheus + Grafana — real-time JVM, HTTP, and DB metrics

🏗 Architecture

┌─────────────────────────────────────────────────────────────┐
│                     Docker Compose Network                  │
│                                                             │
│  ┌──────────┐    ┌──────────────────┐    ┌──────────────┐  │
│  │  MySQL   │◄───│  Spring Boot App  │───►│  Prometheus  │  │
│  │ :3306    │    │     :8080         │    │    :9090     │  │
│  └──────────┘    └──────────────────┘    └──────┬───────┘  │
│                                                  ▼          │
│                                          ┌──────────────┐  │
│                                          │   Grafana    │  │
│                                          │    :3000     │  │
│                                          └──────────────┘  │
└─────────────────────────────────────────────────────────────┘

🚀 Getting Started

Prerequisites: Docker Desktop — that's it. No Java or MySQL needed locally.

# 1. Clone
git clone https://github.com/YOUR_USERNAME/online-library-management.git
cd online-library-management

# 2. Build the JAR
./mvnw clean package -DskipTests

# 3. Start everything
docker-compose up --build
Service URL
App http://localhost:8080/index.html
Prometheus http://localhost:9090
Grafana http://localhost:3000
MySQL localhost:3307

🔑 Default Admin Login

Email    :  admin@library.com
Password :  admin123

Auto-created on first startup. Change after first login.


image image image

📈 Monitoring

Prometheus scrapes /actuator/prometheus every 5 seconds.

Grafana setup:

  1. Open http://localhost:3000 — login admin / admin
  2. Add data source → Prometheus → http://prometheus:9090
  3. Import dashboard ID 4701 for a full Spring Boot JVM dashboard

👨‍💻 Author

Devansh Raval

About

Online Library Management System built with Spring Boot, featuring JWT authentication, role-based access, membership management, book inventory, and Dockerized deployment with MySQL, Prometheus, and Grafana monitoring.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors