# nhtaliyev/bankingsystem architecture

> Architecture diagram of the GitHub repository nhtaliyev/bankingsystem, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nhtaliyev/bankingsystem
- Repository: https://github.com/nhtaliyev/bankingsystem

## Overview

BankingSystem is a .NET banking backend organized around authentication, accounts, cards, and transactions, with business services separated from domain models and EF Core repositories. The apparent user workflow is authentication followed by account/card and transaction operations, but the tree and excerpts show no controllers or route handlers, so API-to-service dispatch is not established. Auth supports registration, login, refresh/logout, password recovery, and email confirmation. Account/card and persistence relationships are supported by the source index; transaction-service behavior is unsampled.

Main entry points: [`BankingSystem/BankingSystem.Data/Repositories/GenericRepository.cs`](https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Data/Repositories/GenericRepository.cs) (Generic repository), [`BankingSystem/BankingSystem.Business/Implementations/CardService.cs`](https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Business/Implementations/CardService.cs) (Card services), [`BankingSystem/BankingSystem.Data/AppDbContext.cs`](https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Data/AppDbContext.cs) (EF context), [`BankingSystem/BankingSystem.Business/Implementations/AuthService.cs`](https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Business/Implementations/AuthService.cs) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API host"]
  node_api_host["API host<br/>[Program.cs]"]
end

subgraph group_business["Business services"]
  node_auth["Authentication<br/>[AuthService.cs]"]
  node_auth_dto["Auth requests<br/>[UserRegisterDto.cs]"]
  node_accounts["Account services<br/>[AccountService.cs]"]
  node_cards["Card services<br/>[CardService.cs]"]
  node_encryption["Card encryption"]
  node_transactions["Transaction services"]
  node_users["User services<br/>[UserService.cs]"]
end

subgraph group_domain["Banking domain"]
  node_user_model["User identity<br/>[AppUser.cs]"]
  node_account_model["Accounts<br/>[Account.cs]"]
  node_card_model["Cards<br/>[Card.cs]"]
  node_transaction_model["Transactions<br/>[Transaction.cs]"]
end

subgraph group_data["Persistence"]
  node_account_repo["Account repository"]
  node_card_repo["Card repository<br/>[CardRepository.cs]"]
  node_transaction_repo["Transaction repository"]
  node_generic_repo["Generic repository"]
  node_db_context["EF context<br/>[AppDbContext.cs]"]
end

node_customer(("Customer"))
node_postgres[("PostgreSQL")]

node_customer -.->|"requests"| node_api_host
node_api_host -->|"configures"| node_db_context
node_auth -->|"accepts"| node_auth_dto
node_auth -->|"manages identity"| node_user_model
node_accounts -->|"manages"| node_account_model
node_accounts -->|"queries and saves"| node_account_repo
node_cards -->|"manages"| node_card_model
node_cards -->|"queries and saves"| node_card_repo
node_cards -->|"uses"| node_encryption
node_transactions -.->|"manages"| node_transaction_model
node_transactions -.->|"uses"| node_transaction_repo
node_account_repo -->|"extends"| node_generic_repo
node_card_repo -->|"extends"| node_generic_repo
node_transaction_repo -->|"extends"| node_generic_repo
node_generic_repo -->|"reads and writes"| node_db_context
node_db_context -->|"connects"| node_postgres

