A microservices banking application built for chaos engineering and resilience testing.
Relibank simulates a banking system with separate services for accounts, transactions, bill payments, notifications, and scheduling. It's designed to help you learn about microservices resilience patterns and chaos engineering using Kubernetes and Chaos Mesh.
- frontend-service - React-based banking UI (React Router v7 + Material-UI)
- Responsive design with mobile-first breakpoints
- Bill payments, fund transfers, recurring payments
- New Relic Browser monitoring integration
- accounts-service - Manages user accounts (FastAPI + PostgreSQL)
- transaction-service - Processes and retrieves payment transactions (FastAPI + MSSQL)
- GET endpoint for recurring payment schedules
- Kafka consumer for payment events
- bill-pay-service - Handles bill payments (FastAPI)
- chatbot-service - Relibank's AI chatbot (FastAPI)
- notifications-service - Sends notifications via Kafka
- scheduler-service - Schedules events via Kafka
- Infrastructure:
- Kafka & Zookeeper - Message streaming
- PostgreSQL - Accounts database
- MSSQL - Transactions database
- otel-collector-kafka - OpenTelemetry collector for Kafka monitoring
- JMX metrics (Kafka broker + JVM telemetry)
- Kafka protocol metrics
- Internal collector telemetry
- Exports to New Relic via OTLP
You'll need Docker Desktop with Kubernetes enabled (or Minikube), Skaffold, kubectl, and Helm installed.
Note - all secrets and configs are managed under k8s/base/configs/*
# Deploy to local Kubernetes
skaffold devThis will:
- Build all the Docker images
- Deploy the microservices to Kubernetes
- Install Chaos Mesh for chaos engineering
- Set up port forwarding so you can access the services
Once deployed, you can access:
- Frontend UI: http://localhost:3000 (Main banking interface)
- Accounts: http://localhost:5002
- Auth Service: http://localhost:5006
- Transactions: http://localhost:5001
- Bill Pay: http://localhost:5000
- Chatbot: http://localhost:5003
- Scheduler: http://localhost:5004
- Scenario Runner: http://localhost:8000
- Chaos Mesh Dashboard: http://localhost:2333
The project uses Kustomize overlays for different environments:
Local Development:
- Uses Minikube's built-in "standard" storage class
- Deploys with
skaffold dev
Azure Staging:
- Uses "azure-disk" storage class for AKS
- Deploys with
skaffold dev -p staging
Chaos Mesh gets installed automatically and includes pre-built experiments in chaos_mesh/experiments/.
Access the dashboard at http://localhost:2333, or on the scenario page at http://localhost:8000 to:
- Kill random pods
- Inject network latency
- Stress CPU/memory
- Simulate database failures
Or deploy experiments manually:
kubectl apply -f chaos_mesh/experiments/relibank-pod-chaos-examples.yamlView logs:
kubectl logs -f deployment/accounts-service -n relibankConnect to databases:
# PostgreSQL
kubectl exec -it deployment/accounts-db -n relibank -- psql -U postgres -d accountsdb
# MSSQL
kubectl exec -it statefulset/mssql -n relibank -- /opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -CCheck what's running:
kubectl get pods -n relibankThe services expose REST APIs. Some examples:
Create an account:
curl -X POST http://localhost:5002/accounts \
-H "Content-Type: application/json" \
-d '{"name": "John Doe", "email": "john@example.com"}'Make a transaction:
curl -X POST http://localhost:5001/transactions \
-H "Content-Type: application/json" \
-d '{"from_account": 1, "to_account": 2, "amount": 100.00}'Services won't start? Check that your environment variables are set correctly and you've sourced the skaffold.env file.
Database connection issues? Make sure the database pods are running and healthy. The init jobs need to complete successfully.
Storage issues? If you're on Minikube, make sure it has the "standard" storage class. On AKS, make sure you have the "azure-disk" storage class.
This isn't meant to be a real banking application. It's a learning tool for:
- Microservices architecture patterns
- Kubernetes deployment strategies
- Chaos engineering practices
- Service mesh concepts
- Observability and monitoring with New Relic
- Responsive web application design
- Browser User Tracking: Automatic user ID assignment for New Relic Browser sessions
- Random user selection from database or header-based override via
x-browser-user-id - Persistent across page navigation using sessionStorage
- New endpoint:
/accounts-service/browser-user
- Random user selection from database or header-based override via
- APM User Tracking: Comprehensive user ID tracking across all backend services
- Automatic extraction of
x-browser-user-idheader in all services - Header propagation through inter-service HTTP calls
- Unified user tracking from browser → frontend → backend services
- Automatic extraction of
- Testing: Full test coverage for browser and APM user tracking scenarios
- Responsive Design: Mobile-first breakpoints (xs/sm/md/lg/xl) across all pages
- Simplified Bill Pay: Unified payment method dropdown for easier UX
- Default Transfer Amount: Pre-filled $5.00 for faster demos
- Updated Branding: Larger logo (64x64px) in sidebar with primary green color
- Favicon: Added ReliBank logo as browser favicon
- Payment Methods Scrolling: Fixed height with vertical scrolling on desktop
- Recurring Payments Endpoint: GET
/transaction-service/recurring-paymentsto fetch recurring payment schedules from database - Date Conversion: Automatic MSSQL date-to-string conversion for proper JSON serialization
- Active Schedule Filtering: Frontend filters cancelled vs active recurring payments
- Kafka OpenTelemetry Collector: Comprehensive monitoring of Kafka infrastructure
- JMX Metrics: Kafka broker metrics via JMX (topics, partitions, replication, leader elections)
- JVM Telemetry: Full JVM observability (GC, memory, threads, CPU, file descriptors)
- Kafka Protocol Metrics: Native Kafka metrics (broker count, consumer lag, partition health)
- Internal Telemetry: Collector self-monitoring with detailed metrics
- Export to New Relic: All metrics sent to New Relic via OTLP
- See
otel_collector_kafka/README.mdfor details
Try breaking things with Chaos Mesh and see how the system responds!
-
Connect to the service's container, docker example
docker exec -it bill-pay /bin/sh -
newrelic-admin validate-config LOCATION_OF_NEWRELIC.INI
-
If needed, add a logfile to newrelic.ini
log_file = /app/newrelic.log
log_level = info
- Validate logs with
docker exec -it bill-pay cat newrelic-agent.log