# hayk364/banking-system architecture

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

- Interactive diagram: https://gitdiagram.com/hayk364/banking-system
- Repository: https://github.com/hayk364/banking-system

## Overview

This is an iOS banking client backed by a separate Express/MongoDB API. The user workflow runs from login or signup into a card-and-balance home screen, where users can add funds, send money, add a card, and view transaction history. The Swift model makes HTTP requests; the API handles account, card, balance, and transaction operations against MongoDB, with password encryption helpers. Several controller excerpts are partial and the README is empty, so unsampled capabilities and connections are represented only where the tree or shown references support them.

Main entry points: [`BankingSystem/Model/Model.swift`](https://github.com/hayk364/banking-system/blob/main/BankingSystem/Model/Model.swift) (HTTP client), [`BankingAPI/main.js`](https://github.com/hayk364/banking-system/blob/main/BankingAPI/main.js) (Banking API), [`BankingSystem/Controller/ViewController.swift`](https://github.com/hayk364/banking-system/blob/main/BankingSystem/Controller/ViewController.swift) (Login), [`BankingSystem/View/ViewManager.swift`](https://github.com/hayk364/banking-system/blob/main/BankingSystem/View/ViewManager.swift) (View styling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["iOS client"]
  node_scene["Scene startup"]
  node_model["HTTP client<br/>[Model.swift]"]
  node_userrecord["User data model<br/>[UserModel.swift]"]
end

subgraph group_account["Account access"]
  node_login["Login"]
  node_signup["Sign up"]
  node_forgot["Password recovery"]
end

subgraph group_banking["Banking operations"]
  node_home["Home and transfers"]
  node_addcard["Add card"]
  node_history["Transaction history"]
end

subgraph group_backend["API and storage"]
  node_api["Banking API<br/>[main.js]"]
  node_account_routes["Account routes<br/>[main.js]"]
  node_card_routes["Card routes<br/>[main.js]"]
  node_balance_routes["Balance and transfer routes<br/>[main.js]"]
  node_history_routes["Transaction route<br/>[main.js]"]
  node_crypto["Password crypto<br/>[back.js]"]
  node_mongo[("MongoDB")]
end

subgraph group_shared["Shared presentation"]
  node_viewmanager["View styling<br/>[ViewManager.swift]"]
end

node_user(("Bank customer"))

node_user -->|"signs in"| node_login
node_user -->|"registers"| node_signup
node_scene -->|"restores"| node_login
node_scene -->|"restores"| node_home
node_scene -->|"restores"| node_addcard
node_login -->|"authenticates"| node_model
node_signup -->|"checks and registers"| node_model
node_login -->|"opens recovery"| node_forgot
node_home -->|"requests banking actions"| node_model
node_home -->|"opens history"| node_history
node_addcard -->|"submits card"| node_model
node_history -->|"fetches transactions"| node_model
node_login -->|"styles screen"| node_viewmanager
node_signup -->|"styles screen"| node_viewmanager
node_home -->|"styles screen"| node_viewmanager
node_addcard -->|"styles screen"| node_viewmanager
node_history -->|"styles screen"| node_viewmanager
node_model -->|"sends HTTP requests"| node_api
node_api -->|"dispatches account requests"| node_account_routes
node_api -->|"dispatches card requests"| node_card_routes
node_api -->|"dispatches balance requests"| node_balance_routes
node_api -->|"dispatches history requests"| node_history_routes
node_account_routes -->|"reads and writes users"| node_mongo
node_card_routes -->|"reads and writes cards"| node_mongo
node_balance_routes -->|"updates balances"| node_mongo
node_history_routes -->|"reads transactions"| node_mongo
node_account_routes -->|"encrypts passwords"| node_crypto

click node_scene "https://github.com/hayk364/banking-system/blob/main/BankingSystem/Controller/SceneDelegate.swift"
click node_login "https://github.com/hayk364/banking-system/blob/main/BankingSystem/Controller/ViewController.swift"
click node_signup "https://github.com/hayk364/banking-system/blob/main/BankingSystem/Controller/SignUpViewController.swift"
click node_forgot "https://github.com/hayk364/banking-system/blob/main/BankingSystem/Controller/ForgotPasswordViewController.swift"
click node_home "https://github.com/hayk364/banking-system/blob/main/BankingSystem/Controller/HomeViewController.swift"
click node_addcard "https://github.com/hayk364/banking-system/blob/main/BankingSystem/Controller/AddCardViewController.swift"
click node_history "https://github.com/hayk364/banking-system/blob/main/BankingSystem/Controller/TrasactionHistoryViewController.swift"
click node_model "https://github.com/hayk364/banking-system/blob/main/BankingSystem/Model/Model.swift"
click node_userrecord "https://github.com/hayk364/banking-system/blob/main/BankingSystem/Model/UserModel.swift"
click node_viewmanager "https://github.com/hayk364/banking-system/blob/main/BankingSystem/View/ViewManager.swift"
click node_api "https://github.com/hayk364/banking-system/blob/main/BankingAPI/main.js"
click node_account_routes "https://github.com/hayk364/banking-system/blob/main/BankingAPI/main.js"
click node_card_routes "https://github.com/hayk364/banking-system/blob/main/BankingAPI/main.js"
click node_balance_routes "https://github.com/hayk364/banking-system/blob/main/BankingAPI/main.js"
click node_history_routes "https://github.com/hayk364/banking-system/blob/main/BankingAPI/main.js"
click node_crypto "https://github.com/hayk364/banking-system/blob/main/BankingAPI/back.js"

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_scene,node_model,node_userrecord toneBlue
class node_login,node_signup,node_forgot toneAmber
class node_home,node_addcard,node_history toneMint
class node_api,node_account_routes,node_card_routes,node_balance_routes,node_history_routes,node_crypto,node_mongo toneRose
class node_viewmanager,node_user toneIndigo
```

## Components

### iOS client

- [Scene startup](https://github.com/hayk364/banking-system/blob/main/BankingSystem/Controller/SceneDelegate.swift): `BankingSystem/Controller/SceneDelegate.swift`
- [HTTP client](https://github.com/hayk364/banking-system/blob/main/BankingSystem/Model/Model.swift): `BankingSystem/Model/Model.swift`
- [User data model](https://github.com/hayk364/banking-system/blob/main/BankingSystem/Model/UserModel.swift): `BankingSystem/Model/UserModel.swift`

### Account access

- [Login](https://github.com/hayk364/banking-system/blob/main/BankingSystem/Controller/ViewController.swift): `BankingSystem/Controller/ViewController.swift`
- [Sign up](https://github.com/hayk364/banking-system/blob/main/BankingSystem/Controller/SignUpViewController.swift): `BankingSystem/Controller/SignUpViewController.swift`
- [Password recovery](https://github.com/hayk364/banking-system/blob/main/BankingSystem/Controller/ForgotPasswordViewController.swift): `BankingSystem/Controller/ForgotPasswordViewController.swift`

### Banking operations

- [Home and transfers](https://github.com/hayk364/banking-system/blob/main/BankingSystem/Controller/HomeViewController.swift): `BankingSystem/Controller/HomeViewController.swift`
- [Add card](https://github.com/hayk364/banking-system/blob/main/BankingSystem/Controller/AddCardViewController.swift): `BankingSystem/Controller/AddCardViewController.swift`
- [Transaction history](https://github.com/hayk364/banking-system/blob/main/BankingSystem/Controller/TrasactionHistoryViewController.swift): `BankingSystem/Controller/TrasactionHistoryViewController.swift`

### API and storage

- [Banking API](https://github.com/hayk364/banking-system/blob/main/BankingAPI/main.js): `BankingAPI/main.js`
- [Account routes](https://github.com/hayk364/banking-system/blob/main/BankingAPI/main.js): `BankingAPI/main.js`
- [Card routes](https://github.com/hayk364/banking-system/blob/main/BankingAPI/main.js): `BankingAPI/main.js`
- [Balance and transfer routes](https://github.com/hayk364/banking-system/blob/main/BankingAPI/main.js): `BankingAPI/main.js`
- [Transaction route](https://github.com/hayk364/banking-system/blob/main/BankingAPI/main.js): `BankingAPI/main.js`
- [Password crypto](https://github.com/hayk364/banking-system/blob/main/BankingAPI/back.js): `BankingAPI/back.js`
- **MongoDB**

### Shared presentation

- [View styling](https://github.com/hayk364/banking-system/blob/main/BankingSystem/View/ViewManager.swift): `BankingSystem/View/ViewManager.swift`

### Other components

- **Bank customer**

## Connections

- Bank customer → Login: signs in (evidence: `BankingSystem/Controller/ViewController.swift`)
- Bank customer → Sign up: registers (evidence: `BankingSystem/Controller/SignUpViewController.swift`)
- Scene startup → Login: restores (evidence: `BankingSystem/Controller/SceneDelegate.swift`)
- Scene startup → Home and transfers: restores (evidence: `BankingSystem/Controller/SceneDelegate.swift`)
- Scene startup → Add card: restores (evidence: `BankingSystem/Controller/SceneDelegate.swift`)
- Login → HTTP client: authenticates (evidence: `BankingSystem/Controller/ViewController.swift`)
- Sign up → HTTP client: checks and registers (evidence: `BankingSystem/Controller/SignUpViewController.swift`)
- Login → Password recovery: opens recovery (evidence: `BankingSystem/Controller/ViewController.swift`)
- Home and transfers → HTTP client: requests banking actions (evidence: `BankingSystem/Controller/HomeViewController.swift`)
- Home and transfers → Transaction history: opens history (evidence: `BankingSystem/Controller/HomeViewController.swift`)
- Add card → HTTP client: submits card (evidence: `BankingSystem/Controller/AddCardViewController.swift`)
- Transaction history → HTTP client: fetches transactions (evidence: `BankingSystem/Controller/TrasactionHistoryViewController.swift`)
- Login → View styling: styles screen (evidence: `BankingSystem/Controller/ViewController.swift`)
- Sign up → View styling: styles screen (evidence: `BankingSystem/Controller/SignUpViewController.swift`)
- Home and transfers → View styling: styles screen (evidence: `BankingSystem/Controller/HomeViewController.swift`)
- Add card → View styling: styles screen (evidence: `BankingSystem/Controller/AddCardViewController.swift`)
- Transaction history → View styling: styles screen (evidence: `BankingSystem/Controller/TrasactionHistoryViewController.swift`)
- HTTP client → Banking API: sends HTTP requests (evidence: `BankingSystem/Model/Model.swift`)
- Banking API → Account routes: dispatches account requests (evidence: `BankingAPI/main.js`)
- Banking API → Card routes: dispatches card requests (evidence: `BankingAPI/main.js`)
- Banking API → Balance and transfer routes: dispatches balance requests (evidence: `BankingAPI/main.js`)
- Banking API → Transaction route: dispatches history requests (evidence: `BankingAPI/main.js`)
- Account routes → MongoDB: reads and writes users (evidence: `BankingAPI/main.js`)
- Card routes → MongoDB: reads and writes cards (evidence: `BankingAPI/main.js`)
- Balance and transfer routes → MongoDB: updates balances (evidence: `BankingAPI/main.js`)
- Transaction route → MongoDB: reads transactions (evidence: `BankingAPI/main.js`)
- Account routes → Password crypto: encrypts passwords (evidence: `BankingAPI/main.js`)
