# harshbhanushali26/finos architecture

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

- Interactive diagram: https://gitdiagram.com/harshbhanushali26/finos
- Repository: https://github.com/harshbhanushali26/finos

## Overview

FinOS is a personal-finance web application with two independent interaction paths: a visual dashboard and a conversational agent. Dashboard actions reach API capabilities directly; chat routes through session state and pattern matching before falling back to the LLM and its tools. Both paths operate on shared finance data. The README documents analytics, budgets, insights, forecasting, health scoring, and export. Some of those implementations were not sampled, so their internal links are omitted; documented product relationships are cited to the README.

Main entry points: [`api/main.py`](https://github.com/harshbhanushali26/finos/blob/main/api/main.py) (FastAPI application), [`core/models.py`](https://github.com/harshbhanushali26/finos/blob/main/core/models.py) (Finance data models), [`core/services.py`](https://github.com/harshbhanushali26/finos/blob/main/core/services.py) (Transaction services), [`agent/orchestrator.py`](https://github.com/harshbhanushali26/finos/blob/main/agent/orchestrator.py) (Message orchestrator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_frontend["Web dashboard<br/>[app.js]"]
end

subgraph group_api["API capabilities"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_auth_routes["Authentication<br/>[auth.py]"]
  node_transaction_routes["Transactions<br/>[transactions.py]"]
  node_category_routes["Categories<br/>[categories.py]"]
  node_payment_routes["Payment methods<br/>[payment_methods.py]"]
  node_analytics_routes["Analytics<br/>[analytics.py]"]
  node_budget_routes["Budget tracking<br/>[budget.py]"]
  node_insights_routes["Financial insights<br/>[insights.py]"]
  node_export_routes["Transaction export<br/>[export.py]"]
  node_chat_routes["Chat endpoint<br/>[chat.py]"]
end

subgraph group_agent["Conversational agent"]
  node_agent_session["Agent session state<br/>[session.py]"]
  node_orchestrator["Message orchestrator<br/>[orchestrator.py]"]
  node_pattern_matcher["Pattern matching<br/>[pattern_matcher.py]"]
  node_llm["LLM and classifier<br/>[llm.py]"]
  node_tool_registry["Tool registry<br/>[registry.py]"]
  node_tool_transactions["Transaction tools"]
  node_tool_analytics["Analytics tools<br/>[tool_analytics.py]"]
  node_tool_budget["Budget tools<br/>[tool_budget.py]"]
end

subgraph group_domain["Finance and persistence"]
  node_services["Transaction services<br/>[services.py]"]
  node_shared_analytics["Aggregate queries"]
  node_shared_budget["Budget operations<br/>[shared_budget.py]"]
  node_shared_txns["Transaction queries<br/>[shared_txns.py]"]
  node_models["Finance data models<br/>[models.py]"]
  node_database[("SQLite database<br/>[database.py]")]
  node_auth_core["Auth and sessions<br/>[auth.py]"]
end

node_user(("Finance user"))

node_user -->|"uses dashboard"| node_frontend
node_frontend -->|"submits actions"| node_api_app
node_api_app -->|"registers routes"| node_auth_routes
node_api_app -->|"registers routes"| node_transaction_routes
node_api_app -->|"registers routes"| node_category_routes
node_api_app -->|"registers routes"| node_payment_routes
node_api_app -->|"registers routes"| node_analytics_routes
node_api_app -->|"registers routes"| node_budget_routes
node_api_app -->|"registers routes"| node_insights_routes
node_api_app -->|"registers routes"| node_export_routes
node_api_app -->|"registers routes"| node_chat_routes
node_user -->|"sends messages"| node_chat_routes
node_chat_routes -->|"routes messages"| node_orchestrator
node_orchestrator -->|"checks state"| node_agent_session
node_orchestrator -->|"tries patterns"| node_pattern_matcher
node_orchestrator -->|"falls back"| node_llm
node_llm -->|"loads tools"| node_tool_registry
node_tool_registry -->|"registers tools"| node_tool_transactions
node_tool_registry -->|"registers tools"| node_tool_analytics
node_tool_registry -->|"registers tools"| node_tool_budget
node_orchestrator -->|"executes confirmations"| node_services
node_transaction_routes -->|"handles transactions"| node_services
node_tool_transactions -->|"uses services"| node_services
node_pattern_matcher -->|"queries transactions"| node_services
node_services -->|"uses query helpers"| node_shared_txns
node_analytics_routes -->|"queries aggregates"| node_shared_analytics
node_tool_analytics -->|"queries aggregates"| node_shared_analytics
node_budget_routes -->|"uses budget logic"| node_shared_budget
node_tool_budget -->|"uses budget logic"| node_shared_budget
node_tool_budget -->|"queries aggregates"| node_shared_analytics
node_insights_routes -.->|"serves insights"| node_agent_session
node_insights_routes -.->|"derives insights"| node_shared_analytics
node_transaction_routes -->|"writes transactions"| node_database
node_services -.->|"persists changes"| node_database
node_database -->|"creates tables"| node_models
node_auth_routes -->|"creates credentials"| node_auth_core
node_auth_core -->|"stores sessions"| node_models
node_analytics_routes -->|"reads finance data"| node_models
node_budget_routes -->|"reads budget data"| node_models
node_category_routes -->|"manages categories"| node_models
node_payment_routes -->|"manages methods"| node_models
node_export_routes -->|"exports transactions"| node_models
node_user -->|"views analytics"| node_analytics_routes
node_user -->|"sets limits"| node_budget_routes
node_user -->|"views insights"| node_insights_routes
node_user -->|"downloads data"| node_export_routes

click node_frontend "https://github.com/harshbhanushali26/finos/blob/main/frontend/app.js"
click node_api_app "https://github.com/harshbhanushali26/finos/blob/main/api/main.py"
click node_auth_routes "https://github.com/harshbhanushali26/finos/blob/main/api/routes/auth.py"
click node_transaction_routes "https://github.com/harshbhanushali26/finos/blob/main/api/routes/transactions.py"
click node_category_routes "https://github.com/harshbhanushali26/finos/blob/main/api/routes/categories.py"
click node_payment_routes "https://github.com/harshbhanushali26/finos/blob/main/api/routes/payment_methods.py"
click node_analytics_routes "https://github.com/harshbhanushali26/finos/blob/main/api/routes/analytics.py"
click node_budget_routes "https://github.com/harshbhanushali26/finos/blob/main/api/routes/budget.py"
click node_insights_routes "https://github.com/harshbhanushali26/finos/blob/main/api/routes/insights.py"
click node_export_routes "https://github.com/harshbhanushali26/finos/blob/main/api/routes/export.py"
click node_chat_routes "https://github.com/harshbhanushali26/finos/blob/main/api/routes/chat.py"
click node_agent_session "https://github.com/harshbhanushali26/finos/blob/main/agent/session.py"
click node_orchestrator "https://github.com/harshbhanushali26/finos/blob/main/agent/orchestrator.py"
click node_pattern_matcher "https://github.com/harshbhanushali26/finos/blob/main/agent/pattern_matcher.py"
click node_llm "https://github.com/harshbhanushali26/finos/blob/main/agent/llm.py"
click node_tool_registry "https://github.com/harshbhanushali26/finos/blob/main/tools/registry.py"
click node_tool_transactions "https://github.com/harshbhanushali26/finos/blob/main/tools/tool_transactions.py"
click node_tool_analytics "https://github.com/harshbhanushali26/finos/blob/main/tools/tool_analytics.py"
click node_tool_budget "https://github.com/harshbhanushali26/finos/blob/main/tools/tool_budget.py"
click node_services "https://github.com/harshbhanushali26/finos/blob/main/core/services.py"
click node_shared_analytics "https://github.com/harshbhanushali26/finos/blob/main/core/shared_analytics.py"
click node_shared_budget "https://github.com/harshbhanushali26/finos/blob/main/core/shared_budget.py"
click node_shared_txns "https://github.com/harshbhanushali26/finos/blob/main/core/shared_txns.py"
click node_models "https://github.com/harshbhanushali26/finos/blob/main/core/models.py"
click node_database "https://github.com/harshbhanushali26/finos/blob/main/core/database.py"
click node_auth_core "https://github.com/harshbhanushali26/finos/blob/main/core/auth.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_frontend,node_user toneBlue
class node_api_app,node_auth_routes,node_transaction_routes,node_category_routes,node_payment_routes,node_analytics_routes,node_budget_routes,node_insights_routes,node_export_routes,node_chat_routes toneAmber
class node_agent_session,node_orchestrator,node_pattern_matcher,node_llm,node_tool_registry,node_tool_transactions,node_tool_analytics,node_tool_budget toneMint
class node_services,node_shared_analytics,node_shared_budget,node_shared_txns,node_models,node_database,node_auth_core toneRose
```

## Components

### User experience

- [Web dashboard](https://github.com/harshbhanushali26/finos/blob/main/frontend/app.js): `frontend/app.js`

### API capabilities

- [FastAPI application](https://github.com/harshbhanushali26/finos/blob/main/api/main.py): `api/main.py`
- [Authentication](https://github.com/harshbhanushali26/finos/blob/main/api/routes/auth.py): `api/routes/auth.py`
- [Transactions](https://github.com/harshbhanushali26/finos/blob/main/api/routes/transactions.py): `api/routes/transactions.py`
- [Categories](https://github.com/harshbhanushali26/finos/blob/main/api/routes/categories.py): `api/routes/categories.py`
- [Payment methods](https://github.com/harshbhanushali26/finos/blob/main/api/routes/payment_methods.py): `api/routes/payment_methods.py`
- [Analytics](https://github.com/harshbhanushali26/finos/blob/main/api/routes/analytics.py): `api/routes/analytics.py`
- [Budget tracking](https://github.com/harshbhanushali26/finos/blob/main/api/routes/budget.py): `api/routes/budget.py`
- [Financial insights](https://github.com/harshbhanushali26/finos/blob/main/api/routes/insights.py): `api/routes/insights.py`
- [Transaction export](https://github.com/harshbhanushali26/finos/blob/main/api/routes/export.py): `api/routes/export.py`
- [Chat endpoint](https://github.com/harshbhanushali26/finos/blob/main/api/routes/chat.py): `api/routes/chat.py`

### Conversational agent

- [Agent session state](https://github.com/harshbhanushali26/finos/blob/main/agent/session.py): `agent/session.py`
- [Message orchestrator](https://github.com/harshbhanushali26/finos/blob/main/agent/orchestrator.py): `agent/orchestrator.py`
- [Pattern matching](https://github.com/harshbhanushali26/finos/blob/main/agent/pattern_matcher.py): `agent/pattern_matcher.py`
- [LLM and classifier](https://github.com/harshbhanushali26/finos/blob/main/agent/llm.py): `agent/llm.py`
- [Tool registry](https://github.com/harshbhanushali26/finos/blob/main/tools/registry.py): `tools/registry.py`
- [Transaction tools](https://github.com/harshbhanushali26/finos/blob/main/tools/tool_transactions.py): `tools/tool_transactions.py`
- [Analytics tools](https://github.com/harshbhanushali26/finos/blob/main/tools/tool_analytics.py): `tools/tool_analytics.py`
- [Budget tools](https://github.com/harshbhanushali26/finos/blob/main/tools/tool_budget.py): `tools/tool_budget.py`

### Finance and persistence

- [Transaction services](https://github.com/harshbhanushali26/finos/blob/main/core/services.py): `core/services.py`
- [Aggregate queries](https://github.com/harshbhanushali26/finos/blob/main/core/shared_analytics.py): `core/shared_analytics.py`
- [Budget operations](https://github.com/harshbhanushali26/finos/blob/main/core/shared_budget.py): `core/shared_budget.py`
- [Transaction queries](https://github.com/harshbhanushali26/finos/blob/main/core/shared_txns.py): `core/shared_txns.py`
- [Finance data models](https://github.com/harshbhanushali26/finos/blob/main/core/models.py): `core/models.py`
- [SQLite database](https://github.com/harshbhanushali26/finos/blob/main/core/database.py): `core/database.py`
- [Auth and sessions](https://github.com/harshbhanushali26/finos/blob/main/core/auth.py): `core/auth.py`

### Other components

- **Finance user**

## Connections

- Finance user → Web dashboard: uses dashboard (evidence: `README.md`)
- Web dashboard → FastAPI application: submits actions (evidence: `README.md`)
- FastAPI application → Authentication: registers routes (evidence: `api/main.py`)
- FastAPI application → Transactions: registers routes (evidence: `api/main.py`)
- FastAPI application → Categories: registers routes (evidence: `api/main.py`)
- FastAPI application → Payment methods: registers routes (evidence: `api/main.py`)
- FastAPI application → Analytics: registers routes (evidence: `api/main.py`)
- FastAPI application → Budget tracking: registers routes (evidence: `api/main.py`)
- FastAPI application → Financial insights: registers routes (evidence: `api/main.py`)
- FastAPI application → Transaction export: registers routes (evidence: `api/main.py`)
- FastAPI application → Chat endpoint: registers routes (evidence: `api/main.py`)
- Finance user → Chat endpoint: sends messages (evidence: `README.md`)
- Chat endpoint → Message orchestrator: routes messages (evidence: `api/routes/chat.py`)
- Message orchestrator → Agent session state: checks state (evidence: `agent/orchestrator.py`)
- Message orchestrator → Pattern matching: tries patterns (evidence: `agent/orchestrator.py`)
- Message orchestrator → LLM and classifier: falls back (evidence: `agent/orchestrator.py`)
- LLM and classifier → Tool registry: loads tools (evidence: `agent/llm.py`)
- Tool registry → Transaction tools: registers tools (evidence: `tools/registry.py`)
- Tool registry → Analytics tools: registers tools (evidence: `tools/registry.py`)
- Tool registry → Budget tools: registers tools (evidence: `tools/registry.py`)
- Message orchestrator → Transaction services: executes confirmations (evidence: `agent/orchestrator.py`)
- Transactions → Transaction services: handles transactions (evidence: `README.md`)
- Transaction tools → Transaction services: uses services (evidence: `tools/tool_transactions.py`)
- Pattern matching → Transaction services: queries transactions (evidence: `agent/pattern_matcher.py`)
- Transaction services → Transaction queries: uses query helpers (evidence: `core/services.py`)
- Analytics → Aggregate queries: queries aggregates (evidence: `api/routes/analytics.py`)
- Analytics tools → Aggregate queries: queries aggregates (evidence: `tools/tool_analytics.py`)
- Budget tracking → Budget operations: uses budget logic (evidence: `api/routes/budget.py`)
- Budget tools → Budget operations: uses budget logic (evidence: `tools/tool_budget.py`)
- Budget tools → Aggregate queries: queries aggregates (evidence: `tools/tool_budget.py`)
- Financial insights → Agent session state: serves insights
- Financial insights → Aggregate queries: derives insights
- Transactions → SQLite database: writes transactions (evidence: `README.md`)
- Transaction services → SQLite database: persists changes
- SQLite database → Finance data models: creates tables (evidence: `core/database.py`)
- Authentication → Auth and sessions: creates credentials (evidence: `api/routes/auth.py`)
- Auth and sessions → Finance data models: stores sessions (evidence: `core/auth.py`)
- Analytics → Finance data models: reads finance data (evidence: `api/routes/analytics.py`)
- Budget tracking → Finance data models: reads budget data (evidence: `api/routes/budget.py`)
- Categories → Finance data models: manages categories (evidence: `api/routes/categories.py`)
- Payment methods → Finance data models: manages methods (evidence: `api/routes/payment_methods.py`)
- Transaction export → Finance data models: exports transactions (evidence: `api/routes/export.py`)
- Finance user → Analytics: views analytics (evidence: `README.md`)
- Finance user → Budget tracking: sets limits (evidence: `README.md`)
- Finance user → Financial insights: views insights (evidence: `README.md`)
- Finance user → Transaction export: downloads data (evidence: `README.md`)
