# komalsuniltayde/smart-finance-advisor- architecture

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

- Interactive diagram: https://gitdiagram.com/komalsuniltayde/smart-finance-advisor-
- Repository: https://github.com/komalsuniltayde/smart-finance-advisor-

## Overview

FinanceAI is a web-based personal-finance advisor: users authenticate, record transactions, manage budgets, and view analytics and AI-assisted spending guidance; administrators also review platform activity and send budget alerts. The React app calls an Express API backed by a database, with a separate Python ML service documented as an Express integration. Several route and page implementations were not sampled, so their internal call chains are not inferred; links below reflect visible routing, requests, and explicit integration evidence.

Main entry points: [`smart-finance-advisory/src/App.jsx`](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-advisory/src/App.jsx) (React application), [`smart-finance-backend/server.js`](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/server.js) (Express API server), [`smart-finance-advisory/src/context/FinanceContext.jsx`](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-advisory/src/context/FinanceContext.jsx) (Finance state and API), [`smart-finance-backend/routes/auth.js`](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/routes/auth.js) (Authentication routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["React application<br/>[App.jsx]"]
  node_authctx["Authentication state<br/>[AuthContext.jsx]"]
  node_financectx["Finance state and API<br/>[FinanceContext.jsx]"]
  node_login["Login and registration<br/>[Login.jsx]"]
  node_dashboard["Finance dashboard<br/>[Dashboard.jsx]"]
  node_transactions["Transaction management<br/>[Transaction.jsx]"]
  node_analytics["Analytics views<br/>[Analytics.jsx]"]
  node_budget["Budget management<br/>[Budget.jsx]"]
  node_advisor["AI advisor<br/>[Advisor.jsx]"]
  node_adminui["Admin console<br/>[Admin.jsx]"]
end

subgraph group_api["Finance API"]
  node_server["Express API server<br/>[server.js]"]
  node_authroute["Authentication routes<br/>[auth.js]"]
  node_transactionroute["Transaction routes<br/>[transactions.js]"]
  node_analyticsroute["Analytics routes<br/>[analytics.js]"]
  node_budgetroute["Budget routes<br/>[budgets.js]"]
  node_adminroute["Admin routes<br/>[admin.js]"]
  node_email["Email notifications<br/>[emailService.js]"]
end

subgraph group_intelligence["Advisory services"]
  node_mlroute["ML API routes<br/>[ml.js]"]
  node_airoute["AI API routes<br/>[ai.js]"]
  node_advisoryroute["Advisory routes<br/>[advisories.js]"]
  node_mlservice["Python ML service<br/>[app.py]"]
end

subgraph group_persistence["Identity and data"]
  node_models["Finance data models"]
  node_dbconfig["Database connection<br/>[db.js]"]
  node_database[("MongoDB store")]
end

node_user(("Finance user"))
node_smtp["SMTP email service"]

node_user -->|"uses"| node_app
node_app -->|"provides auth"| node_authctx
node_app -->|"provides finance state"| node_financectx
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_transactions
node_app -->|"routes to"| node_analytics
node_app -->|"routes to"| node_budget
node_app -->|"routes to"| node_advisor
node_app -->|"routes to"| node_adminui
node_authctx -->|"sends login requests"| node_authroute
node_financectx -->|"requests transactions"| node_transactionroute
node_financectx -->|"requests analytics"| node_analyticsroute
node_financectx -->|"requests budgets"| node_budgetroute
node_financectx -->|"requests predictions"| node_mlroute
node_adminui -->|"requests admin data"| node_adminroute
node_server -->|"mounts"| node_authroute
node_server -->|"mounts"| node_transactionroute
node_server -->|"mounts"| node_analyticsroute
node_server -->|"mounts"| node_budgetroute
node_server -->|"mounts"| node_mlroute
node_server -->|"mounts"| node_airoute
node_server -->|"mounts"| node_adminroute
node_server -->|"mounts"| node_advisoryroute
node_authroute -->|"queries users"| node_models
node_dbconfig -->|"connects"| node_database
node_server -.->|"connects to"| node_mlservice
node_email -.->|"sends mail"| node_smtp

click node_app "https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-advisory/src/App.jsx"
click node_authctx "https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-advisory/src/context/AuthContext.jsx"
click node_financectx "https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-advisory/src/context/FinanceContext.jsx"
click node_login "https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-advisory/src/pages/Login.jsx"
click node_dashboard "https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-advisory/src/pages/Dashboard.jsx"
click node_transactions "https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-advisory/src/pages/Transaction.jsx"
click node_analytics "https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-advisory/src/pages/Analytics.jsx"
click node_budget "https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-advisory/src/pages/Budget.jsx"
click node_advisor "https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-advisory/src/pages/Advisor.jsx"
click node_adminui "https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-advisory/src/pages/Admin.jsx"
click node_server "https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/server.js"
click node_authroute "https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/routes/auth.js"
click node_transactionroute "https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/routes/transactions.js"
click node_analyticsroute "https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/routes/analytics.js"
click node_budgetroute "https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/routes/budgets.js"
click node_adminroute "https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/routes/admin.js"
click node_mlroute "https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/routes/ml.js"
click node_airoute "https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/routes/ai.js"
click node_advisoryroute "https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/routes/advisories.js"
click node_mlservice "https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-ml/app.py"
click node_models "https://github.com/komalsuniltayde/smart-finance-advisor-/tree/main/smart-finance-backend/models"
click node_dbconfig "https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/config/db.js"
click node_email "https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/services/emailService.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_authctx,node_financectx,node_login,node_dashboard,node_transactions,node_analytics,node_budget,node_advisor,node_adminui,node_user toneBlue
class node_server,node_authroute,node_transactionroute,node_analyticsroute,node_budgetroute,node_adminroute,node_email toneAmber
class node_mlroute,node_airoute,node_advisoryroute,node_mlservice toneMint
class node_models,node_dbconfig,node_database toneRose
class node_smtp toneIndigo
```

## Components

### Web application

- [React application](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-advisory/src/App.jsx): `smart-finance-advisory/src/App.jsx`
- [Authentication state](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-advisory/src/context/AuthContext.jsx): `smart-finance-advisory/src/context/AuthContext.jsx`
- [Finance state and API](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-advisory/src/context/FinanceContext.jsx): `smart-finance-advisory/src/context/FinanceContext.jsx`
- [Login and registration](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-advisory/src/pages/Login.jsx): `smart-finance-advisory/src/pages/Login.jsx`
- [Finance dashboard](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-advisory/src/pages/Dashboard.jsx): `smart-finance-advisory/src/pages/Dashboard.jsx`
- [Transaction management](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-advisory/src/pages/Transaction.jsx): `smart-finance-advisory/src/pages/Transaction.jsx`
- [Analytics views](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-advisory/src/pages/Analytics.jsx): `smart-finance-advisory/src/pages/Analytics.jsx`
- [Budget management](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-advisory/src/pages/Budget.jsx): `smart-finance-advisory/src/pages/Budget.jsx`
- [AI advisor](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-advisory/src/pages/Advisor.jsx): `smart-finance-advisory/src/pages/Advisor.jsx`
- [Admin console](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-advisory/src/pages/Admin.jsx): `smart-finance-advisory/src/pages/Admin.jsx`

### Finance API

- [Express API server](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/server.js): `smart-finance-backend/server.js`
- [Authentication routes](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/routes/auth.js): `smart-finance-backend/routes/auth.js`
- [Transaction routes](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/routes/transactions.js): `smart-finance-backend/routes/transactions.js`
- [Analytics routes](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/routes/analytics.js): `smart-finance-backend/routes/analytics.js`
- [Budget routes](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/routes/budgets.js): `smart-finance-backend/routes/budgets.js`
- [Admin routes](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/routes/admin.js): `smart-finance-backend/routes/admin.js`
- [Email notifications](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/services/emailService.js): `smart-finance-backend/services/emailService.js`

### Advisory services

- [ML API routes](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/routes/ml.js): `smart-finance-backend/routes/ml.js`
- [AI API routes](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/routes/ai.js): `smart-finance-backend/routes/ai.js`
- [Advisory routes](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/routes/advisories.js): `smart-finance-backend/routes/advisories.js`
- [Python ML service](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-ml/app.py): `smart-finance-ml/app.py`

### Identity and data

- [Finance data models](https://github.com/komalsuniltayde/smart-finance-advisor-/tree/main/smart-finance-backend/models): `smart-finance-backend/models`
- [Database connection](https://github.com/komalsuniltayde/smart-finance-advisor-/blob/main/smart-finance-backend/config/db.js): `smart-finance-backend/config/db.js`
- **MongoDB store**

### Other components

- **Finance user**
- **SMTP email service**

## Connections

- Finance user → React application: uses
- React application → Authentication state: provides auth
- React application → Finance state and API: provides finance state
- React application → Login and registration: routes to
- React application → Finance dashboard: routes to
- React application → Transaction management: routes to
- React application → Analytics views: routes to
- React application → Budget management: routes to
- React application → AI advisor: routes to
- React application → Admin console: routes to
- Authentication state → Authentication routes: sends login requests
- Finance state and API → Transaction routes: requests transactions
- Finance state and API → Analytics routes: requests analytics
- Finance state and API → Budget routes: requests budgets
- Finance state and API → ML API routes: requests predictions
- Admin console → Admin routes: requests admin data
- Express API server → Authentication routes: mounts
- Express API server → Transaction routes: mounts
- Express API server → Analytics routes: mounts
- Express API server → Budget routes: mounts
- Express API server → ML API routes: mounts
- Express API server → AI API routes: mounts
- Express API server → Admin routes: mounts
- Express API server → Advisory routes: mounts
- Authentication routes → Finance data models: queries users
- Database connection → MongoDB store: connects
- Express API server → Python ML service: connects to
- Email notifications → SMTP email service: sends mail
