Project overview
Identity Service API is a compact Java 21 and Spring Boot 4 backend for user identity management. It demonstrates API versioning, password hashing, soft deletion, database migrations, consistent HTTP errors, real PostgreSQL integration tests, containerized startup, and automated documentation publication.
The project is intentionally scoped as one service. It does not introduce authentication tokens, distributed messaging, Kubernetes, or a browser application because those concerns are outside the current OpenAPI contract.
Runtime
Java 21, Spring Boot 4, Spring MVC, Spring Data JPA, and PostgreSQL 16.
Contract and mapping
OpenAPI Generator produces HTTP models and interfaces; MapStruct maps them to the domain.
Database lifecycle
Flyway migrations create and evolve the schema before Hibernate validates it.
Quality and delivery
JUnit, MockMvc, Testcontainers, JaCoCo, Docker Compose, and GitHub Actions form the validation path.
Architecture summary
- OpenAPI contract:
identity-api.yamldefines the public API. - Generated API layer: Maven generates Spring MVC interfaces and API models.
- Controllers: thin adapters implement the generated interfaces.
- Services: application logic owns validation, hashing, updates, and soft deletes.
- Domain and mapping: internal entities remain separate from generated API models.
- Repositories: Spring Data JPA persists the domain model in PostgreSQL.
API-first rule: change the YAML contract before changing public HTTP behavior, then regenerate through Maven and update implementation and tests.
Guide map
Getting started
Prerequisites, cloning, local database startup, application launch, and first checks.
Docker usage
Compose runtime, health checks, environment variables, shutdown, and cleanup.
API documentation
Source contract, generated docs, local Swagger UI, versioning, Postman, and generated code.
Testing
Unit, web-layer, repository, and Testcontainers integration verification.
Coverage
JaCoCo generation, local and published reports, exclusions, and interpretation.
CI/CD and generated docs
Pull-request gates, Docker checks, Maven site generation, and Pages deployment.