← projects
$ Spring Boot Microservices Boilerplate
Microservice-based version of the same boilerplate — gateway, user-service, notification-service, and a Go file-service, wired together with Kafka and RabbitMQ. Private repository.
- →Rewrote the same boilerplate (JWT, TOTP 2FA, file handling, root-admin governance) as a microservices architecture instead of a monolith gateway-service, user-service, and notification-service as separate Spring Boot services, plus a Go based file-service. Each Java service is itself a multi-module Maven reactor split into the same strict hexagonal layers (domain-core, application-service, dataaccess, container).
- →Used a transactional outbox pattern for intra-service consistency each write records an outbox entry in the same transaction, and a separate processor publishes it to either Kafka or RabbitMQ. The transport is chosen deliberately by event shape: user lifecycle events (registered/updated/deleted), which multiple consumers may care about, go over Kafka, while time-sensitive notifications with a single target — password resets, verification codes — go over RabbitMQ.
- →Carried the root-admin transfer feature (singleton root, numeric role hierarchy, dual TOTP-confirmed transfer workflow) across the service boundary transfer notifications leave user-service's outbox over RabbitMQ and land in notification-service, where they're processed through the existing custom-email pipeline as both an in-app notification and a real email.
- →Wrote two adapters behind a single output port (IAuthenticationFacade) for cross-service authentication: a Spring Security backed adapter for user-service, which has direct database access, and a header based adapter for notification-service, which doesn't reading the X-User-Id/X-User-Roles headers forwarded by the gateway one port, two implementations depending on what the service can actually see.
- →Wrote a separate file-service in Go for file and image handling, with content-hash based deduplication, per-user storage quota enforcement, a thumbnail generation pipeline, and a swappable storage provider abstraction (local disk or Cloudflare R2).
- →Carried the monolith's security and quality practices over to the microservices side one-for-one: JWT key versioning, two-phase TOTP login (with the temp token traveling over an httpOnly cookie, never exposed in a response body), and the same JaCoCo/Checkstyle quality gates.
JavaGoSpring BootMicroservicesHexagonal ArchitectureEvent-Driven ArchitectureKafkaRabbitMQGatewayJWTTOTP