# sudeep-tr/elifin-advisor architecture

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

- Interactive diagram: https://gitdiagram.com/sudeep-tr/elifin-advisor
- Repository: https://github.com/sudeep-tr/elifin-advisor

## Overview

EliFin is a personal-finance and wealth-management web app. Users register or sign in, then manage transactions, budgets, and investments; the app presents financial summaries and health indicators, with AI guidance available for portfolios and through the advisor experience. The frontend communicates with an Express API, which authenticates protected requests and stores user financial data in MongoDB. README capabilities inform the feature map, but several frontend pages and backend route implementations were not sampled, so uncertain internal wiring is omitted.

Main entry points: [`Backend/server.js`](https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/server.js) (Express API), [`Frontend/src/App.jsx`](https://github.com/sudeep-tr/elifin-advisor/blob/main/Frontend/src/App.jsx) (React app), [`Frontend/src/api/axios.js`](https://github.com/sudeep-tr/elifin-advisor/blob/main/Frontend/src/api/axios.js) (HTTP client), [`Backend/middleware/authMiddleware.js`](https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/middleware/authMiddleware.js) (JWT protection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["React app<br/>[App.jsx]"]
  node_login["Login and registration<br/>[Login.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_transactions_ui["Transactions<br/>[Transactions.jsx]"]
  node_budget_ui["Budgets<br/>[Budget.jsx]"]
  node_investments_ui["Investments<br/>[Investments.jsx]"]
  node_advisor_ui["AI advisor<br/>[AIAdvisor.jsx]"]
  node_chatbot["Advisor chatbot<br/>[Chatbot.jsx]"]
  node_profile["Profile<br/>[Profile.jsx]"]
  node_http["HTTP client<br/>[axios.js]"]
end

subgraph group_api["API and identity"]
  node_server["Express API<br/>[server.js]"]
  node_auth_routes["Authentication<br/>[authRoutes.js]"]
  node_auth_middleware["JWT protection<br/>[authMiddleware.js]"]
  node_user_routes["User profile API<br/>[userRoutes.js]"]
end

subgraph group_finance["Finance services"]
  node_transaction_routes["Transactions and analysis"]
  node_budget_routes["Budget management<br/>[budgetRoutes.js]"]
  node_health_routes["Financial health<br/>[healthRoutes.js]"]
  node_investment_routes["Portfolio management"]
  node_ai_routes["Portfolio advice<br/>[aiRoutes.js]"]
  node_ai_advisor_routes["AI advisor API<br/>[aiAdvisor.js]"]
end

subgraph group_data["Financial data"]
  node_user_model["User records<br/>[User.js]"]
  node_transaction_model["Transaction records<br/>[Transaction.js]"]
  node_budget_model["Budget records<br/>[Budget.js]"]
  node_investment_model["Investment records<br/>[Investment.js]"]
end

subgraph group_integrations["External services"]
  node_mongo[("MongoDB")]
  node_groq["Groq API"]
end

node_user(("Finance user"))

node_user -->|"uses"| node_app
node_app -->|"renders routes"| node_login
node_app -->|"renders routes"| node_dashboard
node_app -->|"renders routes"| node_transactions_ui
node_app -->|"renders routes"| node_budget_ui
node_app -->|"renders routes"| node_investments_ui
node_app -->|"renders routes"| node_advisor_ui
node_app -->|"renders routes"| node_profile
node_login -->|"sends requests"| node_http
node_dashboard -->|"sends requests"| node_http
node_transactions_ui -->|"sends requests"| node_http
node_budget_ui -->|"sends requests"| node_http
node_investments_ui -->|"sends requests"| node_http
node_advisor_ui -->|"sends requests"| node_http
node_profile -->|"sends requests"| node_http
node_http -->|"HTTP requests"| node_server
node_server -->|"dispatches"| node_auth_routes
node_server -->|"dispatches"| node_transaction_routes
node_server -->|"dispatches"| node_budget_routes
node_server -->|"dispatches"| node_health_routes
node_server -->|"dispatches"| node_investment_routes
node_server -->|"dispatches"| node_ai_routes
node_server -->|"dispatches"| node_ai_advisor_routes
node_server -->|"dispatches"| node_user_routes
node_auth_routes -->|"reads and creates"| node_user_model
node_transaction_routes -->|"protects routes"| node_auth_middleware
node_budget_routes -->|"protects routes"| node_auth_middleware
node_health_routes -->|"protects routes"| node_auth_middleware
node_investment_routes -->|"protects routes"| node_auth_middleware
node_ai_routes -->|"protects routes"| node_auth_middleware
node_ai_advisor_routes -->|"protects routes"| node_auth_middleware
node_user_routes -->|"protects routes"| node_auth_middleware
node_transaction_routes -->|"reads and writes"| node_transaction_model
node_transaction_routes -->|"reads"| node_budget_model
node_budget_routes -->|"reads and writes"| node_budget_model
node_budget_routes -->|"reads"| node_transaction_model
node_health_routes -->|"reads"| node_transaction_model
node_health_routes -->|"reads"| node_budget_model
node_investment_routes -->|"reads and writes"| node_investment_model
node_ai_routes -->|"reads"| node_investment_model
node_ai_routes -.->|"requests advice"| node_groq
node_transaction_model -->|"persists data"| node_mongo
node_budget_model -->|"persists data"| node_mongo
node_investment_model -->|"persists data"| node_mongo
node_user_model -->|"persists data"| node_mongo

click node_app "https://github.com/sudeep-tr/elifin-advisor/blob/main/Frontend/src/App.jsx"
click node_login "https://github.com/sudeep-tr/elifin-advisor/blob/main/Frontend/src/pages/Login.jsx"
click node_dashboard "https://github.com/sudeep-tr/elifin-advisor/blob/main/Frontend/src/pages/Dashboard.jsx"
click node_transactions_ui "https://github.com/sudeep-tr/elifin-advisor/blob/main/Frontend/src/pages/Transactions.jsx"
click node_budget_ui "https://github.com/sudeep-tr/elifin-advisor/blob/main/Frontend/src/pages/Budget.jsx"
click node_investments_ui "https://github.com/sudeep-tr/elifin-advisor/blob/main/Frontend/src/pages/Investments.jsx"
click node_advisor_ui "https://github.com/sudeep-tr/elifin-advisor/blob/main/Frontend/src/pages/AIAdvisor.jsx"
click node_chatbot "https://github.com/sudeep-tr/elifin-advisor/blob/main/Frontend/src/components/Chatbot.jsx"
click node_profile "https://github.com/sudeep-tr/elifin-advisor/blob/main/Frontend/src/pages/Profile.jsx"
click node_http "https://github.com/sudeep-tr/elifin-advisor/blob/main/Frontend/src/api/axios.js"
click node_server "https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/server.js"
click node_auth_routes "https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/routes/authRoutes.js"
click node_auth_middleware "https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/middleware/authMiddleware.js"
click node_transaction_routes "https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/routes/transactionRoutes.js"
click node_budget_routes "https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/routes/budgetRoutes.js"
click node_health_routes "https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/routes/healthRoutes.js"
click node_investment_routes "https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/routes/investmentRoutes.js"
click node_ai_routes "https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/routes/aiRoutes.js"
click node_ai_advisor_routes "https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/routes/aiAdvisor.js"
click node_user_routes "https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/routes/userRoutes.js"
click node_user_model "https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/models/User.js"
click node_transaction_model "https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/models/Transaction.js"
click node_budget_model "https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/models/Budget.js"
click node_investment_model "https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/models/Investment.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_login,node_dashboard,node_transactions_ui,node_budget_ui,node_investments_ui,node_advisor_ui,node_chatbot,node_profile,node_http,node_user toneBlue
class node_server,node_auth_routes,node_auth_middleware,node_user_routes toneAmber
class node_transaction_routes,node_budget_routes,node_health_routes,node_investment_routes,node_ai_routes,node_ai_advisor_routes toneMint
class node_user_model,node_transaction_model,node_budget_model,node_investment_model toneRose
class node_mongo,node_groq toneIndigo
```

## Components

### Web application

- [React app](https://github.com/sudeep-tr/elifin-advisor/blob/main/Frontend/src/App.jsx): `Frontend/src/App.jsx`
- [Login and registration](https://github.com/sudeep-tr/elifin-advisor/blob/main/Frontend/src/pages/Login.jsx): `Frontend/src/pages/Login.jsx`
- [Dashboard](https://github.com/sudeep-tr/elifin-advisor/blob/main/Frontend/src/pages/Dashboard.jsx): `Frontend/src/pages/Dashboard.jsx`
- [Transactions](https://github.com/sudeep-tr/elifin-advisor/blob/main/Frontend/src/pages/Transactions.jsx): `Frontend/src/pages/Transactions.jsx`
- [Budgets](https://github.com/sudeep-tr/elifin-advisor/blob/main/Frontend/src/pages/Budget.jsx): `Frontend/src/pages/Budget.jsx`
- [Investments](https://github.com/sudeep-tr/elifin-advisor/blob/main/Frontend/src/pages/Investments.jsx): `Frontend/src/pages/Investments.jsx`
- [AI advisor](https://github.com/sudeep-tr/elifin-advisor/blob/main/Frontend/src/pages/AIAdvisor.jsx): `Frontend/src/pages/AIAdvisor.jsx`
- [Advisor chatbot](https://github.com/sudeep-tr/elifin-advisor/blob/main/Frontend/src/components/Chatbot.jsx): `Frontend/src/components/Chatbot.jsx`
- [Profile](https://github.com/sudeep-tr/elifin-advisor/blob/main/Frontend/src/pages/Profile.jsx): `Frontend/src/pages/Profile.jsx`
- [HTTP client](https://github.com/sudeep-tr/elifin-advisor/blob/main/Frontend/src/api/axios.js): `Frontend/src/api/axios.js`

### API and identity

- [Express API](https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/server.js): `Backend/server.js`
- [Authentication](https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/routes/authRoutes.js): `Backend/routes/authRoutes.js`
- [JWT protection](https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/middleware/authMiddleware.js): `Backend/middleware/authMiddleware.js`
- [User profile API](https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/routes/userRoutes.js): `Backend/routes/userRoutes.js`

### Finance services

- [Transactions and analysis](https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/routes/transactionRoutes.js): `Backend/routes/transactionRoutes.js`
- [Budget management](https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/routes/budgetRoutes.js): `Backend/routes/budgetRoutes.js`
- [Financial health](https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/routes/healthRoutes.js): `Backend/routes/healthRoutes.js`
- [Portfolio management](https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/routes/investmentRoutes.js): `Backend/routes/investmentRoutes.js`
- [Portfolio advice](https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/routes/aiRoutes.js): `Backend/routes/aiRoutes.js`
- [AI advisor API](https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/routes/aiAdvisor.js): `Backend/routes/aiAdvisor.js`

### Financial data

- [User records](https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/models/User.js): `Backend/models/User.js`
- [Transaction records](https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/models/Transaction.js): `Backend/models/Transaction.js`
- [Budget records](https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/models/Budget.js): `Backend/models/Budget.js`
- [Investment records](https://github.com/sudeep-tr/elifin-advisor/blob/main/Backend/models/Investment.js): `Backend/models/Investment.js`

### External services

- **MongoDB**
- **Groq API**

### Other components

- **Finance user**

## Connections

- Finance user → React app: uses
- React app → Login and registration: renders routes
- React app → Dashboard: renders routes
- React app → Transactions: renders routes
- React app → Budgets: renders routes
- React app → Investments: renders routes
- React app → AI advisor: renders routes
- React app → Profile: renders routes
- Login and registration → HTTP client: sends requests
- Dashboard → HTTP client: sends requests
- Transactions → HTTP client: sends requests
- Budgets → HTTP client: sends requests
- Investments → HTTP client: sends requests
- AI advisor → HTTP client: sends requests
- Profile → HTTP client: sends requests
- HTTP client → Express API: HTTP requests
- Express API → Authentication: dispatches
- Express API → Transactions and analysis: dispatches
- Express API → Budget management: dispatches
- Express API → Financial health: dispatches
- Express API → Portfolio management: dispatches
- Express API → Portfolio advice: dispatches
- Express API → AI advisor API: dispatches
- Express API → User profile API: dispatches
- Authentication → User records: reads and creates
- Transactions and analysis → JWT protection: protects routes
- Budget management → JWT protection: protects routes
- Financial health → JWT protection: protects routes
- Portfolio management → JWT protection: protects routes
- Portfolio advice → JWT protection: protects routes
- AI advisor API → JWT protection: protects routes
- User profile API → JWT protection: protects routes
- Transactions and analysis → Transaction records: reads and writes
- Transactions and analysis → Budget records: reads
- Budget management → Budget records: reads and writes
- Budget management → Transaction records: reads
- Financial health → Transaction records: reads
- Financial health → Budget records: reads
- Portfolio management → Investment records: reads and writes
- Portfolio advice → Investment records: reads
- Portfolio advice → Groq API: requests advice
- Transaction records → MongoDB: persists data
- Budget records → MongoDB: persists data
- Investment records → MongoDB: persists data
- User records → MongoDB: persists data
