# vedikakute06/wealthlens architecture

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

- Interactive diagram: https://gitdiagram.com/vedikakute06/wealthlens
- Repository: https://github.com/vedikakute06/wealthlens

## Overview

WealthLens is a personal-finance web application: users sign in, record or upload transactions, then review budgeting, financial-health, goals, and planning insights. The React application routes authenticated users to feature pages, which use a shared API client to call a FastAPI backend; the backend registers feature routers and uses MongoDB-backed services. The README confirms the React, FastAPI, and MongoDB stack. Several domain modules are listed but not excerpted, so their internal call paths are not asserted here.

Main entry points: [`backend/app/main.py`](https://github.com/vedikakute06/wealthlens/blob/main/backend/app/main.py) (FastAPI application), [`frontend/src/services/api.js`](https://github.com/vedikakute06/wealthlens/blob/main/frontend/src/services/api.js) (HTTP API client), [`frontend/src/App.jsx`](https://github.com/vedikakute06/wealthlens/blob/main/frontend/src/App.jsx) (Route application), [`backend/app/services/upload_service.py`](https://github.com/vedikakute06/wealthlens/blob/main/backend/app/services/upload_service.py) (Transaction import)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["Route application<br/>[App.jsx]"]
  node_auth["Auth state<br/>[AuthContext.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_budget_ui["Budget insights<br/>[BudgetInsights.jsx]"]
  node_planning_ui["Finance planning pages"]
  node_api["HTTP API client<br/>[api.js]"]
end

subgraph group_backend["Backend API"]
  node_server["FastAPI application<br/>[main.py]"]
  node_transactions_route["Transaction routes<br/>[transactions.py]"]
  node_upload_route["CSV upload route<br/>[upload_routes.py]"]
  node_budget_route["Budget routes<br/>[budget.py]"]
  node_finance_route["Finance routes<br/>[finance.py]"]
  node_feature_routes["Planning and insight routes"]
  node_user_route["User routes<br/>[user.py]"]
end

subgraph group_domain["Finance services"]
  node_upload_service["Transaction import<br/>[upload_service.py]"]
  node_finance_service["Finance summary<br/>[finance_service.py]"]
  node_planning_services["Planning services"]
  node_insight_services["Insights and risk"]
  node_prediction["ML prediction<br/>[prediction.py]"]
  node_behavior_prediction["Behavior prediction"]
end

subgraph group_data["Data and prediction"]
  node_database[("MongoDB access<br/>[database.py]")]
  node_schemas["Request and response schemas"]
end

node_user(("User"))
node_mongo[("MongoDB")]

node_user -->|"uses"| node_app
node_app -->|"checks access"| node_auth
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_budget_ui
node_app -->|"routes to"| node_planning_ui
node_dashboard -->|"requests data"| node_api
node_budget_ui -->|"loads and saves"| node_api
node_api -->|"HTTP requests"| node_transactions_route
node_api -->|"HTTP upload"| node_upload_route
node_api -->|"HTTP requests"| node_budget_route
node_api -->|"HTTP requests"| node_user_route
node_server -->|"registers"| node_transactions_route
node_server -->|"registers"| node_upload_route
node_server -->|"registers"| node_budget_route
node_server -->|"registers"| node_finance_route
node_server -->|"registers"| node_feature_routes
node_server -->|"registers"| node_user_route
node_upload_route -->|"invokes"| node_upload_service
node_finance_service -->|"reads and writes"| node_database
node_upload_service -->|"uses"| node_database
node_database -->|"connects to"| node_mongo
node_finance_service -->|"uses response schema"| node_schemas
node_upload_service -->|"uses schemas"| node_schemas

click node_app "https://github.com/vedikakute06/wealthlens/blob/main/frontend/src/App.jsx"
click node_auth "https://github.com/vedikakute06/wealthlens/blob/main/frontend/src/context/AuthContext.jsx"
click node_dashboard "https://github.com/vedikakute06/wealthlens/blob/main/frontend/src/pages/Dashboard.jsx"
click node_budget_ui "https://github.com/vedikakute06/wealthlens/blob/main/frontend/src/pages/BudgetInsights.jsx"
click node_planning_ui "https://github.com/vedikakute06/wealthlens/tree/main/frontend/src/pages"
click node_api "https://github.com/vedikakute06/wealthlens/blob/main/frontend/src/services/api.js"
click node_server "https://github.com/vedikakute06/wealthlens/blob/main/backend/app/main.py"
click node_transactions_route "https://github.com/vedikakute06/wealthlens/blob/main/backend/app/routes/transactions.py"
click node_upload_route "https://github.com/vedikakute06/wealthlens/blob/main/backend/app/routes/upload_routes.py"
click node_budget_route "https://github.com/vedikakute06/wealthlens/blob/main/backend/app/routes/budget.py"
click node_finance_route "https://github.com/vedikakute06/wealthlens/blob/main/backend/app/routes/finance.py"
click node_feature_routes "https://github.com/vedikakute06/wealthlens/tree/main/backend/app/routes"
click node_user_route "https://github.com/vedikakute06/wealthlens/blob/main/backend/app/routes/user.py"
click node_upload_service "https://github.com/vedikakute06/wealthlens/blob/main/backend/app/services/upload_service.py"
click node_finance_service "https://github.com/vedikakute06/wealthlens/blob/main/backend/app/services/finance_service.py"
click node_planning_services "https://github.com/vedikakute06/wealthlens/tree/main/backend/app/services"
click node_insight_services "https://github.com/vedikakute06/wealthlens/tree/main/backend/app/services"
click node_prediction "https://github.com/vedikakute06/wealthlens/blob/main/backend/app/ml/prediction.py"
click node_behavior_prediction "https://github.com/vedikakute06/wealthlens/blob/main/backend/app/ml/behavior_prediction.py"
click node_database "https://github.com/vedikakute06/wealthlens/blob/main/backend/app/database.py"
click node_schemas "https://github.com/vedikakute06/wealthlens/tree/main/backend/app/schemas"

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_auth,node_dashboard,node_budget_ui,node_planning_ui,node_api,node_user toneBlue
class node_server,node_transactions_route,node_upload_route,node_budget_route,node_finance_route,node_feature_routes,node_user_route,node_mongo toneAmber
class node_upload_service,node_finance_service,node_planning_services,node_insight_services,node_prediction,node_behavior_prediction toneMint
class node_database,node_schemas toneRose
```

## Components

### Web application

- [Route application](https://github.com/vedikakute06/wealthlens/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Auth state](https://github.com/vedikakute06/wealthlens/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Dashboard](https://github.com/vedikakute06/wealthlens/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Budget insights](https://github.com/vedikakute06/wealthlens/blob/main/frontend/src/pages/BudgetInsights.jsx): `frontend/src/pages/BudgetInsights.jsx`
- [Finance planning pages](https://github.com/vedikakute06/wealthlens/tree/main/frontend/src/pages): `frontend/src/pages`
- [HTTP API client](https://github.com/vedikakute06/wealthlens/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Backend API

- [FastAPI application](https://github.com/vedikakute06/wealthlens/blob/main/backend/app/main.py): `backend/app/main.py`
- [Transaction routes](https://github.com/vedikakute06/wealthlens/blob/main/backend/app/routes/transactions.py): `backend/app/routes/transactions.py`
- [CSV upload route](https://github.com/vedikakute06/wealthlens/blob/main/backend/app/routes/upload_routes.py): `backend/app/routes/upload_routes.py`
- [Budget routes](https://github.com/vedikakute06/wealthlens/blob/main/backend/app/routes/budget.py): `backend/app/routes/budget.py`
- [Finance routes](https://github.com/vedikakute06/wealthlens/blob/main/backend/app/routes/finance.py): `backend/app/routes/finance.py`
- [Planning and insight routes](https://github.com/vedikakute06/wealthlens/tree/main/backend/app/routes): `backend/app/routes`
- [User routes](https://github.com/vedikakute06/wealthlens/blob/main/backend/app/routes/user.py): `backend/app/routes/user.py`

### Finance services

- [Transaction import](https://github.com/vedikakute06/wealthlens/blob/main/backend/app/services/upload_service.py): `backend/app/services/upload_service.py`
- [Finance summary](https://github.com/vedikakute06/wealthlens/blob/main/backend/app/services/finance_service.py): `backend/app/services/finance_service.py`
- [Planning services](https://github.com/vedikakute06/wealthlens/tree/main/backend/app/services): `backend/app/services`
- [Insights and risk](https://github.com/vedikakute06/wealthlens/tree/main/backend/app/services): `backend/app/services`
- [ML prediction](https://github.com/vedikakute06/wealthlens/blob/main/backend/app/ml/prediction.py): `backend/app/ml/prediction.py`
- [Behavior prediction](https://github.com/vedikakute06/wealthlens/blob/main/backend/app/ml/behavior_prediction.py): `backend/app/ml/behavior_prediction.py`

### Data and prediction

- [MongoDB access](https://github.com/vedikakute06/wealthlens/blob/main/backend/app/database.py): `backend/app/database.py`
- [Request and response schemas](https://github.com/vedikakute06/wealthlens/tree/main/backend/app/schemas): `backend/app/schemas`

### Other components

- **User**
- **MongoDB**

## Connections

- User → Route application: uses (evidence: `frontend/src/App.jsx`)
- Route application → Auth state: checks access (evidence: `frontend/src/App.jsx`)
- Route application → Dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Budget insights: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Finance planning pages: routes to (evidence: `frontend/src/App.jsx`)
- Dashboard → HTTP API client: requests data (evidence: `frontend/src/pages/Dashboard.jsx`)
- Budget insights → HTTP API client: loads and saves (evidence: `frontend/src/pages/BudgetInsights.jsx`)
- HTTP API client → Transaction routes: HTTP requests (evidence: `frontend/src/services/api.js`)
- HTTP API client → CSV upload route: HTTP upload (evidence: `frontend/src/services/api.js`)
- HTTP API client → Budget routes: HTTP requests (evidence: `frontend/src/services/api.js`)
- HTTP API client → User routes: HTTP requests (evidence: `frontend/src/services/api.js`)
- FastAPI application → Transaction routes: registers (evidence: `backend/app/main.py`)
- FastAPI application → CSV upload route: registers (evidence: `backend/app/main.py`)
- FastAPI application → Budget routes: registers (evidence: `backend/app/main.py`)
- FastAPI application → Finance routes: registers (evidence: `backend/app/main.py`)
- FastAPI application → Planning and insight routes: registers (evidence: `backend/app/main.py`)
- FastAPI application → User routes: registers (evidence: `backend/app/main.py`)
- CSV upload route → Transaction import: invokes (evidence: `backend/app/routes/upload_routes.py`)
- Finance summary → MongoDB access: reads and writes (evidence: `backend/app/services/finance_service.py`)
- Transaction import → MongoDB access: uses (evidence: `backend/app/services/upload_service.py`)
- MongoDB access → MongoDB: connects to (evidence: `backend/app/database.py`)
- Finance summary → Request and response schemas: uses response schema (evidence: `backend/app/services/finance_service.py`)
- Transaction import → Request and response schemas: uses schemas (evidence: `backend/app/services/upload_service.py`)
