How jbwittner/bankwiz_server works
Main Components
• Clients/External Consumers: Although not explicitly shown in the tree, consider your API consumers (mobile apps, web clients, or external systems) that make REST calls.
• API REST Layer (Infrastructure – API REST): This module handles HTTP request processing. It contains controllers (for bank accounts, currencies, users, etc.), DTOs, exception handling, and configuration (e.g., security and OpenAPI).
• Application Layer (Application Module): Contains the entry point (Application.java), configuration, and cross-cutting concerns like AOP (logging and transaction management). This layer orchestrates business operations.
• Domain Layer (Domain Module): Implements business logic. It holds core domain models, domain APIs, exceptions, and service definitions (interfaces, services) that enforce business rules.
• Persistence/Database Layer (Infrastructure – SPI JPA): Implements SPI interfaces using JPA to interact with the database. It houses entity mappings, repositories, and is responsible for persistence.
Interactions and Flows
• Requests start from external clients hitting the REST endpoints provided by the API REST module.
• Controllers receive the requests, perform necessary validations/conversions (using DTOs), and pass them to the Application Layer.
• The Application Layer then orchestrates the use case and delegates business logic to the Domain Layer.
• The Domain Layer, in turn, invokes SPI interfaces for persistence or external service calls. The SPI implementations are provided in the SPI JPA module, which communicates with the database.
• Responses flow back through the layers completing the cycle.
Architectural Patterns and Principles
• The project clearly follows a layered architecture (also apparent via the multi-module structure).
• Domain-Driven Design is evident, as the Domain module encapsulates the core business rules and models.