How pqkkkkk/tsbank works
Project type and purpose
• This is a layered, full‑stack “online banking” system implemented in Java/Maven, following Clean Architecture (aka Hexagonal/Ports‑and‑Adapters).
• Core features: account creation, deposit/withdrawal, transfers, transaction history, event publishing (Kafka), persistence (in‑memory/SQL Server), and a REST API.
File structure
• Top‑level modules (Maven multimodule):
• entity: domain entities (BankAccount, Customer, Transaction, TransactionType)
• usecase: business‑logic services (BankAccountService, TransactionService) + use‑case interfaces (IBankAccountService, ITransactionService) + DAO ports (IBankAccountDao, ICustomerDao, ITransactionDao)
• infrastructure‑dao‑inmemory & infrastructure‑dao‑sqlserver: outbound adapters implementing DAO interfaces, one in‑memory, one JDBC/SQLServer (with DataSourceConfig, row‑mappers, SQL scripts)
• infrastructure‑kafka: outbound adapter for event publishing/handling via Kafka (IEventPublisher, IEventHandler, KafkaConfig, event types)
• infrastructure‑restapi: inbound adapter (Spring Boot REST controllers, DTOs, application.properties, tests)
• A root pom.xml aggregates these modules.
README
• Confirms: “Core functions of online banking system. Build according Clean architecture.”
Detailed checklist
• Center: Domain Entities (BankAccount, Customer, Transaction)
• Next ring: Use‑Case Services (BankAccountService, TransactionService), DAO Ports (IBankAccountDao, ITransactionDao, ICustomerDao), Event Port (IEventPublisher)
• Outer ring:
• infrastructure‑dao‑inmemory: implements DAO Ports → in‑memory store
• infrastructure‑dao‑sqlserver: implements DAO Ports → SQLServer DB
• infrastructure‑kafka: implements IEventPublisher & IEventHandler → Kafka Broker
• infrastructure‑restapi: Controllers (AccountController), DTOs → calls Use‑Case
• External: SQL Server instance, Kafka cluster, REST clients (Postman, Web UI)
• REST Client → REST API controller
• Controller → Use‑Case interface
• Use‑Case → DAO port
• DAO adapter → Database or in‑memory store
• Use‑Case / Controller → Kafka publisher → Kafka broker
• Kafka broker → Kafka event handler adapter → Use‑Case (if applicable)