Skip to content
Back to all projects

Microservices

Aethera Bank v2 (Banking-App)

A banking simulation for practising real microservice boundaries, still under construction. The shared libraries, an identity service that writes events for Kafka and the Docker infrastructure are in place; money transfers and the saga are next on the roadmap.

Problem

The hardest part of imitating a bank's backend is where the services stand in relation to each other. Each service has to be the only owner of its data and must not touch another service's tables, yet when a record is created the other services still have to learn about it reliably. I started this project to write that boundary end to end on a small example. The order is deliberate: shared contracts first (error model, correlation id, event envelope), then a single service, and money movement only after those have settled.

Highlights

  • The identity service has four layers (presentation, application, domain, infrastructure), and its database schema is versioned with Liquibase in five changelog files.
  • Passwords are stored with BCrypt at cost 12. Five failed logins in a row lock the account for 15 minutes.
  • Refresh tokens are kept in the database only as hashes. Each refresh revokes the old token and issues a new one, and if a revoked token shows up again the whole token family is revoked.
  • Saving a user and its UserRegistered event happen in one transaction, into the outbox_events table. A scheduled publisher sends the first 50 pending events to Kafka and marks them PUBLISHED or FAILED.
  • Four shared modules provide the error code model, the correlation id filter, the event envelope and the logging MDC keys; the repository has 93 test methods in total.
  • Docker Compose brings up Oracle, Kafka with its UI, Elasticsearch, Kibana, SonarQube and Jenkins locally, so none of them has to be installed on Windows.

Architecture and notes

The repository is a monorepo, but the services are designed as real microservices. Each service owns its own Oracle schema and does not read another service's tables; services talk through APIs or Kafka events. The shared code is kept small on purpose: only infrastructure contracts such as the error model, the event envelope and tracing helpers live there, and business logic stays inside the service.

I chose an outbox over sending the event straight to Kafka because I did not want the case where the user was saved but the event never left (or the reverse). The event sits in the database first, in the same transaction as the record, and sending it to Kafka is a separate scheduled step.

What does not exist yet: the API gateway folder is empty, and the customer, account and ledger services, the saga and the Elasticsearch side are not written. They are in the roadmap under docs/sprint and recorded as decisions in ADR-0001, but there is no code for them. The publisher also has a gap I know about: events marked FAILED are never retried, so a retry still has to be added.

Private repository

Last updated

Technologies

  • Java 21
  • Spring Boot 4
  • Spring Security
  • Oracle
  • Kafka
  • Liquibase
  • Docker Compose
  • Jenkins
  • SonarQube

The source code is kept private; I can show it on request.

Request flow

Hover or focus a component to see what it is.

A generic request path built from the project's tech list. It illustrates the stack; it is not a measured trace.