# yurchyshyna/finwise architecture

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

- Interactive diagram: https://gitdiagram.com/yurchyshyna/finwise
- Repository: https://github.com/yurchyshyna/finwise

## Overview

FinWise is a personal-finance web application. The evidenced runtime workflow is a user adding a cash expense in the React interface; the interface calls the FastAPI transaction endpoints, which use PostgreSQL to store and list transactions. The API also exposes health and Prometheus metrics, and a separate worker periodically checks database availability. The README describes broader planned capabilities—bank imports, categorization, budgets, alerts, analytics and forecasts—but the sampled source shows only the minimal manual-expense workflow. Those documented capabilities are shown as unverified; their implementation paths and runtime links are not established by the tree or excerpts.

Main entry points: [`backend/app/db.py`](https://github.com/yurchyshyna/finwise/blob/main/backend/app/db.py) (Transaction data access), [`backend/app/main.py`](https://github.com/yurchyshyna/finwise/blob/main/backend/app/main.py) (FastAPI endpoints), [`frontend/src/App.jsx`](https://github.com/yurchyshyna/finwise/blob/main/frontend/src/App.jsx) (Expense interface), [`frontend/src/main.jsx`](https://github.com/yurchyshyna/finwise/blob/main/frontend/src/main.jsx) (React entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User interface"]
  node_react["React entry<br/>[main.jsx]"]
  node_expense_ui["Expense interface<br/>[App.jsx]"]
end

subgraph group_service["Application services"]
  node_api["FastAPI endpoints<br/>[main.py]"]
  node_settings["Environment settings<br/>[config.py]"]
  node_db_access["Transaction data access<br/>[db.py]"]
  node_postgres[("PostgreSQL")]
end

subgraph group_finance["Finance capabilities"]
  node_bank["Bank data adapter"]
  node_bank_api["Bank API or CSV"]
  node_categorization["Expense categorization"]
  node_budgets["Category limits"]
  node_alerts["Limit notifications"]
  node_analytics["Spending statistics"]
  node_forecast["Balance forecast"]
end

subgraph group_operations["Runtime operations"]
  node_worker["Database worker<br/>[worker.py]"]
  node_prometheus(("Prometheus"))
end

node_user(("Finance user"))

node_user -->|"enters expense"| node_expense_ui
node_react -->|"renders"| node_expense_ui
node_expense_ui -->|"requests transactions"| node_api
node_api -->|"reads and writes"| node_db_access
node_db_access -->|"uses settings"| node_settings
node_db_access -->|"queries"| node_postgres
node_worker -->|"checks database"| node_db_access
node_api -->|"exposes metrics"| node_prometheus
node_bank -.->|"reads data"| node_bank_api
node_bank -.->|"supplies operations"| node_categorization
node_categorization -.->|"supports limits"| node_budgets
node_budgets -.->|"triggers notices"| node_alerts
node_user -.->|"grants or revokes access"| node_bank
node_user -.->|"views spending"| node_analytics
node_user -.->|"views estimate"| node_forecast

click node_react "https://github.com/yurchyshyna/finwise/blob/main/frontend/src/main.jsx"
click node_expense_ui "https://github.com/yurchyshyna/finwise/blob/main/frontend/src/App.jsx"
click node_api "https://github.com/yurchyshyna/finwise/blob/main/backend/app/main.py"
click node_settings "https://github.com/yurchyshyna/finwise/blob/main/backend/app/config.py"
click node_db_access "https://github.com/yurchyshyna/finwise/blob/main/backend/app/db.py"
click node_worker "https://github.com/yurchyshyna/finwise/blob/main/backend/app/worker.py"

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_react,node_expense_ui,node_user toneBlue
class node_api,node_settings,node_db_access,node_postgres toneAmber
class node_bank,node_bank_api,node_categorization,node_budgets,node_alerts,node_analytics,node_forecast toneMint
class node_worker,node_prometheus toneRose
```

## Components

### User interface

- [React entry](https://github.com/yurchyshyna/finwise/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [Expense interface](https://github.com/yurchyshyna/finwise/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`

### Application services

- [FastAPI endpoints](https://github.com/yurchyshyna/finwise/blob/main/backend/app/main.py): `backend/app/main.py`
- [Environment settings](https://github.com/yurchyshyna/finwise/blob/main/backend/app/config.py): `backend/app/config.py`
- [Transaction data access](https://github.com/yurchyshyna/finwise/blob/main/backend/app/db.py): `backend/app/db.py`
- **PostgreSQL**

### Finance capabilities

- **Bank data adapter**
- **Bank API or CSV**
- **Expense categorization**
- **Category limits**
- **Limit notifications**
- **Spending statistics**
- **Balance forecast**

### Runtime operations

- [Database worker](https://github.com/yurchyshyna/finwise/blob/main/backend/app/worker.py): `backend/app/worker.py`
- **Prometheus**

### Other components

- **Finance user**

## Connections

- Finance user → Expense interface: enters expense (evidence: `frontend/src/App.jsx`)
- React entry → Expense interface: renders (evidence: `frontend/src/main.jsx`)
- Expense interface → FastAPI endpoints: requests transactions (evidence: `frontend/src/App.jsx`)
- FastAPI endpoints → Transaction data access: reads and writes (evidence: `backend/app/main.py`)
- Transaction data access → Environment settings: uses settings (evidence: `backend/app/db.py`)
- Transaction data access → PostgreSQL: queries (evidence: `backend/app/db.py`)
- Database worker → Transaction data access: checks database (evidence: `backend/app/worker.py`)
- FastAPI endpoints → Prometheus: exposes metrics (evidence: `backend/app/main.py`)
- Bank data adapter → Bank API or CSV: reads data (evidence: `README.md`)
- Bank data adapter → Expense categorization: supplies operations (evidence: `README.md`)
- Expense categorization → Category limits: supports limits (evidence: `README.md`)
- Category limits → Limit notifications: triggers notices (evidence: `README.md`)
- Finance user → Bank data adapter: grants or revokes access (evidence: `README.md`)
- Finance user → Spending statistics: views spending (evidence: `README.md`)
- Finance user → Balance forecast: views estimate (evidence: `README.md`)
