How soufianeamm/smartbank-app works
SmartBank is a pedagogical microservices banking demo, with an Angular client, Spring services, and shared Kafka events. The main workflow enters through the gateway and fans into customer, account, transfer, loan, transaction/statement, and notification capabilities; the README documents the broader service contracts, while excerpts provide implementation detail chiefly for customer management, frontend auth/routing, and notification consumption. Infrastructure and several domain services are represented at their exact tree directories where their internals were not sampled.
Main entry points: app.ts Angular app · CustomerService.java Customer management · CustomerController.java Customer endpoints · gateway API gateway
Components 22
Web client
- Angular app
frontend/src/app/app.ts - Role routing
frontend/src/app/app.routes.ts - Auth service
frontend/src/app/core/auth/auth.service.ts - Customer API client
frontend/src/app/core/api/customer-api.service.ts
API and identity
- API gateway
infrastructure/api-gateway/src/main/java/com/smartbank/gateway - Keycloak
Banking services
- Customer endpoints
services/customer-service/src/main/java/com/smartbank/customer/web/CustomerController.java - Customer management
services/customer-service/src/main/java/com/smartbank/customer/service/CustomerService.java - Customer repository
services/customer-service/src/main/java/com/smartbank/customer/domain/CustomerRepository.java - Account service
services/account-service - Transfer service
services/transfer-service - Loan service
services/loan-service - Transaction history
services/transaction-service - Monthly statements
services/transaction-service
Events and notifications
- Event contracts
common/smartbank-common/src/main/java/com/smartbank/common/events/Topics.java - Kafka
- Notification listener
services/notification-service/src/main/java/com/smartbank/notification/listener/BankingEventsListener.java
Platform services
- Eureka discovery
infrastructure/discovery-server/src/main/java/com/smartbank/discovery/DiscoveryServerApplication.java - Config server
infrastructure/config-server/src/main/java/com/smartbank/configserver/ConfigServerApplication.java - PostgreSQL
- Mailpit SMTP
Other components
- Bank user
Connections 23
- Bank user → Angular app: uses
- Angular app → Auth service: reads identity
frontend/src/app/app.ts - Angular app → Role routing: renders routes
frontend/src/app/app.routes.ts - Role routing → Auth service: guards access
frontend/src/app/app.routes.ts - Bank user → Keycloak: authenticates
- Angular app → Keycloak: uses PKCE
- Customer API client → API gateway: calls API
- API gateway → Customer endpoints: routes requests
- Customer endpoints → Customer management: delegates to
services/customer-service/src/main/java/com/smartbank/customer/web/CustomerController.java - Customer management → Customer repository: reads and writes
services/customer-service/src/main/java/com/smartbank/customer/service/CustomerService.java - Customer management → Kafka: publishes created
services/customer-service/src/main/java/com/smartbank/customer/service/CustomerService.java - Customer management → Event contracts: uses topic
services/customer-service/src/main/java/com/smartbank/customer/service/CustomerService.java - Account service → Customer endpoints: looks up customer
services/account-service/src/main/java/com/smartbank/account/client/CustomerLookupService.java - Transfer service → Account service: debits and credits
- Transfer service → Kafka: publishes outcomes
- Loan service → Kafka: publishes decisions
- Transaction history → Kafka: consumes completed
- Transaction history → Monthly statements: generates monthly
- Kafka → Notification listener: delivers events
- Kafka → Transaction history: delivers completed
- Notification listener → Mailpit SMTP: sends email
- API gateway → Eureka discovery: discovers services
- Customer endpoints → PostgreSQL: persists data