A production-grade Spring Boot backend for a Book Social Network platform featuring JWT authentication, email verification, book borrowing workflows, feedback system, Dockerized deployment, and a fully automated CI/CD pipeline using GitHub Actions.
β οΈ Important: This project is designed to run via CI/CD pipelines and Docker, not via simplemvn spring-boot:run.
This project was built to demonstrate how real-world backend systems are designed and deployed in production environments, including:
- Secure Authentication: Implementation of stateless security using JWT.
- Email-based Activation: Realistic user onboarding with token-based verification.
- Clean Architecture: Separation of concerns using a layered, maintainable structure.
- Containerization: Fully Dockerized environment for consistency across stages.
- CI/CD Driven: Automated delivery pipeline using GitHub Actions to reflect enterprise-grade practices.
It intentionally avoids hardcoded secrets and local shortcuts to reflect enterprise-grade practices.
Backend
- Java 17
- Spring Boot 3
- Spring Security (JWT)
- Spring Data JPA
- Hibernate
- Validation (Jakarta)
- Thymeleaf (Email Templates)
Database
- PostgreSQL (Production)
- H2 (Testing)
DevOps & Infrastructure
- Docker & Docker Compose
- GitHub Actions (CI/CD)
- Self-hosted GitHub Runner
- MailDev (Local Email Testing)
Tools
- Swagger / OpenAPI
- Maven
- Postman
- π JWT-based Authentication & Authorization
- π§ Email Account Activation (Token-based)
- π Book Management (CRUD, Shareable, Archive)
- π Book Borrow & Return Workflow
- β Feedback & Rating System
- π Pagination & Filtering
- π§Ύ Global Exception Handling
- π³ Fully Dockerized Setup
- βοΈ Automated CI/CD Pipeline
This project follows Clean Architecture + Layered Architecture principles.
Controller β Service β Repository β Database
β
Mapper / DTO
com.prashanth.book
βββ auth # Authentication & JWT logic
βββ book # Book domain (entity, service, repo)
βββ feedback # Feedback & ratings
βββ history # Book transaction history
βββ user # User & roles
βββ security # JWT filter & security config
βββ email # Email service & templates
βββ file # File storage utilities
βββ common # BaseEntity, PageResponse
βββ handler # Global exception handling
βββ config # Beans, OpenAPI, auditing
graph TD
subgraph Client_Layer [Client Layer]
A[Postman / Frontend]
end
subgraph Spring_Boot_App [Spring Boot Application]
B[Security Filter / JWT]
C[Auth Module]
D[Book Module]
E[Feedback Module]
F[Email Module]
end
subgraph Data_Layer [Data Layer]
G[(PostgreSQL)]
end
A --> B
B --> C
B --> D
B --> E
C --> F
C & D & E --> G
Why Monolith?
- Faster development
- Easier debugging
- Ideal for early-stage systems
- Clean separation allows future migration
graph TD
GW[API Gateway] --> Auth[Auth Service]
GW --> Book[Book Service]
GW --> Feed[Feedback Service]
GW --> Noti[Notification Service]
Auth --> DB1[(PostgreSQL)]
Book --> DB2[(PostgreSQL)]
Feed --> DB3[(PostgreSQL)]
Noti --> DB4[(PostgreSQL)]
The current design intentionally supports easy migration to microservices.
erDiagram
USER ||--o{ BOOK : owns
USER ||--o{ BOOK_TRANSACTION_HISTORY : borrows
BOOK ||--o{ FEEDBACK : receives
BOOK ||--o{ BOOK_TRANSACTION_HISTORY : tracked_in
USER ||--o{ FEEDBACK : writes
USER {
string email
string password
boolean accountLocked
boolean enabled
}
BOOK {
string title
string authorName
boolean archieved
boolean shareable
}
FEEDBACK {
double note
string comment
}
Key Relationships
- User β Book (Owner)
- User β BookTransactionHistory (Borrower)
- Book β Feedback (Ratings & Reviews)
Once deployed, Swagger UI is available at:
http://<HOST>:8088/swagger-ui/index.html
- Compile
- Unit Tests
- Build JAR
- Build & Push Docker Image
- Deploy via Docker Compose (Self-hosted Runner)
β This project cannot run fully locally out-of-the-box because environment variables are injected via GitHub Secrets and Docker images are pulled dynamically. This is intentional to reflect production best practices.
Status: β Stable & Functional
Prashanth P Java Backend Developer
π§ Email: prashanthpremchand@gmail.com