# giriprasad-05/finsight-ai architecture

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

- Interactive diagram: https://gitdiagram.com/giriprasad-05/finsight-ai
- Repository: https://github.com/giriprasad-05/finsight-ai

## Overview

FinSight AI is a React stock-analysis frontend. Users search for a ticker, open its dashboard, and explore company metrics, price history, risk and trend analysis, explainable signals, and educational insights; they can also ask the investment mentor questions. The shown services use mock stock and chatbot data, while the README describes integration with backend services or configured data sources. The dashboard, hooks, stores, and most feature wiring were not excerpted, so uncertain call relationships are omitted; documented capabilities remain represented.

Main entry points: [`Frontend/src/pages/stock/StockDashboard.tsx`](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/pages/stock/StockDashboard.tsx) (Stock dashboard), [`Frontend/src/services/stockService.ts`](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/services/stockService.ts) (Stock service), [`Frontend/src/App.tsx`](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/App.tsx) (App routing), [`Frontend/src/services/mentorService.ts`](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/services/mentorService.ts) (Mentor service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_app["App routing<br/>[App.tsx]"]
  node_home["Home page<br/>[HomePage.tsx]"]
end

subgraph group_market["Stock exploration"]
  node_search["Stock search<br/>[StockSearch.tsx]"]
  node_dashboard["Stock dashboard<br/>[StockDashboard.tsx]"]
  node_company["Company details"]
  node_companypanel["Company panel<br/>[CompanyPanel.tsx]"]
  node_stockheader["Stock header<br/>[StockHeader.tsx]"]
  node_chartpanel["Price chart panel"]
  node_chart["Price chart<br/>[PriceChart.tsx]"]
end

subgraph group_analysis["Analysis and insight"]
  node_risk["Risk assessment<br/>[RiskAnalysis.tsx]"]
  node_trend["Trend analysis<br/>[TrendAnalysis.tsx]"]
  node_explain["Explainable insights<br/>[ExplainableAI.tsx]"]
  node_education["Educational insight"]
  node_engine["Analysis engine<br/>[analysisEngine.ts]"]
  node_indicators["Technical indicators<br/>[indicators.ts]"]
end

subgraph group_mentor["Investment mentor"]
  node_mentorui["Mentor chat"]
  node_mentorhook["Mentor hook<br/>[useMentor.ts]"]
  node_mentorservice["Mentor service<br/>[mentorService.ts]"]
  node_chatdata["Chat responses<br/>[chatbot.ts]"]
end

subgraph group_data["Data and services"]
  node_stockhook["Stock data hook<br/>[useStockData.ts]"]
  node_stockservice["Stock service<br/>[stockService.ts]"]
  node_stockdata["Stock mock data<br/>[core.ts]"]
  node_riskdata["Risk mock data<br/>[analyticsRisk.ts]"]
  node_trenddata["Trend mock data<br/>[analyticsTrend.ts]"]
  node_historydata["History mock data<br/>[history.ts]"]
  node_educationdata["Education data<br/>[education.ts]"]
  node_api["API client<br/>[api.ts]"]
  node_stocktypes["Stock contracts<br/>[stock.ts]"]
  node_risktype["Risk contracts<br/>[risk.ts]"]
  node_canonical["Canonical stock model<br/>[canonical.ts]"]
  node_mentortype["Mentor contracts<br/>[mentor.ts]"]
end

node_user(("Investor"))

node_user -->|"uses"| node_app
node_app -->|"routes"| node_home
node_app -->|"routes"| node_dashboard
node_app -->|"renders"| node_search
node_user -->|"searches"| node_search
node_user -->|"explores"| node_dashboard
node_dashboard -.->|"presents"| node_company
node_dashboard -.->|"presents"| node_companypanel
node_dashboard -.->|"presents"| node_stockheader
node_dashboard -.->|"presents"| node_chartpanel
node_chartpanel -.->|"renders"| node_chart
node_dashboard -.->|"presents"| node_risk
node_dashboard -.->|"presents"| node_trend
node_dashboard -.->|"presents"| node_explain
node_dashboard -.->|"presents"| node_education
node_dashboard -.->|"presents"| node_mentorui
node_engine -->|"calculates with"| node_indicators
node_stockservice -->|"reads"| node_stockdata
node_stockservice -.->|"reads"| node_riskdata
node_stockservice -.->|"reads"| node_trenddata
node_stockservice -.->|"reads"| node_historydata
node_stockservice -.->|"reads"| node_educationdata
node_mentorservice -->|"gets response"| node_chatdata
node_search -.->|"queries"| node_stockhook
node_dashboard -.->|"loads data"| node_stockhook
node_stockhook -.->|"requests"| node_stockservice
node_mentorui -.->|"interacts"| node_mentorhook
node_mentorhook -.->|"sends message"| node_mentorservice
node_stockservice -->|"uses types"| node_stocktypes
node_engine -->|"produces"| node_risktype
node_canonical -->|"composes"| node_stocktypes
node_canonical -->|"composes"| node_risktype
node_mentorservice -->|"uses types"| node_mentortype
node_api -.->|"serves data"| node_user

click node_app "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/App.tsx"
click node_home "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/pages/Home/HomePage.tsx"
click node_search "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/components/search/StockSearch.tsx"
click node_dashboard "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/pages/stock/StockDashboard.tsx"
click node_company "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/features/stock/CompanyOverview.tsx"
click node_companypanel "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/features/stock/CompanyPanel.tsx"
click node_stockheader "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/features/stock/StockHeader.tsx"
click node_chartpanel "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/features/chart/PriceChartPanel.tsx"
click node_chart "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/features/chart/PriceChart.tsx"
click node_risk "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/features/risk/RiskAnalysis.tsx"
click node_trend "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/features/risk/TrendAnalysis.tsx"
click node_explain "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/features/explainability/ExplainableAI.tsx"
click node_education "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/features/education/EducationalInsight.tsx"
click node_engine "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/services/analysisEngine.ts"
click node_indicators "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/lib/indicators.ts"
click node_mentorui "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/features/mentor/InvestmentMentor.tsx"
click node_mentorhook "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/hooks/useMentor.ts"
click node_mentorservice "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/services/mentorService.ts"
click node_chatdata "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/data/stocks/chatbot.ts"
click node_stockhook "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/hooks/useStockData.ts"
click node_stockservice "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/services/stockService.ts"
click node_stockdata "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/data/stocks/core.ts"
click node_riskdata "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/data/stocks/analyticsRisk.ts"
click node_trenddata "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/data/stocks/analyticsTrend.ts"
click node_historydata "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/data/stocks/history.ts"
click node_educationdata "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/data/stocks/education.ts"
click node_api "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/lib/api.ts"
click node_stocktypes "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/types/stock.ts"
click node_risktype "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/types/risk.ts"
click node_canonical "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/types/canonical.ts"
click node_mentortype "https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/types/mentor.ts"

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_home toneBlue
class node_search,node_dashboard,node_company,node_companypanel,node_stockheader,node_chartpanel,node_chart toneAmber
class node_risk,node_trend,node_explain,node_education,node_engine,node_indicators toneMint
class node_mentorui,node_mentorhook,node_mentorservice,node_chatdata toneRose
class node_stockhook,node_stockservice,node_stockdata,node_riskdata,node_trenddata,node_historydata,node_educationdata,node_api,node_stocktypes,node_risktype,node_canonical,node_mentortype,node_user toneIndigo
```

## Components

### Application entry

- [App routing](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/App.tsx): `Frontend/src/App.tsx`
- [Home page](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/pages/Home/HomePage.tsx): `Frontend/src/pages/Home/HomePage.tsx`

### Stock exploration

- [Stock search](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/components/search/StockSearch.tsx): `Frontend/src/components/search/StockSearch.tsx`
- [Stock dashboard](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/pages/stock/StockDashboard.tsx): `Frontend/src/pages/stock/StockDashboard.tsx`
- [Company details](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/features/stock/CompanyOverview.tsx): `Frontend/src/features/stock/CompanyOverview.tsx`
- [Company panel](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/features/stock/CompanyPanel.tsx): `Frontend/src/features/stock/CompanyPanel.tsx`
- [Stock header](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/features/stock/StockHeader.tsx): `Frontend/src/features/stock/StockHeader.tsx`
- [Price chart panel](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/features/chart/PriceChartPanel.tsx): `Frontend/src/features/chart/PriceChartPanel.tsx`
- [Price chart](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/features/chart/PriceChart.tsx): `Frontend/src/features/chart/PriceChart.tsx`

### Analysis and insight

- [Risk assessment](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/features/risk/RiskAnalysis.tsx): `Frontend/src/features/risk/RiskAnalysis.tsx`
- [Trend analysis](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/features/risk/TrendAnalysis.tsx): `Frontend/src/features/risk/TrendAnalysis.tsx`
- [Explainable insights](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/features/explainability/ExplainableAI.tsx): `Frontend/src/features/explainability/ExplainableAI.tsx`
- [Educational insight](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/features/education/EducationalInsight.tsx): `Frontend/src/features/education/EducationalInsight.tsx`
- [Analysis engine](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/services/analysisEngine.ts): `Frontend/src/services/analysisEngine.ts`
- [Technical indicators](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/lib/indicators.ts): `Frontend/src/lib/indicators.ts`

### Investment mentor

- [Mentor chat](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/features/mentor/InvestmentMentor.tsx): `Frontend/src/features/mentor/InvestmentMentor.tsx`
- [Mentor hook](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/hooks/useMentor.ts): `Frontend/src/hooks/useMentor.ts`
- [Mentor service](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/services/mentorService.ts): `Frontend/src/services/mentorService.ts`
- [Chat responses](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/data/stocks/chatbot.ts): `Frontend/src/data/stocks/chatbot.ts`

### Data and services

- [Stock data hook](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/hooks/useStockData.ts): `Frontend/src/hooks/useStockData.ts`
- [Stock service](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/services/stockService.ts): `Frontend/src/services/stockService.ts`
- [Stock mock data](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/data/stocks/core.ts): `Frontend/src/data/stocks/core.ts`
- [Risk mock data](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/data/stocks/analyticsRisk.ts): `Frontend/src/data/stocks/analyticsRisk.ts`
- [Trend mock data](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/data/stocks/analyticsTrend.ts): `Frontend/src/data/stocks/analyticsTrend.ts`
- [History mock data](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/data/stocks/history.ts): `Frontend/src/data/stocks/history.ts`
- [Education data](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/data/stocks/education.ts): `Frontend/src/data/stocks/education.ts`
- [API client](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/lib/api.ts): `Frontend/src/lib/api.ts`
- [Stock contracts](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/types/stock.ts): `Frontend/src/types/stock.ts`
- [Risk contracts](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/types/risk.ts): `Frontend/src/types/risk.ts`
- [Canonical stock model](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/types/canonical.ts): `Frontend/src/types/canonical.ts`
- [Mentor contracts](https://github.com/giriprasad-05/finsight-ai/blob/main/Frontend/src/types/mentor.ts): `Frontend/src/types/mentor.ts`

### Other components

- **Investor**

## Connections

- Investor → App routing: uses
- App routing → Home page: routes (evidence: `Frontend/src/App.tsx`)
- App routing → Stock dashboard: routes (evidence: `Frontend/src/App.tsx`)
- App routing → Stock search: renders (evidence: `Frontend/src/App.tsx`)
- Investor → Stock search: searches
- Investor → Stock dashboard: explores
- Stock dashboard → Company details: presents
- Stock dashboard → Company panel: presents
- Stock dashboard → Stock header: presents
- Stock dashboard → Price chart panel: presents
- Price chart panel → Price chart: renders
- Stock dashboard → Risk assessment: presents
- Stock dashboard → Trend analysis: presents
- Stock dashboard → Explainable insights: presents
- Stock dashboard → Educational insight: presents
- Stock dashboard → Mentor chat: presents
- Analysis engine → Technical indicators: calculates with (evidence: `Frontend/src/services/analysisEngine.ts`)
- Stock service → Stock mock data: reads (evidence: `Frontend/src/services/stockService.ts`)
- Stock service → Risk mock data: reads
- Stock service → Trend mock data: reads
- Stock service → History mock data: reads
- Stock service → Education data: reads
- Mentor service → Chat responses: gets response (evidence: `Frontend/src/services/mentorService.ts`)
- Stock search → Stock data hook: queries
- Stock dashboard → Stock data hook: loads data
- Stock data hook → Stock service: requests
- Mentor chat → Mentor hook: interacts
- Mentor hook → Mentor service: sends message
- Stock service → Stock contracts: uses types (evidence: `Frontend/src/services/stockService.ts`)
- Analysis engine → Risk contracts: produces (evidence: `Frontend/src/services/analysisEngine.ts`)
- Canonical stock model → Stock contracts: composes (evidence: `Frontend/src/types/canonical.ts`)
- Canonical stock model → Risk contracts: composes (evidence: `Frontend/src/types/canonical.ts`)
- Mentor service → Mentor contracts: uses types (evidence: `Frontend/src/services/mentorService.ts`)
- API client → Investor: serves data
