Microservice for user management with event-driven communication via Apache Kafka.
User Service is a RESTful microservice for user management that provides the following capabilities:
- ✅ User creation
- ✅ Get user by ID
- ✅ Get list of all users
- ✅ Update user information
- ✅ Delete user
- ✅ Asynchronous event publishing to Kafka for all operations
The service uses PostgreSQL for data storage and Apache Kafka for event-driven communication. All user operations automatically publish events to Kafka, which can be processed by other services.
The project is built on a modular architecture with layer separation:
user-service/
├── user-service-db/ # Database migration module (Liquibase)
├── user-service-domain/ # Domain layer (entities, repositories)
└── user-service-impl/ # Implementation layer (controllers, services, Kafka)
- Controller Layer — REST API controllers
- Service Layer — business logic and operation processing
- Repository Layer — data access via JPA
- Kafka Layer — event publishing and consumption via Kafka
- Java 21 — programming language
- Spring Boot 3.2.5 — framework for microservice development
- Spring Data JPA — database operations
- PostgreSQL 15 — relational database
- Apache Kafka 7.5.0 — message broker for event-driven communication
- Liquibase — database migration management
- Docker & Docker Compose — containerization
- Lombok — reducing boilerplate code
- MapStruct — mapping between DTOs and entities
- SpringDoc OpenAPI — API documentation (Swagger)
- Spring HATEOAS — HATEOAS support in REST API
This project is created for educational purposes.
Iakov Lysenko