click node_api_host "https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.API/Program.cs"
click node_auth "https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Business/Implementations/AuthService.cs"
click node_auth_dto "https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Business/DTOs/AuthDTOs/UserRegisterDto.cs"
click node_accounts "https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Business/Implementations/AccountService.cs"
click node_cards "https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Business/Implementations/CardService.cs"
click node_encryption "https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Business/ExternalServices/Implementations/CardEncryptionService.cs"
click node_transactions "https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Business/Implementations/TransactionService.cs"
click node_users "https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Business/Implementations/UserService.cs"
click node_user_model "https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Core/Models/AppUser.cs"
click node_account_model "https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Core/Models/Account.cs"
click node_card_model "https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Core/Models/Card.cs"
click node_transaction_model "https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Core/Models/Transaction.cs"
click node_account_repo "https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Data/Repositories/AccountRepository.cs"
click node_card_repo "https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Data/Repositories/CardRepository.cs"
click node_transaction_repo "https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Data/Repositories/TransactionRepository.cs"
click node_generic_repo "https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Data/Repositories/GenericRepository.cs"
click node_db_context "https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Data/AppDbContext.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api_host toneBlue
class node_auth,node_auth_dto,node_accounts,node_cards,node_encryption,node_transactions,node_users,node_postgres toneAmber
class node_user_model,node_account_model,node_card_model,node_transaction_model toneMint
class node_account_repo,node_card_repo,node_transaction_repo,node_generic_repo,node_db_context toneRose
class node_customer toneIndigo
```

## Components

### API host

- [API host](https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.API/Program.cs): `BankingSystem/BankingSystem.API/Program.cs`

### Business services

- [Authentication](https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Business/Implementations/AuthService.cs): `BankingSystem/BankingSystem.Business/Implementations/AuthService.cs`
- [Auth requests](https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Business/DTOs/AuthDTOs/UserRegisterDto.cs): `BankingSystem/BankingSystem.Business/DTOs/AuthDTOs/UserRegisterDto.cs`
- [Account services](https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Business/Implementations/AccountService.cs): `BankingSystem/BankingSystem.Business/Implementations/AccountService.cs`
- [Card services](https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Business/Implementations/CardService.cs): `BankingSystem/BankingSystem.Business/Implementations/CardService.cs`
- [Card encryption](https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Business/ExternalServices/Implementations/CardEncryptionService.cs): `BankingSystem/BankingSystem.Business/ExternalServices/Implementations/CardEncryptionService.cs`
- [Transaction services](https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Business/Implementations/TransactionService.cs): `BankingSystem/BankingSystem.Business/Implementations/TransactionService.cs`
- [User services](https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Business/Implementations/UserService.cs): `BankingSystem/BankingSystem.Business/Implementations/UserService.cs`

### Banking domain

- [User identity](https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Core/Models/AppUser.cs): `BankingSystem/BankingSystem.Core/Models/AppUser.cs`
- [Accounts](https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Core/Models/Account.cs): `BankingSystem/BankingSystem.Core/Models/Account.cs`
- [Cards](https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Core/Models/Card.cs): `BankingSystem/BankingSystem.Core/Models/Card.cs`
- [Transactions](https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Core/Models/Transaction.cs): `BankingSystem/BankingSystem.Core/Models/Transaction.cs`

### Persistence

- [Account repository](https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Data/Repositories/AccountRepository.cs): `BankingSystem/BankingSystem.Data/Repositories/AccountRepository.cs`
- [Card repository](https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Data/Repositories/CardRepository.cs): `BankingSystem/BankingSystem.Data/Repositories/CardRepository.cs`
- [Transaction repository](https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Data/Repositories/TransactionRepository.cs): `BankingSystem/BankingSystem.Data/Repositories/TransactionRepository.cs`
- [Generic repository](https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Data/Repositories/GenericRepository.cs): `BankingSystem/BankingSystem.Data/Repositories/GenericRepository.cs`
- [EF context](https://github.com/nhtaliyev/bankingsystem/blob/main/BankingSystem/BankingSystem.Data/AppDbContext.cs): `BankingSystem/BankingSystem.Data/AppDbContext.cs`

### Other components

- **Customer**
- **PostgreSQL**

## Connections

- Customer → API host: requests
- API host → EF context: configures (evidence: `BankingSystem/BankingSystem.API/Program.cs`)
- Authentication → Auth requests: accepts (evidence: `BankingSystem/BankingSystem.Business/Implementations/AuthService.cs`)
- Authentication → User identity: manages identity (evidence: `BankingSystem/BankingSystem.Business/Implementations/AuthService.cs`)
- Account services → Accounts: manages (evidence: `BankingSystem/BankingSystem.Business/Implementations/AccountService.cs`)
- Account services → Account repository: queries and saves (evidence: `BankingSystem/BankingSystem.Business/Implementations/AccountService.cs`)
- Card services → Cards: manages (evidence: `BankingSystem/BankingSystem.Business/Implementations/CardService.cs`)
- Card services → Card repository: queries and saves (evidence: `BankingSystem/BankingSystem.Business/Implementations/CardService.cs`)
- Card services → Card encryption: uses (evidence: `BankingSystem/BankingSystem.Business/Implementations/CardService.cs`)
- Transaction services → Transactions: manages
- Transaction services → Transaction repository: uses
- Account repository → Generic repository: extends (evidence: `BankingSystem/BankingSystem.Data/Repositories/AccountRepository.cs`)
- Card repository → Generic repository: extends (evidence: `BankingSystem/BankingSystem.Data/Repositories/CardRepository.cs`)
- Transaction repository → Generic repository: extends (evidence: `BankingSystem/BankingSystem.Data/Repositories/TransactionRepository.cs`)
- Generic repository → EF context: reads and writes (evidence: `BankingSystem/BankingSystem.Data/Repositories/GenericRepository.cs`)
- EF context → PostgreSQL: connects
