# darshanmgowda636337-collab/smartspend architecture

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

- Interactive diagram: https://gitdiagram.com/darshanmgowda636337-collab/smartspend
- Repository: https://github.com/darshanmgowda636337-collab/smartspend

## Overview

SmartSpend combines a browser-based personal-finance dashboard with a small Express health API and standalone Python finance-analysis tools. The principal user workflow is to open the dashboard, work with transaction and budget data, and review filtered views and charts; the app also imports a provided workbook and saves data in browser storage. The Python tools cover classification, prediction, spending analysis, financial health, savings, and budget recommendations, but sampled evidence does not show them wired to the UI or API. The backend excerpts show health endpoints only.

Main entry points: [`frontend/src/App.jsx`](https://github.com/darshanmgowda636337-collab/smartspend/blob/main/frontend/src/App.jsx) (Finance dashboard), [`ai_engine/financial_score.py`](https://github.com/darshanmgowda636337-collab/smartspend/blob/main/ai_engine/financial_score.py) (Financial health score), [`ai_engine/budget_recommendation.py`](https://github.com/darshanmgowda636337-collab/smartspend/blob/main/ai_engine/budget_recommendation.py) (Budget recommendations), [`frontend/src/main.jsx`](https://github.com/darshanmgowda636337-collab/smartspend/blob/main/frontend/src/main.jsx) (React entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Finance dashboard"]
  node_app_entry["React entry<br/>[main.jsx]"]
  node_dashboard["Finance dashboard<br/>[App.jsx]"]
  node_workbook["Transaction workbook"]
  node_browser_store[("Browser storage")]
end

subgraph group_api["Health API"]
  node_health_server["Express server<br/>[server.js]"]
  node_health_routes["Health routes<br/>[healthRoutes.js]"]
  node_health_controller["Health controller"]
end

subgraph group_ai["Finance analysis"]
  node_classifier["Expense classifier"]
  node_classifier_model["Classifier model"]
  node_prediction["Expense prediction"]
  node_spending["Spending analysis"]
  node_financial_score["Financial health score<br/>[financial_score.py]"]
  node_income_data["Income records<br/>[income_data.csv]"]
  node_cleaned_expenses["Cleaned expenses"]
  node_savings["Savings recommendations"]
  node_budget["Budget recommendations"]
  node_budget_output["Budget output"]
end

node_user(("User"))

node_user -->|"opens"| node_app_entry
node_app_entry -->|"renders"| node_dashboard
node_dashboard -->|"loads data"| node_workbook
node_dashboard -->|"reads and saves"| node_browser_store
node_health_server -->|"mounts routes"| node_health_routes
node_health_routes -->|"dispatches"| node_health_controller
node_classifier -->|"loads model"| node_classifier_model
node_financial_score -->|"reads"| node_income_data
node_financial_score -->|"reads"| node_cleaned_expenses
node_budget -->|"reads"| node_cleaned_expenses
node_budget -->|"writes"| node_budget_output

click node_app_entry "https://github.com/darshanmgowda636337-collab/smartspend/blob/main/frontend/src/main.jsx"
click node_dashboard "https://github.com/darshanmgowda636337-collab/smartspend/blob/main/frontend/src/App.jsx"
click node_workbook "https://github.com/darshanmgowda636337-collab/smartspend/blob/main/frontend/data/personal_transactions_dashboard_ready.xlsx"
click node_health_server "https://github.com/darshanmgowda636337-collab/smartspend/blob/main/backend/server.js"
click node_health_routes "https://github.com/darshanmgowda636337-collab/smartspend/blob/main/backend/routes/healthRoutes.js"
click node_health_controller "https://github.com/darshanmgowda636337-collab/smartspend/blob/main/backend/controllers/healthController.js"
click node_classifier "https://github.com/darshanmgowda636337-collab/smartspend/blob/main/ai_engine/expense_classifier.py"
click node_classifier_model "https://github.com/darshanmgowda636337-collab/smartspend/blob/main/ai_engine/models/expense_classifier_v2.pkl"
click node_prediction "https://github.com/darshanmgowda636337-collab/smartspend/blob/main/ai_engine/expense_prediction.py"
click node_spending "https://github.com/darshanmgowda636337-collab/smartspend/blob/main/ai_engine/spending_analysis.py"
click node_financial_score "https://github.com/darshanmgowda636337-collab/smartspend/blob/main/ai_engine/financial_score.py"
click node_income_data "https://github.com/darshanmgowda636337-collab/smartspend/blob/main/ai_engine/data/income_data.csv"
click node_cleaned_expenses "https://github.com/darshanmgowda636337-collab/smartspend/blob/main/ai_engine/data/cleaned_expenses.csv"
click node_savings "https://github.com/darshanmgowda636337-collab/smartspend/blob/main/ai_engine/savings_recommendation.py"
click node_budget "https://github.com/darshanmgowda636337-collab/smartspend/blob/main/ai_engine/budget_recommendation.py"
click node_budget_output "https://github.com/darshanmgowda636337-collab/smartspend/blob/main/ai_engine/budget_recommendations.csv"

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_entry,node_dashboard,node_workbook,node_browser_store,node_user toneBlue
class node_health_server,node_health_routes,node_health_controller toneAmber
class node_classifier,node_classifier_model,node_prediction,node_spending,node_financial_score,node_income_data,node_cleaned_expenses,node_savings,node_budget,node_budget_output toneMint
```

## Components

### Finance dashboard

- [React entry](https://github.com/darshanmgowda636337-collab/smartspend/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [Finance dashboard](https://github.com/darshanmgowda636337-collab/smartspend/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Transaction workbook](https://github.com/darshanmgowda636337-collab/smartspend/blob/main/frontend/data/personal_transactions_dashboard_ready.xlsx): `frontend/data/personal_transactions_dashboard_ready.xlsx`
- **Browser storage**

### Health API

- [Express server](https://github.com/darshanmgowda636337-collab/smartspend/blob/main/backend/server.js): `backend/server.js`
- [Health routes](https://github.com/darshanmgowda636337-collab/smartspend/blob/main/backend/routes/healthRoutes.js): `backend/routes/healthRoutes.js`
- [Health controller](https://github.com/darshanmgowda636337-collab/smartspend/blob/main/backend/controllers/healthController.js): `backend/controllers/healthController.js`

### Finance analysis

- [Expense classifier](https://github.com/darshanmgowda636337-collab/smartspend/blob/main/ai_engine/expense_classifier.py): `ai_engine/expense_classifier.py`
- [Classifier model](https://github.com/darshanmgowda636337-collab/smartspend/blob/main/ai_engine/models/expense_classifier_v2.pkl): `ai_engine/models/expense_classifier_v2.pkl`
- [Expense prediction](https://github.com/darshanmgowda636337-collab/smartspend/blob/main/ai_engine/expense_prediction.py): `ai_engine/expense_prediction.py`
- [Spending analysis](https://github.com/darshanmgowda636337-collab/smartspend/blob/main/ai_engine/spending_analysis.py): `ai_engine/spending_analysis.py`
- [Financial health score](https://github.com/darshanmgowda636337-collab/smartspend/blob/main/ai_engine/financial_score.py): `ai_engine/financial_score.py`
- [Income records](https://github.com/darshanmgowda636337-collab/smartspend/blob/main/ai_engine/data/income_data.csv): `ai_engine/data/income_data.csv`
- [Cleaned expenses](https://github.com/darshanmgowda636337-collab/smartspend/blob/main/ai_engine/data/cleaned_expenses.csv): `ai_engine/data/cleaned_expenses.csv`
- [Savings recommendations](https://github.com/darshanmgowda636337-collab/smartspend/blob/main/ai_engine/savings_recommendation.py): `ai_engine/savings_recommendation.py`
- [Budget recommendations](https://github.com/darshanmgowda636337-collab/smartspend/blob/main/ai_engine/budget_recommendation.py): `ai_engine/budget_recommendation.py`
- [Budget output](https://github.com/darshanmgowda636337-collab/smartspend/blob/main/ai_engine/budget_recommendations.csv): `ai_engine/budget_recommendations.csv`

### Other components

- **User**

## Connections

- User → React entry: opens (evidence: `frontend/src/main.jsx`)
- React entry → Finance dashboard: renders (evidence: `frontend/src/main.jsx`)
- Finance dashboard → Transaction workbook: loads data (evidence: `frontend/src/App.jsx`)
- Finance dashboard → Browser storage: reads and saves (evidence: `frontend/src/App.jsx`)
- Express server → Health routes: mounts routes (evidence: `backend/server.js`)
- Health routes → Health controller: dispatches (evidence: `backend/routes/healthRoutes.js`)
- Expense classifier → Classifier model: loads model (evidence: `ai_engine/expense_classifier.py`)
- Financial health score → Income records: reads (evidence: `ai_engine/financial_score.py`)
- Financial health score → Cleaned expenses: reads (evidence: `ai_engine/financial_score.py`)
- Budget recommendations → Cleaned expenses: reads (evidence: `ai_engine/budget_recommendation.py`)
- Budget recommendations → Budget output: writes (evidence: `ai_engine/budget_recommendation.py`)
