# fencer-so/commbank-server architecture

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

- Interactive diagram: https://gitdiagram.com/fencer-so/commbank-server
- Repository: https://github.com/fencer-so/commbank-server

## Overview

CommBank-Server is an ASP.NET API for managing users, accounts, savings goals, tags, and transactions, with MongoDB-backed authentication and service-layer persistence. The principal workflow is an HTTP request routed to a controller, delegated to a domain service, and returned as an API result. The graph preserves the distinct domain endpoints and models. Source excerpts establish goal and authentication behavior; other controller-to-service links are supported by the SOURCE INDEX. Persistence links beyond authentication are omitted where the sampled evidence does not show them.

Main entry points: [`CommBank-Server/Program.cs`](https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Program.cs) (Service wiring), [`CommBank-Server/Controllers/GoalController.cs`](https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Controllers/GoalController.cs) (Goal API), [`CommBank-Server/Services/AuthService.cs`](https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Services/AuthService.cs) (Authentication), [`CommBank-Server/Services/UsersService.cs`](https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Services/UsersService.cs) (User service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API endpoints"]
  node_authctl["Authentication API<br/>[AuthController.cs]"]
  node_accountctl["Account API"]
  node_goalctl["Goal API<br/>[GoalController.cs]"]
  node_tagctl["Tag API<br/>[TagController.cs]"]
  node_txctl["Transaction API"]
  node_userctl["User API<br/>[UserController.cs]"]
end

subgraph group_services["Domain services"]
  node_authsvc["Authentication<br/>[AuthService.cs]"]
  node_accountsvc["Account service<br/>[AccountService.cs]"]
  node_goalsvc["Goal service<br/>[GoalService.cs]"]
  node_tagsvc["Tag service<br/>[TagsService.cs]"]
  node_txsvc["Transaction service"]
  node_usersvc["User service<br/>[UsersService.cs]"]
end

subgraph group_domain["Domain models"]
  node_account["Account record<br/>[Account.cs]"]
  node_goal["Goal record<br/>[Goal.cs]"]
  node_tag["Tag record<br/>[Tag.cs]"]
  node_transaction["Transaction record<br/>[Transaction.cs]"]
  node_user["User record<br/>[User.cs]"]
end

subgraph group_runtime["Runtime"]
  node_bootstrap["Service wiring<br/>[Program.cs]"]
end

node_client(("API client"))
node_mongodb[("MongoDB")]

node_client -->|"sends request"| node_authctl
node_client -->|"sends request"| node_accountctl
node_client -->|"sends request"| node_goalctl
node_client -->|"sends request"| node_tagctl
node_client -->|"sends request"| node_txctl
node_client -->|"sends request"| node_userctl
node_bootstrap -->|"registers"| node_authsvc
node_bootstrap -->|"registers"| node_goalsvc
node_bootstrap -->|"registers"| node_tagsvc
node_bootstrap -->|"registers"| node_txsvc
node_bootstrap -->|"registers"| node_usersvc
node_authctl -->|"authenticates via"| node_authsvc
node_goalctl -->|"delegates to"| node_goalsvc
node_goalctl -->|"updates user"| node_usersvc
node_tagctl -->|"delegates to"| node_tagsvc
node_txctl -->|"delegates to"| node_txsvc
node_userctl -->|"delegates to"| node_usersvc
node_authsvc -->|"queries users"| node_mongodb

click node_bootstrap "https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Program.cs"
click node_authctl "https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Controllers/AuthController.cs"
click node_accountctl "https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Controllers/AccountController.cs"
click node_goalctl "https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Controllers/GoalController.cs"
click node_tagctl "https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Controllers/TagController.cs"
click node_txctl "https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Controllers/TransactionController.cs"
click node_userctl "https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Controllers/UserController.cs"
click node_authsvc "https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Services/AuthService.cs"
click node_accountsvc "https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Services/AccountService.cs"
click node_goalsvc "https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Services/GoalService.cs"
click node_tagsvc "https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Services/TagsService.cs"
click node_txsvc "https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Services/TransactionsService.cs"
click node_usersvc "https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Services/UsersService.cs"
click node_account "https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Models/Account.cs"
click node_goal "https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Models/Goal.cs"
click node_tag "https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Models/Tag.cs"
click node_transaction "https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Models/Transaction.cs"
click node_user "https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Models/User.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_authctl,node_accountctl,node_goalctl,node_tagctl,node_txctl,node_userctl,node_client toneBlue
class node_authsvc,node_accountsvc,node_goalsvc,node_tagsvc,node_txsvc,node_usersvc,node_mongodb toneAmber
class node_account,node_goal,node_tag,node_transaction,node_user toneMint
class node_bootstrap toneRose
```

## Components

### API endpoints

- [Authentication API](https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Controllers/AuthController.cs): `CommBank-Server/Controllers/AuthController.cs`
- [Account API](https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Controllers/AccountController.cs): `CommBank-Server/Controllers/AccountController.cs`
- [Goal API](https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Controllers/GoalController.cs): `CommBank-Server/Controllers/GoalController.cs`
- [Tag API](https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Controllers/TagController.cs): `CommBank-Server/Controllers/TagController.cs`
- [Transaction API](https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Controllers/TransactionController.cs): `CommBank-Server/Controllers/TransactionController.cs`
- [User API](https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Controllers/UserController.cs): `CommBank-Server/Controllers/UserController.cs`

### Domain services

- [Authentication](https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Services/AuthService.cs): `CommBank-Server/Services/AuthService.cs`
- [Account service](https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Services/AccountService.cs): `CommBank-Server/Services/AccountService.cs`
- [Goal service](https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Services/GoalService.cs): `CommBank-Server/Services/GoalService.cs`
- [Tag service](https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Services/TagsService.cs): `CommBank-Server/Services/TagsService.cs`
- [Transaction service](https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Services/TransactionsService.cs): `CommBank-Server/Services/TransactionsService.cs`
- [User service](https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Services/UsersService.cs): `CommBank-Server/Services/UsersService.cs`

### Domain models

- [Account record](https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Models/Account.cs): `CommBank-Server/Models/Account.cs`
- [Goal record](https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Models/Goal.cs): `CommBank-Server/Models/Goal.cs`
- [Tag record](https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Models/Tag.cs): `CommBank-Server/Models/Tag.cs`
- [Transaction record](https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Models/Transaction.cs): `CommBank-Server/Models/Transaction.cs`
- [User record](https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Models/User.cs): `CommBank-Server/Models/User.cs`

### Runtime

- [Service wiring](https://github.com/fencer-so/commbank-server/blob/main/CommBank-Server/Program.cs): `CommBank-Server/Program.cs`

### Other components

- **API client**
- **MongoDB**

## Connections

- API client → Authentication API: sends request
- API client → Account API: sends request
- API client → Goal API: sends request
- API client → Tag API: sends request
- API client → Transaction API: sends request
- API client → User API: sends request
- Service wiring → Authentication: registers (evidence: `CommBank-Server/Program.cs`)
- Service wiring → Goal service: registers (evidence: `CommBank-Server/Program.cs`)
- Service wiring → Tag service: registers (evidence: `CommBank-Server/Program.cs`)
- Service wiring → Transaction service: registers (evidence: `CommBank-Server/Program.cs`)
- Service wiring → User service: registers (evidence: `CommBank-Server/Program.cs`)
- Authentication API → Authentication: authenticates via (evidence: `CommBank-Server/Controllers/AuthController.cs`)
- Goal API → Goal service: delegates to (evidence: `CommBank-Server/Controllers/GoalController.cs`)
- Goal API → User service: updates user (evidence: `CommBank-Server/Controllers/GoalController.cs`)
- Tag API → Tag service: delegates to (evidence: `CommBank-Server/Controllers/TagController.cs`)
- Transaction API → Transaction service: delegates to (evidence: `CommBank-Server/Controllers/TransactionController.cs`)
- User API → User service: delegates to (evidence: `CommBank-Server/Controllers/UserController.cs`)
- Authentication → MongoDB: queries users (evidence: `CommBank-Server/Services/AuthService.cs`)
