# azeezkenny007/corebanking architecture

> Architecture diagram of the GitHub repository azeezkenny007/corebanking, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/azeezkenny007/corebanking
- Repository: https://github.com/azeezkenny007/corebanking

## Overview

##### Project type and purpose
- CoreBanking API is a RESTful, backend-only banking service (account management, transactions, secure operations).
- Built on .NET 8 using layered (onion) architecture with separate Presentation, Application, Domain (Core), and Infrastructure layers.

##### Main components
a. Presentation Layer (CoreBanking.API)
- Controllers (AccountController, TransactionController, WeatherForecastController)
- HTTP server (Kestrel) hosted via Docker/.NET host builder
- Configuration (appsettings.json), Swagger middleware
b. Application Layer (CoreBanking.Application)
- Services / Use-cases: business logic orchestration (e.g. AccountService, TransactionService)
c. Domain Layer (CoreBanking.Core)
- Interfaces (IAccountRepository, ITransactionRepository, etc.)
- Models / Entities (AccountModel, TransactionModel, CustomerModel)
d. Infrastructure Layer (CoreBanking.Infrastructure)
- Repository implementations (AccountRepository, TransactionRepository)
- Data access (Entity Framework, SQL Server)
e. External Systems
- SQL Server (LocalDB / Production DB)
- Docker container registry (if deploying containerized)
f. Cross-cutting
- Logging, Security (JWT, HTTPS), DI Container

##### Relationships and interactions
- HTTP client → API Controllers
- Controllers → Application Services (via DI)
- Services → Domain Interfaces (IAccountRepository)
- Domain Interfaces → Infrastructure Repositories
- Repositories → Database (SQL Server)
- Lifecycle: Request arrives → Controller → Service → Repository → DB → back up the chain

##### Architectural patterns and design principles
- Onion (Hexagonal) architecture: dependencies point inward toward the Core
- Dependency Injection: layers are loosely coupled via interfaces in Core
- Separation of Concerns: Presentation vs Business Logic vs Data Access
- RESTful API design, Stateless services

##### Technologies / Frameworks
- ASP.NET Core (Kestrel, Middleware, Controllers)
- Entity Framework Core
- SQL Server / LocalDB
- Docker (Dockerfile in API project)
- Swagger / OpenAPI
- .NET SDK (launchSettings.json for development)

##### Detail level
- Essential components (Controllers, Services, Repositories, Models).
- Docker boundary around the API to reflect the Dockerfile.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Client
    ExternalClient["External Client\n(Web/Mobile)"]:::external

    %% CoreBanking API Container
    subgraph "CoreBanking API (Docker Container)" 
        direction TB

        %% Presentation Layer
        subgraph "Presentation Layer" 
            direction TB
            AccountController["AccountController"]:::presentation
            WeatherController["WeatherForecastController"]:::presentation
            Program["HTTP Host & DI Setup\n(Program.cs)"]:::presentation
            Config["Configuration\n(appsettings.json\nappsettings.Development.json\nappsettings.Production.json\nlaunchSettings.json)"]:::presentation
        end

        %% Application Layer
        subgraph "Application Layer" 
            direction TB
            AccountService["AccountService"]:::application
            TransactionService["TransactionService"]:::application
        end

        %% Domain Layer
        subgraph "Domain Layer" 
            direction TB
            IAccountRepo["IAccountRepository"]:::domain
            AccountModel["AccountModel"]:::domain
        end

        %% Infrastructure Layer
        subgraph "Infrastructure Layer" 
            direction TB
            AccountRepoImpl["AccountRepository"]:::infrastructure
        end
    end

    %% External Systems
    SQLServer["SQL Server"]:::database
    DockerRegistry["Docker Container Registry"]:::external

    %% Connections
    ExternalClient -->|"HTTP Request"| AccountController
    AccountController -->|"Invoke"| AccountService
    AccountController -->|"Invoke"| TransactionService
    AccountService -->|"Depends on"| IAccountRepo
    TransactionService -->|"Depends on"| IAccountRepo
    IAccountRepo -->|"Implemented by"| AccountRepoImpl
    AccountRepoImpl -->|"Query/Save"| SQLServer
    Program -->|"Reads config"| Config
    DockerRegistry -->|"Pull Image"| ExternalClient

    %% Click Events
    click AccountController "https://github.com/azeezkenny007/corebanking/blob/main/CoreBanking.API/Controllers/AccountController.cs"
    click WeatherController "https://github.com/azeezkenny007/corebanking/blob/main/CoreBanking.API/Controllers/WeatherForecastController.cs"
    click Program "https://github.com/azeezkenny007/corebanking/blob/main/CoreBanking.API/Program.cs"
    click Config "https://github.com/azeezkenny007/corebanking/blob/main/CoreBanking.API/appsettings.json"
    click Config "https://github.com/azeezkenny007/corebanking/blob/main/CoreBanking.API/appsettings.Development.json"
    click Config "https://github.com/azeezkenny007/corebanking/blob/main/CoreBanking.API/appsettings.Production.json"
    click Config "https://github.com/azeezkenny007/corebanking/blob/main/CoreBanking.API/Properties/launchSettings.json"
    click DockerRegistry "https://github.com/azeezkenny007/corebanking/tree/main/CoreBanking.API/Dockerfile"
    click ExternalClient "https://github.com/azeezkenny007/corebanking/tree/main/CoreBanking.API/"
    click AccountService "https://github.com/azeezkenny007/corebanking/tree/main/CoreBanking.Application/"
    click IAccountRepo "https://github.com/azeezkenny007/corebanking/blob/main/CoreBanking.Core/Interfaces/IAccountRepository.cs"
    click AccountModel "https://github.com/azeezkenny007/corebanking/blob/main/CoreBanking.Core/Models/AccountModel.cs"
    click AccountRepoImpl "https://github.com/azeezkenny007/corebanking/blob/main/CoreBanking.Infrastructure/Repositories/AccountRepository.cs"
    click CoreBankingSolution "https://github.com/azeezkenny007/corebanking/blob/main/CoreBanking.sln"
    click CoreBankingAPIProj "https://github.com/azeezkenny007/corebanking/blob/main/CoreBanking.API/CoreBanking.API.csproj"
    click AppProj "https://github.com/azeezkenny007/corebanking/blob/main/CoreBanking.Application/CoreBanking.Application.csproj"
    click CoreProj "https://github.com/azeezkenny007/corebanking/blob/main/CoreBanking.Core/CoreBanking.Core.csproj"
    click InfraProj "https://github.com/azeezkenny007/corebanking/blob/main/CoreBanking.Infrastructure/CoreBanking.Infrastructure.csproj"

    %% Styles
    classDef presentation fill:#cfe2f3,stroke:#0b5394,color:#0b5394
    classDef application fill:#d9ead3,stroke:#38761d,color:#38761d
    classDef domain fill:#fff2cc,stroke:#bf9000,color:#bf9000
    classDef infrastructure fill:#f4cccc,stroke:#cc0000,color:#cc0000
    classDef database fill:#d9d9d9,stroke:#7f7f7f,color:#000000
    classDef external fill:#f2f2f2,stroke:#666666,color:#000000
    class AccountController,WeatherController,Program,Config presentation
    class AccountService,TransactionService application
    class IAccountRepo,AccountModel domain
    class AccountRepoImpl infrastructure
    class SQLServer database
    class ExternalClient,DockerRegistry external
```
