This guide adds local infrastructure for the backend-only solution without requiring any cloud services.
The current business services still use in-memory persistence, but this infrastructure layer is the next step toward:
- local PostgreSQL-backed development
- local RabbitMQ-based messaging
- future Outbox and SAGA implementation
The compose file starts:
PostgreSQLRabbitMQwith management UI
Compose file:
Environment template:
From the repository root:
docker compose --env-file infra/.env.example -f infra/docker-compose.infrastructure.yml up -ddocker compose --env-file infra/.env.example -f infra/docker-compose.infrastructure.yml downTo also remove named volumes:
docker compose --env-file infra/.env.example -f infra/docker-compose.infrastructure.yml down -v- Host:
localhost - Port:
5432 - Database:
basic_banking - Username:
banking - Password:
banking_dev_password
- AMQP:
amqp://banking:banking_dev_password@localhost:5672 - Management UI:
http://localhost:15672
At this stage:
- Services run successfully without infrastructure
- Services are not yet using PostgreSQL
- Services are not yet publishing to RabbitMQ
- Compose is ready for the next iteration
Replace in-memory repositories with PostgreSQL-backed repositories for:
Customer ServiceAccount ServiceDeposit ServiceAudit Service
Introduce RabbitMQ messaging for:
DepositRequestedDepositPostedDepositRejected- audit event ingestion
Add Outbox processing and background workers.
Host=localhost;Port=5432;Database=basic_banking;Username=banking;Password=banking_dev_password
amqp://banking:banking_dev_password@localhost:5672
Check running containers:
docker psCheck PostgreSQL logs:
docker logs basicbanking-postgresCheck RabbitMQ logs:
docker logs basicbanking-rabbitmqOnce this infrastructure is up, the most useful next step is:
- wire
Deposit Serviceto RabbitMQ - introduce PostgreSQL persistence for at least one service
- start implementing Outbox and SAGA incrementally