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.
| 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 |
| # | 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 | ✅ |
- 🔐 Role-based access — GUEST / USER / ADMIN with JWT
- 📦 Physical copy tracking — each book has individual
BookCopyrows 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
┌─────────────────────────────────────────────────────────────┐
│ Docker Compose Network │
│ │
│ ┌──────────┐ ┌──────────────────┐ ┌──────────────┐ │
│ │ MySQL │◄───│ Spring Boot App │───►│ Prometheus │ │
│ │ :3306 │ │ :8080 │ │ :9090 │ │
│ └──────────┘ └──────────────────┘ └──────┬───────┘ │
│ ▼ │
│ ┌──────────────┐ │
│ │ Grafana │ │
│ │ :3000 │ │
│ └──────────────┘ │
└─────────────────────────────────────────────────────────────┘
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 |
Email : admin@library.com
Password : admin123
Auto-created on first startup. Change after first login.
Prometheus scrapes /actuator/prometheus every 5 seconds.
Grafana setup:
- Open
http://localhost:3000— loginadmin / admin - Add data source → Prometheus →
http://prometheus:9090 - Import dashboard ID
4701for a full Spring Boot JVM dashboard
Devansh Raval