# rakesh-0402/finsight architecture

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

- Interactive diagram: https://gitdiagram.com/rakesh-0402/finsight
- Repository: https://github.com/rakesh-0402/finsight

## Overview

FinSight’s main workflow is authenticated users importing or entering transactions, then exploring dashboards, analytics, forecasts, anomalies, and planning tools. React routes requests through the Express API, which persists user-scoped records in MongoDB and calls FastAPI for machine-learning operations. The graph preserves documented features whose implementation was not sampled; those branches are shown without unsupported internal call chains. Some cross-service wiring is documented only in the README, and unsampled controller relationships are omitted.

Main entry points: [`Frontend/src/App.jsx`](https://github.com/rakesh-0402/finsight/blob/main/Frontend/src/App.jsx) (React app routes), [`Backend/server.js`](https://github.com/rakesh-0402/finsight/blob/main/Backend/server.js) (REST API router), [`AI-Service/main.py`](https://github.com/rakesh-0402/finsight/blob/main/AI-Service/main.py) (FastAPI endpoints), [`Backend/models/Transaction.js`](https://github.com/rakesh-0402/finsight/blob/main/Backend/models/Transaction.js) (MongoDB records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Finance workspace"]
  node_app["React app routes<br/>[App.jsx]"]
  node_transactions_ui["Transactions<br/>[Transactions.jsx]"]
  node_upload_ui["Statement upload<br/>[upload.jsx]"]
  node_dashboard_ui["Dashboard<br/>[Dashboard.jsx]"]
  node_analytics_ui["Analytics<br/>[Analytics.jsx]"]
  node_forecast_ui["Expense forecast<br/>[Forecast.jsx]"]
  node_anomalies_ui["Anomaly review<br/>[Anomalies.jsx]"]
  node_chat_ui["Financial assistant<br/>[Chatbot.jsx]"]
  node_money_ui["Money plan<br/>[MoneyPlan.jsx]"]
  node_profile_ui["Profile settings<br/>[Profile.jsx]"]
end

subgraph group_api["Express API"]
  node_api["REST API router<br/>[server.js]"]
  node_upload["CSV intake<br/>[uploadRoutes.js]"]
  node_transaction_ops["Transaction operations"]
  node_analytics_ops["Dashboard and insights"]
  node_forecast_ops["Forecast history"]
  node_chat_ops["Chat context<br/>[chatController.js]"]
  node_notifications["Notifications"]
end

subgraph group_data["Financial records"]
  node_records[("MongoDB records<br/>[Transaction.js]")]
end

subgraph group_intelligence["AI services"]
  node_ai_api["FastAPI endpoints<br/>[main.py]"]
  node_categorization["Categorization<br/>[categorization.py]"]
  node_cleaning["CSV cleaning<br/>[cleaning.py]"]
  node_forecasting["Forecast model<br/>[forecasting.py]"]
  node_anomaly["Anomaly detection"]
  node_llm["Groq assistant"]
end

subgraph group_planning["Planning and access"]
  node_auth["Authentication<br/>[authController.js]"]
  node_planning_ops["Budgets and goals"]
  node_email["Email service<br/>[sendEmail.js]"]
end

node_user(("Finance user"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_transactions_ui
node_app -->|"routes to"| node_upload_ui
node_app -->|"routes to"| node_dashboard_ui
node_app -->|"routes to"| node_analytics_ui
node_app -->|"routes to"| node_forecast_ui
node_app -->|"routes to"| node_anomalies_ui
node_app -->|"routes to"| node_chat_ui
node_app -->|"routes to"| node_money_ui
node_app -->|"routes to"| node_profile_ui
node_user -->|"requests"| node_api
node_api -->|"connects"| node_records
node_api -->|"mounts auth routes"| node_auth
node_api -->|"mounts upload routes"| node_upload
node_api -->|"mounts transaction routes"| node_transaction_ops
node_api -->|"mounts analytics routes"| node_analytics_ops
node_api -->|"mounts forecast routes"| node_forecast_ops
node_api -->|"mounts chat routes"| node_chat_ops
node_api -->|"mounts plan routes"| node_planning_ops
node_api -->|"mounts notification routes"| node_notifications
node_upload -->|"posts CSV"| node_ai_api
node_ai_api -->|"cleans data"| node_cleaning
node_ai_api -->|"categorizes"| node_categorization
node_transaction_ops -->|"requests categorization"| node_ai_api
node_chat_ops -->|"queries transactions"| node_records
node_chat_ops -.->|"sends prompts"| node_llm
node_forecast_ops -.->|"requests forecast"| node_ai_api
node_ai_api -->|"forecasts"| node_forecasting
node_anomalies_ui -.->|"requests anomaly review"| node_ai_api
node_ai_api -->|"detects anomalies"| node_anomaly
node_auth -->|"sends reset email"| node_email
node_planning_ops -->|"reads and writes"| node_records
node_upload -->|"stores transactions"| node_records
node_transaction_ops -->|"reads and writes"| node_records

click node_app "https://github.com/rakesh-0402/finsight/blob/main/Frontend/src/App.jsx"
click node_transactions_ui "https://github.com/rakesh-0402/finsight/blob/main/Frontend/src/pages/Transactions.jsx"
click node_upload_ui "https://github.com/rakesh-0402/finsight/blob/main/Frontend/src/pages/upload.jsx"
click node_dashboard_ui "https://github.com/rakesh-0402/finsight/blob/main/Frontend/src/pages/Dashboard.jsx"
click node_analytics_ui "https://github.com/rakesh-0402/finsight/blob/main/Frontend/src/pages/Analytics.jsx"
click node_forecast_ui "https://github.com/rakesh-0402/finsight/blob/main/Frontend/src/pages/Forecast.jsx"
click node_anomalies_ui "https://github.com/rakesh-0402/finsight/blob/main/Frontend/src/pages/Anomalies.jsx"
click node_chat_ui "https://github.com/rakesh-0402/finsight/blob/main/Frontend/src/pages/Chatbot.jsx"
click node_money_ui "https://github.com/rakesh-0402/finsight/blob/main/Frontend/src/pages/MoneyPlan.jsx"
click node_profile_ui "https://github.com/rakesh-0402/finsight/blob/main/Frontend/src/pages/Profile.jsx"
click node_api "https://github.com/rakesh-0402/finsight/blob/main/Backend/server.js"
click node_auth "https://github.com/rakesh-0402/finsight/blob/main/Backend/controllers/authController.js"
click node_upload "https://github.com/rakesh-0402/finsight/blob/main/Backend/routes/uploadRoutes.js"
click node_transaction_ops "https://github.com/rakesh-0402/finsight/blob/main/Backend/controllers/transactionController.js"
click node_analytics_ops "https://github.com/rakesh-0402/finsight/tree/main/Backend/controllers"
click node_forecast_ops "https://github.com/rakesh-0402/finsight/blob/main/Backend/controllers/forecastController.js"
click node_chat_ops "https://github.com/rakesh-0402/finsight/blob/main/Backend/controllers/chatController.js"
click node_planning_ops "https://github.com/rakesh-0402/finsight/blob/main/Backend/controllers/moneyPlanController.js"
click node_records "https://github.com/rakesh-0402/finsight/blob/main/Backend/models/Transaction.js"
click node_ai_api "https://github.com/rakesh-0402/finsight/blob/main/AI-Service/main.py"
click node_categorization "https://github.com/rakesh-0402/finsight/blob/main/AI-Service/services/categorization.py"
click node_cleaning "https://github.com/rakesh-0402/finsight/blob/main/AI-Service/services/cleaning.py"
click node_forecasting "https://github.com/rakesh-0402/finsight/blob/main/AI-Service/services/forecasting.py"
click node_anomaly "https://github.com/rakesh-0402/finsight/blob/main/AI-Service/services/anomaly_detection.py"
click node_email "https://github.com/rakesh-0402/finsight/blob/main/Backend/utils/sendEmail.js"
click node_notifications "https://github.com/rakesh-0402/finsight/blob/main/Backend/routes/notificationRoutes.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_transactions_ui,node_upload_ui,node_dashboard_ui,node_analytics_ui,node_forecast_ui,node_anomalies_ui,node_chat_ui,node_money_ui,node_profile_ui,node_user toneBlue
class node_api,node_upload,node_transaction_ops,node_analytics_ops,node_forecast_ops,node_chat_ops,node_notifications toneAmber
class node_records toneMint
class node_ai_api,node_categorization,node_cleaning,node_forecasting,node_anomaly,node_llm toneRose
class node_auth,node_planning_ops,node_email toneIndigo
```

## Components

### Finance workspace

- [React app routes](https://github.com/rakesh-0402/finsight/blob/main/Frontend/src/App.jsx): `Frontend/src/App.jsx`
- [Transactions](https://github.com/rakesh-0402/finsight/blob/main/Frontend/src/pages/Transactions.jsx): `Frontend/src/pages/Transactions.jsx`
- [Statement upload](https://github.com/rakesh-0402/finsight/blob/main/Frontend/src/pages/upload.jsx): `Frontend/src/pages/upload.jsx`
- [Dashboard](https://github.com/rakesh-0402/finsight/blob/main/Frontend/src/pages/Dashboard.jsx): `Frontend/src/pages/Dashboard.jsx`
- [Analytics](https://github.com/rakesh-0402/finsight/blob/main/Frontend/src/pages/Analytics.jsx): `Frontend/src/pages/Analytics.jsx`
- [Expense forecast](https://github.com/rakesh-0402/finsight/blob/main/Frontend/src/pages/Forecast.jsx): `Frontend/src/pages/Forecast.jsx`
- [Anomaly review](https://github.com/rakesh-0402/finsight/blob/main/Frontend/src/pages/Anomalies.jsx): `Frontend/src/pages/Anomalies.jsx`
- [Financial assistant](https://github.com/rakesh-0402/finsight/blob/main/Frontend/src/pages/Chatbot.jsx): `Frontend/src/pages/Chatbot.jsx`
- [Money plan](https://github.com/rakesh-0402/finsight/blob/main/Frontend/src/pages/MoneyPlan.jsx): `Frontend/src/pages/MoneyPlan.jsx`
- [Profile settings](https://github.com/rakesh-0402/finsight/blob/main/Frontend/src/pages/Profile.jsx): `Frontend/src/pages/Profile.jsx`

### Express API

- [REST API router](https://github.com/rakesh-0402/finsight/blob/main/Backend/server.js): `Backend/server.js`
- [CSV intake](https://github.com/rakesh-0402/finsight/blob/main/Backend/routes/uploadRoutes.js): `Backend/routes/uploadRoutes.js`
- [Transaction operations](https://github.com/rakesh-0402/finsight/blob/main/Backend/controllers/transactionController.js): `Backend/controllers/transactionController.js`
- [Dashboard and insights](https://github.com/rakesh-0402/finsight/tree/main/Backend/controllers): `Backend/controllers`
- [Forecast history](https://github.com/rakesh-0402/finsight/blob/main/Backend/controllers/forecastController.js): `Backend/controllers/forecastController.js`
- [Chat context](https://github.com/rakesh-0402/finsight/blob/main/Backend/controllers/chatController.js): `Backend/controllers/chatController.js`
- [Notifications](https://github.com/rakesh-0402/finsight/blob/main/Backend/routes/notificationRoutes.js): `Backend/routes/notificationRoutes.js`

### Financial records

- [MongoDB records](https://github.com/rakesh-0402/finsight/blob/main/Backend/models/Transaction.js): `Backend/models/Transaction.js`

### AI services

- [FastAPI endpoints](https://github.com/rakesh-0402/finsight/blob/main/AI-Service/main.py): `AI-Service/main.py`
- [Categorization](https://github.com/rakesh-0402/finsight/blob/main/AI-Service/services/categorization.py): `AI-Service/services/categorization.py`
- [CSV cleaning](https://github.com/rakesh-0402/finsight/blob/main/AI-Service/services/cleaning.py): `AI-Service/services/cleaning.py`
- [Forecast model](https://github.com/rakesh-0402/finsight/blob/main/AI-Service/services/forecasting.py): `AI-Service/services/forecasting.py`
- [Anomaly detection](https://github.com/rakesh-0402/finsight/blob/main/AI-Service/services/anomaly_detection.py): `AI-Service/services/anomaly_detection.py`
- **Groq assistant**

### Planning and access

- [Authentication](https://github.com/rakesh-0402/finsight/blob/main/Backend/controllers/authController.js): `Backend/controllers/authController.js`
- [Budgets and goals](https://github.com/rakesh-0402/finsight/blob/main/Backend/controllers/moneyPlanController.js): `Backend/controllers/moneyPlanController.js`
- [Email service](https://github.com/rakesh-0402/finsight/blob/main/Backend/utils/sendEmail.js): `Backend/utils/sendEmail.js`

### Other components

- **Finance user**

## Connections

- Finance user → React app routes: uses (evidence: `Frontend/src/App.jsx`)
- React app routes → Transactions: routes to (evidence: `Frontend/src/App.jsx`)
- React app routes → Statement upload: routes to (evidence: `Frontend/src/App.jsx`)
- React app routes → Dashboard: routes to (evidence: `Frontend/src/App.jsx`)
- React app routes → Analytics: routes to (evidence: `Frontend/src/App.jsx`)
- React app routes → Expense forecast: routes to (evidence: `Frontend/src/App.jsx`)
- React app routes → Anomaly review: routes to (evidence: `Frontend/src/App.jsx`)
- React app routes → Financial assistant: routes to (evidence: `Frontend/src/App.jsx`)
- React app routes → Money plan: routes to (evidence: `Frontend/src/App.jsx`)
- React app routes → Profile settings: routes to (evidence: `Frontend/src/App.jsx`)
- Finance user → REST API router: requests (evidence: `README.md`)
- REST API router → MongoDB records: connects (evidence: `Backend/server.js`)
- REST API router → Authentication: mounts auth routes (evidence: `Backend/server.js`)
- REST API router → CSV intake: mounts upload routes (evidence: `Backend/server.js`)
- REST API router → Transaction operations: mounts transaction routes (evidence: `Backend/server.js`)
- REST API router → Dashboard and insights: mounts analytics routes (evidence: `Backend/server.js`)
- REST API router → Forecast history: mounts forecast routes (evidence: `Backend/server.js`)
- REST API router → Chat context: mounts chat routes (evidence: `Backend/server.js`)
- REST API router → Budgets and goals: mounts plan routes (evidence: `Backend/server.js`)
- REST API router → Notifications: mounts notification routes (evidence: `Backend/server.js`)
- CSV intake → FastAPI endpoints: posts CSV (evidence: `Backend/routes/uploadRoutes.js`)
- FastAPI endpoints → CSV cleaning: cleans data (evidence: `AI-Service/main.py`)
- FastAPI endpoints → Categorization: categorizes (evidence: `AI-Service/main.py`)
- Transaction operations → FastAPI endpoints: requests categorization (evidence: `Backend/controllers/transactionController.js`)
- Chat context → MongoDB records: queries transactions (evidence: `Backend/controllers/chatController.js`)
- Chat context → Groq assistant: sends prompts
- Forecast history → FastAPI endpoints: requests forecast
- FastAPI endpoints → Forecast model: forecasts (evidence: `AI-Service/main.py`)
- Anomaly review → FastAPI endpoints: requests anomaly review
- FastAPI endpoints → Anomaly detection: detects anomalies (evidence: `AI-Service/main.py`)
- Authentication → Email service: sends reset email (evidence: `Backend/controllers/authController.js`)
- Budgets and goals → MongoDB records: reads and writes (evidence: `Backend/controllers/moneyPlanController.js`)
- CSV intake → MongoDB records: stores transactions (evidence: `Backend/routes/uploadRoutes.js`)
- Transaction operations → MongoDB records: reads and writes (evidence: `Backend/controllers/transactionController.js`)
