# stepanchikk/money_tracking architecture

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

- Interactive diagram: https://gitdiagram.com/stepanchikk/money_tracking
- Repository: https://github.com/stepanchikk/money_tracking

## Overview

This is a personal-finance web application backed by a JWT-protected REST API. Users authenticate, then manage accounts and record income, expenses, or transfers; the API updates account balances and stores transactions. The UI dashboard exposes transaction, account, category, budget, goal, report, and overview views. Planning includes category spend-limit checks and savings goals, while reports provide an additional analysis branch. The main transaction, budget, account, and goal relationships are visible in excerpts; other API links rely on the SOURCE INDEX. Frontend-to-API requests are not shown, so that boundary is marked unverified.

Main entry points: [`finance_api/server.js`](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/server.js) (Express API), [`client/src/components/Dashboard.jsx`](https://github.com/stepanchikk/money_tracking/blob/main/client/src/components/Dashboard.jsx) (Dashboard shell), [`finance_api/middlewares/authMiddleware.js`](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/middlewares/authMiddleware.js) (JWT protection), [`finance_api/models/transaction.js`](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/models/transaction.js) (Transaction records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["App<br/>[App.jsx]"]
  node_authui["Authentication view<br/>[Auth.jsx]"]
  node_dashboard["Dashboard shell<br/>[Dashboard.jsx]"]
  node_accountsui["Accounts view<br/>[Accounts.jsx]"]
  node_transactionsui["Transactions view<br/>[Transactions.jsx]"]
  node_categoriesui["Categories view<br/>[Categories.jsx]"]
  node_budgetsui["Budgets view<br/>[Budgets.jsx]"]
  node_goalsui["Goals view<br/>[Goals.jsx]"]
  node_reportsui["Reports view<br/>[Reports.jsx]"]
  node_overviewui["Overview view<br/>[Overview.jsx]"]
end

subgraph group_api["API and access"]
  node_api["Express API<br/>[server.js]"]
  node_authroutes["Authentication routes<br/>[authRoutes.js]"]
  node_authcontroller["Authentication logic<br/>[authController.js]"]
  node_authguard["JWT protection<br/>[authMiddleware.js]"]
  node_accountroutes["Account routes<br/>[accountRoutes.js]"]
  node_transactionroutes["Transaction routes"]
  node_budgetroutes["Budget routes<br/>[budgetRoutes.js]"]
  node_goalroutes["Goal routes<br/>[goalRoutes.js]"]
  node_reportroutes["Report routes<br/>[reportRoutes.js]"]
  node_categoryroutes["Category routes<br/>[categoryRoutes.js]"]
end

subgraph group_finance["Finance operations"]
  node_accountlogic["Account operations"]
  node_transactionlogic["Transaction operations"]
  node_categorylogic["Category operations"]
end

subgraph group_planning["Planning and analysis"]
  node_budgetlogic["Budget status"]
  node_goallogic["Goal operations<br/>[goalController.js]"]
  node_reportlogic["Report generation"]
end

subgraph group_data["Persistence"]
  node_userstore[("User records<br/>[user.js]")]
  node_accountstore[("Account records<br/>[account.js]")]
  node_transactionstore[("Transaction records<br/>[transaction.js]")]
  node_budgetstore[("Budget records<br/>[budget.js]")]
  node_goalstore[("Goal records<br/>[goal.js]")]
  node_categorystore[("Category records<br/>[category.js]")]
  node_tagstore[("Transaction tags<br/>[tag.js]")]
end

node_user(("Finance user"))

node_user -->|"uses"| node_app
node_app -->|"shows unauthenticated"| node_authui
node_app -->|"shows authenticated"| node_dashboard
node_dashboard -->|"renders"| node_accountsui
node_dashboard -->|"renders"| node_transactionsui
node_dashboard -->|"renders"| node_categoriesui
node_dashboard -->|"renders"| node_budgetsui
node_dashboard -->|"renders"| node_goalsui
node_dashboard -->|"renders"| node_reportsui
node_dashboard -->|"renders"| node_overviewui
node_authui -.->|"requests auth"| node_api
node_accountsui -.->|"requests accounts"| node_api
node_transactionsui -.->|"requests transactions"| node_api
node_categoriesui -.->|"requests categories"| node_api
node_budgetsui -.->|"requests budgets"| node_api
node_goalsui -.->|"requests goals"| node_api
node_reportsui -.->|"requests reports"| node_api
node_api -->|"mounts"| node_authroutes
node_api -->|"mounts"| node_categoryroutes
node_api -->|"mounts"| node_accountroutes
node_api -->|"mounts"| node_transactionroutes
node_api -->|"mounts"| node_reportroutes
node_api -->|"mounts"| node_budgetroutes
node_api -->|"mounts"| node_goalroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_accountroutes -->|"dispatches"| node_accountlogic
node_transactionroutes -->|"dispatches"| node_transactionlogic
node_budgetroutes -->|"dispatches"| node_budgetlogic
node_goalroutes -->|"dispatches"| node_goallogic
node_reportroutes -->|"dispatches"| node_reportlogic
node_categoryroutes -->|"dispatches"| node_categorylogic
node_accountroutes -->|"protects"| node_authguard
node_transactionroutes -->|"protects"| node_authguard
node_budgetroutes -->|"protects"| node_authguard
node_goalroutes -->|"protects"| node_authguard
node_authguard -->|"loads user"| node_userstore
node_authcontroller -->|"reads and writes"| node_userstore
node_accountlogic -->|"reads and writes"| node_accountstore
node_transactionlogic -->|"reads and writes"| node_transactionstore
node_transactionlogic -->|"updates balances"| node_accountstore
node_budgetlogic -->|"reads and writes"| node_budgetstore
node_budgetlogic -->|"aggregates spending"| node_transactionstore
node_goallogic -->|"reads and writes"| node_goalstore
node_reportlogic -->|"queries"| node_transactionstore
node_categorylogic -->|"reads and writes"| node_categorystore
node_transactionstore -->|"references tags"| node_tagstore

click node_app "https://github.com/stepanchikk/money_tracking/blob/main/client/src/App.jsx"
click node_authui "https://github.com/stepanchikk/money_tracking/blob/main/client/src/components/Auth.jsx"
click node_dashboard "https://github.com/stepanchikk/money_tracking/blob/main/client/src/components/Dashboard.jsx"
click node_accountsui "https://github.com/stepanchikk/money_tracking/blob/main/client/src/components/Accounts.jsx"
click node_transactionsui "https://github.com/stepanchikk/money_tracking/blob/main/client/src/components/Transactions.jsx"
click node_categoriesui "https://github.com/stepanchikk/money_tracking/blob/main/client/src/components/Categories.jsx"
click node_budgetsui "https://github.com/stepanchikk/money_tracking/blob/main/client/src/components/Budgets.jsx"
click node_goalsui "https://github.com/stepanchikk/money_tracking/blob/main/client/src/components/Goals.jsx"
click node_reportsui "https://github.com/stepanchikk/money_tracking/blob/main/client/src/components/Reports.jsx"
click node_overviewui "https://github.com/stepanchikk/money_tracking/blob/main/client/src/components/Overview.jsx"
click node_api "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/server.js"
click node_authroutes "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/routes/authRoutes.js"
click node_authcontroller "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/controllers/authController.js"
click node_authguard "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/middlewares/authMiddleware.js"
click node_accountroutes "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/routes/accountRoutes.js"
click node_transactionroutes "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/routes/transactionRoutes.js"
click node_budgetroutes "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/routes/budgetRoutes.js"
click node_goalroutes "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/routes/goalRoutes.js"
click node_reportroutes "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/routes/reportRoutes.js"
click node_categoryroutes "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/routes/categoryRoutes.js"
click node_accountlogic "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/controllers/accountController.js"
click node_transactionlogic "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/controllers/transactionController.js"
click node_budgetlogic "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/controllers/budgetController.js"
click node_goallogic "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/controllers/goalController.js"
click node_reportlogic "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/controllers/reportController.js"
click node_categorylogic "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/controllers/categoryController.js"
click node_userstore "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/models/user.js"
click node_accountstore "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/models/account.js"
click node_transactionstore "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/models/transaction.js"
click node_budgetstore "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/models/budget.js"
click node_goalstore "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/models/goal.js"
click node_categorystore "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/models/category.js"
click node_tagstore "https://github.com/stepanchikk/money_tracking/blob/main/finance_api/models/tag.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_app,node_authui,node_dashboard,node_accountsui,node_transactionsui,node_categoriesui,node_budgetsui,node_goalsui,node_reportsui,node_overviewui,node_user toneBlue
class node_api,node_authroutes,node_authcontroller,node_authguard,node_accountroutes,node_transactionroutes,node_budgetroutes,node_goalroutes,node_reportroutes,node_categoryroutes toneAmber
class node_accountlogic,node_transactionlogic,node_categorylogic toneMint
class node_budgetlogic,node_goallogic,node_reportlogic toneRose
class node_userstore,node_accountstore,node_transactionstore,node_budgetstore,node_goalstore,node_categorystore,node_tagstore toneIndigo
```

## Components

### Web client

- [App](https://github.com/stepanchikk/money_tracking/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Authentication view](https://github.com/stepanchikk/money_tracking/blob/main/client/src/components/Auth.jsx): `client/src/components/Auth.jsx`
- [Dashboard shell](https://github.com/stepanchikk/money_tracking/blob/main/client/src/components/Dashboard.jsx): `client/src/components/Dashboard.jsx`
- [Accounts view](https://github.com/stepanchikk/money_tracking/blob/main/client/src/components/Accounts.jsx): `client/src/components/Accounts.jsx`
- [Transactions view](https://github.com/stepanchikk/money_tracking/blob/main/client/src/components/Transactions.jsx): `client/src/components/Transactions.jsx`
- [Categories view](https://github.com/stepanchikk/money_tracking/blob/main/client/src/components/Categories.jsx): `client/src/components/Categories.jsx`
- [Budgets view](https://github.com/stepanchikk/money_tracking/blob/main/client/src/components/Budgets.jsx): `client/src/components/Budgets.jsx`
- [Goals view](https://github.com/stepanchikk/money_tracking/blob/main/client/src/components/Goals.jsx): `client/src/components/Goals.jsx`
- [Reports view](https://github.com/stepanchikk/money_tracking/blob/main/client/src/components/Reports.jsx): `client/src/components/Reports.jsx`
- [Overview view](https://github.com/stepanchikk/money_tracking/blob/main/client/src/components/Overview.jsx): `client/src/components/Overview.jsx`

### API and access

- [Express API](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/server.js): `finance_api/server.js`
- [Authentication routes](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/routes/authRoutes.js): `finance_api/routes/authRoutes.js`
- [Authentication logic](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/controllers/authController.js): `finance_api/controllers/authController.js`
- [JWT protection](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/middlewares/authMiddleware.js): `finance_api/middlewares/authMiddleware.js`
- [Account routes](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/routes/accountRoutes.js): `finance_api/routes/accountRoutes.js`
- [Transaction routes](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/routes/transactionRoutes.js): `finance_api/routes/transactionRoutes.js`
- [Budget routes](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/routes/budgetRoutes.js): `finance_api/routes/budgetRoutes.js`
- [Goal routes](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/routes/goalRoutes.js): `finance_api/routes/goalRoutes.js`
- [Report routes](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/routes/reportRoutes.js): `finance_api/routes/reportRoutes.js`
- [Category routes](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/routes/categoryRoutes.js): `finance_api/routes/categoryRoutes.js`

### Finance operations

- [Account operations](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/controllers/accountController.js): `finance_api/controllers/accountController.js`
- [Transaction operations](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/controllers/transactionController.js): `finance_api/controllers/transactionController.js`
- [Category operations](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/controllers/categoryController.js): `finance_api/controllers/categoryController.js`

### Planning and analysis

- [Budget status](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/controllers/budgetController.js): `finance_api/controllers/budgetController.js`
- [Goal operations](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/controllers/goalController.js): `finance_api/controllers/goalController.js`
- [Report generation](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/controllers/reportController.js): `finance_api/controllers/reportController.js`

### Persistence

- [User records](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/models/user.js): `finance_api/models/user.js`
- [Account records](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/models/account.js): `finance_api/models/account.js`
- [Transaction records](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/models/transaction.js): `finance_api/models/transaction.js`
- [Budget records](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/models/budget.js): `finance_api/models/budget.js`
- [Goal records](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/models/goal.js): `finance_api/models/goal.js`
- [Category records](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/models/category.js): `finance_api/models/category.js`
- [Transaction tags](https://github.com/stepanchikk/money_tracking/blob/main/finance_api/models/tag.js): `finance_api/models/tag.js`

### Other components

- **Finance user**

## Connections

- Finance user → App: uses (evidence: `README.md`)
- App → Authentication view: shows unauthenticated (evidence: `client/src/App.jsx`)
- App → Dashboard shell: shows authenticated (evidence: `client/src/App.jsx`)
- Dashboard shell → Accounts view: renders (evidence: `client/src/components/Dashboard.jsx`)
- Dashboard shell → Transactions view: renders (evidence: `client/src/components/Dashboard.jsx`)
- Dashboard shell → Categories view: renders (evidence: `client/src/components/Dashboard.jsx`)
- Dashboard shell → Budgets view: renders (evidence: `client/src/components/Dashboard.jsx`)
- Dashboard shell → Goals view: renders (evidence: `client/src/components/Dashboard.jsx`)
- Dashboard shell → Reports view: renders (evidence: `client/src/components/Dashboard.jsx`)
- Dashboard shell → Overview view: renders (evidence: `client/src/components/Dashboard.jsx`)
- Authentication view → Express API: requests auth
- Accounts view → Express API: requests accounts
- Transactions view → Express API: requests transactions
- Categories view → Express API: requests categories
- Budgets view → Express API: requests budgets
- Goals view → Express API: requests goals
- Reports view → Express API: requests reports
- Express API → Authentication routes: mounts (evidence: `finance_api/server.js`)
- Express API → Category routes: mounts (evidence: `finance_api/server.js`)
- Express API → Account routes: mounts (evidence: `finance_api/server.js`)
- Express API → Transaction routes: mounts (evidence: `finance_api/server.js`)
- Express API → Report routes: mounts (evidence: `finance_api/server.js`)
- Express API → Budget routes: mounts (evidence: `finance_api/server.js`)
- Express API → Goal routes: mounts (evidence: `finance_api/server.js`)
- Authentication routes → Authentication logic: dispatches (evidence: `finance_api/routes/authRoutes.js`)
- Account routes → Account operations: dispatches (evidence: `finance_api/routes/accountRoutes.js`)
- Transaction routes → Transaction operations: dispatches (evidence: `finance_api/routes/transactionRoutes.js`)
- Budget routes → Budget status: dispatches (evidence: `finance_api/routes/budgetRoutes.js`)
- Goal routes → Goal operations: dispatches (evidence: `finance_api/routes/goalRoutes.js`)
- Report routes → Report generation: dispatches (evidence: `finance_api/routes/reportRoutes.js`)
- Category routes → Category operations: dispatches (evidence: `finance_api/routes/categoryRoutes.js`)
- Account routes → JWT protection: protects (evidence: `finance_api/routes/accountRoutes.js`)
- Transaction routes → JWT protection: protects (evidence: `finance_api/routes/transactionRoutes.js`)
- Budget routes → JWT protection: protects (evidence: `finance_api/routes/budgetRoutes.js`)
- Goal routes → JWT protection: protects (evidence: `finance_api/routes/goalRoutes.js`)
- JWT protection → User records: loads user (evidence: `finance_api/middlewares/authMiddleware.js`)
- Authentication logic → User records: reads and writes (evidence: `finance_api/controllers/authController.js`)
- Account operations → Account records: reads and writes (evidence: `finance_api/controllers/accountController.js`)
- Transaction operations → Transaction records: reads and writes (evidence: `finance_api/controllers/transactionController.js`)
- Transaction operations → Account records: updates balances (evidence: `finance_api/controllers/transactionController.js`)
- Budget status → Budget records: reads and writes (evidence: `finance_api/controllers/budgetController.js`)
- Budget status → Transaction records: aggregates spending (evidence: `finance_api/controllers/budgetController.js`)
- Goal operations → Goal records: reads and writes (evidence: `finance_api/controllers/goalController.js`)
- Report generation → Transaction records: queries (evidence: `finance_api/controllers/reportController.js`)
- Category operations → Category records: reads and writes (evidence: `finance_api/controllers/categoryController.js`)
- Transaction records → Transaction tags: references tags (evidence: `finance_api/models/transaction.js`)
