HUB
Sign inSign up

jerael/booktracker-backend

By jerael

•Updated 7 months ago

Spring Boot REST API for BookTracker. Features Clean Architecture, PostgreSQL, and MinIO storage.

Image
Web servers
0

1.5K

jerael/booktracker-backend repository overview

⚠️ Note: This image requires PostgreSQL, MinIO and Redis to function. The easiest way to run the full stack is using the provided Docker Compose file from the GitHub repository:

https://github.com/Nirtas/booktracker-backend⁠

There is a ready docker-compose.dev.yml file that will set up the infrastructure for use with this image.

⁠BookTracker

Backend for tracking your reading progress, built with Clean Architecture principles. This server manages books, users, detailed reading history and secure cover storage.

⁠Tech Stack

  • Languages: Java 17 (main), Kotlin 2.3 (tests)
  • Framework: Spring Boot 4
  • Security: Spring Security, Argon2id hashing, JWT (Nimbus JOSE + JWT)
  • Database: PostgreSQL
  • Migrations: Liquibase (YAML)
  • Caching: Redis
  • File Storage: MinIO (S3-compatible)
  • Documentation: OpenAPI / Swagger UI
  • Deployment: Docker & Docker Compose
  • SMTP for email delivery
  • Testing: JUnit 5, MockK, Testcontainers

⁠Architecture

The project follows Clean Architecture to ensure maintainability and testability:

  • Web: REST Controllers, DTOs, Security Filters and Web Mappers.
  • Application: Orchestration of business logic through use cases and domain services.
  • Domain: Pure business logic, Entities, Repository interfaces and Validation rules.
  • Data: Infrastructure implementations (JPA Repositories, S3 Storage, Image Processor, Password Hasher, Identity Token Provider, Redis Caching).

⁠Diagrams

ER diagram and workflows (User registration (without verification), Email verification, Book details update (without cover) and Genre fetching) are available in GitHub repository.

⁠Setup & Development

⁠Prerequisites
  • Docker & Docker Compose
  • Java 17+ (for local development)
⁠Configuration
  1. Copy the example environment file:
    cp .env.example .env
    
  2. Fill in your credentials and properties in the .env file (DB, MinIO, Argon2, SMTP, JWT).
⁠Launch Options
⁠1. Development (Infrastructure only)

Start infrastructure to run the application from your IDE:

docker compose -f docker-compose.dev.yml up --build -d
⁠2. Production (Full Stack from source)

Build and start all services (app + infrastructure) in containers:

docker compose -f docker-compose.prod.yml up --build -d

⁠API Documentation

Once the server is running and Swagger enabled in .env file (ENABLE_SWAGGER_UI=true), explore the API and test endpoints via Swagger UI: http://localhost:8080/swagger-ui/index.html⁠

⁠Quick API Reference

All endpoints are prefixed with /api/v1.

MethodEndpointAuth RequiredDescription
Auth
POST/auth/registerNoRegister new user
POST/auth/confirm-registrationNoConfirm registration
POST/auth/loginNoLogin
POST/auth/refreshNoRefresh tokens
POST/auth/logoutNoLogout
POST/auth/resend-codeNoResend verification code
Users
GET/users/meYesGet current user details
Books
GET/booksYesGet user's books
POST/booksYesCreate book
GET/books/{id}YesGet book by id
DELETE/books/{id}YesDelete book by id
PATCH/books/{id}YesUpdate book details
POST/books/{id}/coverYesUpload book cover
DELETE/books/{id}/coverYesDelete book cover
GET/books/{id}/coverYesGet book cover
Genres
GET/genresYesGet all genres
GET/genres/{id}YesGet genre by id
Languages
GET/languagesYesGet all languages
GET/languages/{code}YesGet language by code

Tag summary

Content type

Image

Digest

sha256:9277127e9…

Size

237 MB

Last updated

7 months ago

docker pull jerael/booktracker-backend