# veeramani-elumalai/visalpha-capital architecture

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

- Interactive diagram: https://gitdiagram.com/veeramani-elumalai/visalpha-capital
- Repository: https://github.com/veeramani-elumalai/visalpha-capital

## Overview

VisAlpha Capital is an investment-analysis platform whose main user workflow is to sign in, inspect a portfolio with live valuation and benchmark performance, and explore stock, sector, news, advisor, and personalized daily-report insights. The React client calls an Express API; the API handles identity, portfolio and report state in MongoDB and delegates market analytics to a FastAPI service using market data. The graph preserves the README’s distinct product capabilities. Some page-to-route wiring and unsampled features are documented rather than source-verified, so those links cite the README.

Main entry points: [`client/src/App.js`](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/App.js) (App routing), [`server/server.js`](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/server.js) (Express API), [`market-service/main.py`](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/market-service/main.py) (Market data API), [`server/src/services/dailyReport.service.js`](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/services/dailyReport.service.js) (Report orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Investor client"]
  node_app["App routing<br/>[App.js]"]
  node_authui["Sign-in and registration<br/>[Login.js]"]
  node_dashboard["Portfolio dashboard<br/>[Dashboard.js]"]
  node_screenerui["Stock screener<br/>[screener.js]"]
  node_compareui["Stock comparator<br/>[Compare.js]"]
  node_sectorui["Sector analysis<br/>[SectorAnalysis.js]"]
  node_advisorui["AI stock advisor<br/>[Advisor.js]"]
  node_reportui["Daily AI report<br/>[DailyReport.js]"]
  node_newsui["Market news<br/>[News.js]"]
  node_api_client["API client and session<br/>[api.js]"]
  node_screener_client["Screener API service<br/>[screenerService.js]"]
end

subgraph group_api["Backend API"]
  node_express["Express API<br/>[server.js]"]
  node_authroutes["Authentication routes<br/>[auth.routes.js]"]
  node_portfolioroutes["Portfolio operations"]
  node_stockroutes["Stock endpoints<br/>[stock.routes.js]"]
  node_screenerroutes["Screener endpoint<br/>[screener.routes.js]"]
  node_sectorroute["Sector endpoint<br/>[sector.routes.js]"]
  node_newsroute["News endpoint<br/>[news.routes.js]"]
  node_newscontroller["News aggregation<br/>[news.controller.js]"]
  node_reportroutes["Daily report routes"]
  node_reportservice["Report orchestration"]
  node_scheduler["Report scheduler"]
  node_authmiddleware["JWT authorization<br/>[auth.js]"]
  node_marketproxy["Market service proxy<br/>[marketService.js]"]
end

subgraph group_market["Market analytics"]
  node_marketapi["Market data API<br/>[main.py]"]
  node_screenerlogic["Financial profiles and CAGR<br/>[screener.py]"]
  node_advisorlogic["Advisor scoring<br/>[advisor.py]"]
  node_sectorlogic["Sector sweep<br/>[sector_setup.py]"]
  node_cagr["CAGR calculations<br/>[cagr.py]"]
end

subgraph group_state["Identity and state"]
  node_users[("User accounts<br/>[User.js]")]
  node_portfolio[("Portfolio store<br/>[Portfolio.js]")]
  node_reports[("Daily report store<br/>[DailyReport.js]")]
end

subgraph group_integrations["External services"]
  node_yfinance["Yahoo Finance data"]
end

node_investor(("Investor"))

node_investor -->|"uses"| node_app
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_authui
node_app -->|"routes to"| node_screenerui
node_app -->|"routes to"| node_compareui
node_app -->|"routes to"| node_sectorui
node_app -->|"routes to"| node_advisorui
node_app -->|"routes to"| node_reportui
node_app -->|"routes to"| node_newsui
node_authui -->|"calls"| node_api_client
node_dashboard -->|"calls"| node_api_client
node_reportui -->|"calls"| node_api_client
node_advisorui -->|"calls"| node_api_client
node_compareui -->|"calls"| node_screener_client
node_screener_client -->|"uses"| node_api_client
node_api_client -.->|"requests"| node_express
node_express -->|"mounts"| node_authroutes
node_express -->|"mounts"| node_portfolioroutes
node_express -->|"mounts"| node_stockroutes
node_express -->|"mounts"| node_screenerroutes
node_express -->|"mounts"| node_sectorroute
node_express -->|"mounts"| node_newsroute
node_express -->|"mounts"| node_reportroutes
node_authroutes -->|"reads and writes"| node_users
node_portfolioroutes -->|"guards"| node_authmiddleware
node_portfolioroutes -->|"reads and writes"| node_portfolio
node_portfolioroutes -->|"requests prices and history"| node_marketapi
node_portfolioroutes -->|"gets live prices"| node_marketproxy
node_screenerroutes -.->|"proxies profile request"| node_marketapi
node_sectorroute -.->|"proxies sector request"| node_marketapi
node_newsroute -.->|"dispatches"| node_newscontroller
node_reportroutes -->|"guards"| node_authmiddleware
node_reportroutes -->|"calls"| node_reportservice
node_express -->|"starts"| node_scheduler
node_scheduler -->|"generates reports"| node_reportservice
node_reportservice -->|"reads holdings"| node_portfolio
node_reportservice -->|"reads and writes"| node_reports
node_reportservice -->|"gets live prices"| node_marketproxy
node_marketproxy -->|"requests prices"| node_marketapi
node_marketapi -->|"gets financials"| node_screenerlogic
node_marketapi -->|"scores metrics"| node_advisorlogic
node_marketapi -->|"gets sector data"| node_sectorlogic
node_marketapi -->|"imports calculation"| node_cagr
node_marketapi -->|"fetches market data"| node_yfinance
node_reportservice -.->|"fetches headlines"| node_newscontroller
node_reportservice -.->|"requests news and AI analysis"| node_yfinance

click node_app "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/App.js"
click node_authui "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/pages/Login.js"
click node_dashboard "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/pages/Dashboard.js"
click node_screenerui "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/pages/screener.js"
click node_compareui "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/pages/Compare.js"
click node_sectorui "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/pages/SectorAnalysis.js"
click node_advisorui "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/pages/Advisor.js"
click node_reportui "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/pages/DailyReport.js"
click node_newsui "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/pages/News.js"
click node_api_client "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/services/api.js"
click node_screener_client "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/services/screenerService.js"
click node_express "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/server.js"
click node_authroutes "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/routes/auth.routes.js"
click node_portfolioroutes "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/routes/portfolio.routes.js"
click node_stockroutes "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/routes/stock.routes.js"
click node_screenerroutes "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/routes/screener.routes.js"
click node_sectorroute "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/routes/sector.routes.js"
click node_newsroute "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/routes/news.routes.js"
click node_newscontroller "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/controllers/news.controller.js"
click node_reportroutes "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/routes/dailyReport.routes.js"
click node_reportservice "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/services/dailyReport.service.js"
click node_scheduler "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/services/dailyReport.scheduler.js"
click node_authmiddleware "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/middleware/auth.js"
click node_marketproxy "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/utils/marketService.js"
click node_users "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/models/User.js"
click node_portfolio "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/models/Portfolio.js"
click node_reports "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/models/DailyReport.js"
click node_marketapi "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/market-service/main.py"
click node_screenerlogic "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/market-service/Services/screener.py"
click node_advisorlogic "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/market-service/Services/advisor.py"
click node_sectorlogic "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/market-service/Services/sector_setup.py"
click node_cagr "https://github.com/veeramani-elumalai/visalpha-capital/blob/main/market-service/Services/cagr.py"

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_authui,node_dashboard,node_screenerui,node_compareui,node_sectorui,node_advisorui,node_reportui,node_newsui,node_api_client,node_screener_client toneBlue
class node_express,node_authroutes,node_portfolioroutes,node_stockroutes,node_screenerroutes,node_sectorroute,node_newsroute,node_newscontroller,node_reportroutes,node_reportservice,node_scheduler,node_authmiddleware,node_marketproxy toneAmber
class node_marketapi,node_screenerlogic,node_advisorlogic,node_sectorlogic,node_cagr toneMint
class node_users,node_portfolio,node_reports toneRose
class node_yfinance,node_investor toneIndigo
```

## Components

### Investor client

- [App routing](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/App.js): `client/src/App.js`
- [Sign-in and registration](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/pages/Login.js): `client/src/pages/Login.js`
- [Portfolio dashboard](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/pages/Dashboard.js): `client/src/pages/Dashboard.js`
- [Stock screener](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/pages/screener.js): `client/src/pages/screener.js`
- [Stock comparator](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/pages/Compare.js): `client/src/pages/Compare.js`
- [Sector analysis](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/pages/SectorAnalysis.js): `client/src/pages/SectorAnalysis.js`
- [AI stock advisor](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/pages/Advisor.js): `client/src/pages/Advisor.js`
- [Daily AI report](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/pages/DailyReport.js): `client/src/pages/DailyReport.js`
- [Market news](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/pages/News.js): `client/src/pages/News.js`
- [API client and session](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/services/api.js): `client/src/services/api.js`
- [Screener API service](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/client/src/services/screenerService.js): `client/src/services/screenerService.js`

### Backend API

- [Express API](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/server.js): `server/server.js`
- [Authentication routes](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/routes/auth.routes.js): `server/src/routes/auth.routes.js`
- [Portfolio operations](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/routes/portfolio.routes.js): `server/src/routes/portfolio.routes.js`
- [Stock endpoints](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/routes/stock.routes.js): `server/src/routes/stock.routes.js`
- [Screener endpoint](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/routes/screener.routes.js): `server/src/routes/screener.routes.js`
- [Sector endpoint](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/routes/sector.routes.js): `server/src/routes/sector.routes.js`
- [News endpoint](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/routes/news.routes.js): `server/src/routes/news.routes.js`
- [News aggregation](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/controllers/news.controller.js): `server/src/controllers/news.controller.js`
- [Daily report routes](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/routes/dailyReport.routes.js): `server/src/routes/dailyReport.routes.js`
- [Report orchestration](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/services/dailyReport.service.js): `server/src/services/dailyReport.service.js`
- [Report scheduler](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/services/dailyReport.scheduler.js): `server/src/services/dailyReport.scheduler.js`
- [JWT authorization](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/middleware/auth.js): `server/src/middleware/auth.js`
- [Market service proxy](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/utils/marketService.js): `server/src/utils/marketService.js`

### Market analytics

- [Market data API](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/market-service/main.py): `market-service/main.py`
- [Financial profiles and CAGR](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/market-service/Services/screener.py): `market-service/Services/screener.py`
- [Advisor scoring](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/market-service/Services/advisor.py): `market-service/Services/advisor.py`
- [Sector sweep](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/market-service/Services/sector_setup.py): `market-service/Services/sector_setup.py`
- [CAGR calculations](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/market-service/Services/cagr.py): `market-service/Services/cagr.py`

### Identity and state

- [User accounts](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/models/User.js): `server/src/models/User.js`
- [Portfolio store](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/models/Portfolio.js): `server/src/models/Portfolio.js`
- [Daily report store](https://github.com/veeramani-elumalai/visalpha-capital/blob/main/server/src/models/DailyReport.js): `server/src/models/DailyReport.js`

### External services

- **Yahoo Finance data**

### Other components

- **Investor**

## Connections

- Investor → App routing: uses (evidence: `client/src/App.js`)
- App routing → Portfolio dashboard: routes to (evidence: `client/src/App.js`)
- App routing → Sign-in and registration: routes to (evidence: `client/src/App.js`)
- App routing → Stock screener: routes to (evidence: `client/src/App.js`)
- App routing → Stock comparator: routes to (evidence: `client/src/App.js`)
- App routing → Sector analysis: routes to (evidence: `client/src/App.js`)
- App routing → AI stock advisor: routes to (evidence: `client/src/App.js`)
- App routing → Daily AI report: routes to (evidence: `client/src/App.js`)
- App routing → Market news: routes to (evidence: `client/src/App.js`)
- Sign-in and registration → API client and session: calls (evidence: `client/src/pages/Login.js`)
- Portfolio dashboard → API client and session: calls (evidence: `client/src/pages/Dashboard.js`)
- Daily AI report → API client and session: calls (evidence: `client/src/pages/DailyReport.js`)
- AI stock advisor → API client and session: calls (evidence: `client/src/pages/Advisor.js`)
- Stock comparator → Screener API service: calls (evidence: `client/src/pages/Compare.js`)
- Screener API service → API client and session: uses (evidence: `client/src/services/screenerService.js`)
- API client and session → Express API: requests (evidence: `README.md`)
- Express API → Authentication routes: mounts (evidence: `server/server.js`)
- Express API → Portfolio operations: mounts (evidence: `server/server.js`)
- Express API → Stock endpoints: mounts (evidence: `server/server.js`)
- Express API → Screener endpoint: mounts (evidence: `server/server.js`)
- Express API → Sector endpoint: mounts (evidence: `server/server.js`)
- Express API → News endpoint: mounts (evidence: `server/server.js`)
- Express API → Daily report routes: mounts (evidence: `server/server.js`)
- Authentication routes → User accounts: reads and writes (evidence: `server/src/routes/auth.routes.js`)
- Portfolio operations → JWT authorization: guards (evidence: `server/src/routes/portfolio.routes.js`)
- Portfolio operations → Portfolio store: reads and writes (evidence: `server/src/routes/portfolio.routes.js`)
- Portfolio operations → Market data API: requests prices and history (evidence: `server/src/routes/portfolio.routes.js`)
- Portfolio operations → Market service proxy: gets live prices (evidence: `server/src/routes/portfolio.routes.js`)
- Screener endpoint → Market data API: proxies profile request (evidence: `README.md`)
- Sector endpoint → Market data API: proxies sector request (evidence: `README.md`)
- News endpoint → News aggregation: dispatches (evidence: `README.md`)
- Daily report routes → JWT authorization: guards (evidence: `server/src/routes/dailyReport.routes.js`)
- Daily report routes → Report orchestration: calls (evidence: `server/src/routes/dailyReport.routes.js`)
- Express API → Report scheduler: starts (evidence: `server/server.js`)
- Report scheduler → Report orchestration: generates reports (evidence: `server/src/services/dailyReport.scheduler.js`)
- Report orchestration → Portfolio store: reads holdings (evidence: `server/src/services/dailyReport.service.js`)
- Report orchestration → Daily report store: reads and writes (evidence: `server/src/services/dailyReport.service.js`)
- Report orchestration → Market service proxy: gets live prices (evidence: `server/src/services/dailyReport.service.js`)
- Market service proxy → Market data API: requests prices (evidence: `server/src/utils/marketService.js`)
- Market data API → Financial profiles and CAGR: gets financials (evidence: `market-service/main.py`)
- Market data API → Advisor scoring: scores metrics (evidence: `market-service/main.py`)
- Market data API → Sector sweep: gets sector data (evidence: `market-service/main.py`)
- Market data API → CAGR calculations: imports calculation (evidence: `market-service/main.py`)
- Market data API → Yahoo Finance data: fetches market data (evidence: `market-service/main.py`)
- Report orchestration → News aggregation: fetches headlines
- Report orchestration → Yahoo Finance data: requests news and AI analysis
