# jundizhou/easy-stock architecture

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

- Interactive diagram: https://gitdiagram.com/jundizhou/easy-stock
- Repository: https://github.com/jundizhou/easy-stock

## Overview

easy-stock is a local-first A-share investing research desktop app. Users enter through the desktop workbench, choose a research workspace, and use its frontend API client to request market context, analysis, and AI-assisted reports; review and research records can be retained locally. The README also describes author-review automation, portfolio inspection, trading methodology, and an AI copilot. Source excerpts establish frontend navigation and API-client usage, but do not show backend route wiring, so those connections are marked unverified rather than asserted.

Main entry points: [`frontend/src/App.tsx`](https://github.com/jundizhou/easy-stock/blob/main/frontend/src/App.tsx) (Research workbench), [`frontend/src/lib/backend.ts`](https://github.com/jundizhou/easy-stock/blob/main/frontend/src/lib/backend.ts) (Backend API client), [`backend/internal/httpapi/server.go`](https://github.com/jundizhou/easy-stock/blob/main/backend/internal/httpapi/server.go) (Backend HTTP API), [`frontend/src/components/MarketOverviewWorkspace.tsx`](https://github.com/jundizhou/easy-stock/blob/main/frontend/src/components/MarketOverviewWorkspace.tsx) (Market overview)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Desktop experience"]
  node_app["Research workbench<br/>[App.tsx]"]
  node_api_client["Backend API client<br/>[backend.ts]"]
  node_backend_api["Backend HTTP API<br/>[server.go]"]
end

subgraph group_market["Market intelligence"]
  node_market_ui["Market overview"]
  node_market_views["Market data views"]
  node_market_logic["Market data model<br/>[market-overview.ts]"]
  node_limit_ui["Limit-up analysis"]
  node_short_term["Short-term signals<br/>[short-term.ts]"]
  node_theme_radar["Trend theme radar<br/>[theme.ts]"]
  node_market_sources["Market data providers"]
end

subgraph group_research["Stock research"]
  node_stock_ui["Stock AI analysis"]
  node_research_report["Research report"]
  node_research_client["Research requests<br/>[stock-research.ts]"]
  node_portfolio_ui["Portfolio inspection"]
  node_portfolio_service["Portfolio analysis<br/>[service.go]"]
end

subgraph group_memory["Review and memory"]
  node_reviews_ui["Review journal<br/>[ReviewDiary.tsx]"]
  node_review_service["Review automation<br/>[daily_summary.go]"]
  node_methodology["Trading methodology<br/>[library.go]"]
  node_local_records[("Local research records<br/>[research_store.go]")]
end

subgraph group_ai["AI and services"]
  node_chat_ui["AI copilot"]
  node_agent_service["Agent runtime<br/>[service.go]"]
  node_stock_engine["Stock analysis engine<br/>[engine.go]"]
end

node_investor(("Investor"))

node_investor -->|"opens"| node_app
node_app -->|"selects workspace"| node_market_ui
node_app -->|"selects workspace"| node_limit_ui
node_app -->|"selects workspace"| node_stock_ui
node_app -->|"selects workspace"| node_portfolio_ui
node_app -->|"selects workspace"| node_reviews_ui
node_app -->|"selects workspace"| node_chat_ui
node_market_ui -->|"requests data"| node_api_client
node_market_ui -->|"renders views"| node_market_views
node_market_ui -->|"uses data model"| node_market_logic
node_limit_ui -->|"requests data"| node_api_client
node_stock_ui -.->|"requests analysis"| node_api_client
node_stock_ui -.->|"presents report"| node_research_report
node_research_report -->|"uses research helpers"| node_research_client
node_portfolio_ui -->|"requests inspection"| node_api_client
node_reviews_ui -->|"requests review data"| node_api_client
node_chat_ui -->|"sends requests"| node_api_client
node_api_client -.->|"HTTP requests"| node_backend_api
node_backend_api -.->|"fetches market data"| node_market_sources
node_backend_api -.->|"dispatches analysis"| node_stock_engine
node_backend_api -.->|"dispatches inspection"| node_portfolio_service
node_backend_api -.->|"dispatches summaries"| node_review_service
node_backend_api -.->|"dispatches AI tasks"| node_agent_service
node_stock_engine -.->|"stores research"| node_local_records
node_reviews_ui -.->|"generates consensus"| node_review_service
node_chat_ui -.->|"runs copilot tasks"| node_agent_service
node_methodology -.->|"informs AI research"| node_agent_service

click node_app "https://github.com/jundizhou/easy-stock/blob/main/frontend/src/App.tsx"
click node_api_client "https://github.com/jundizhou/easy-stock/blob/main/frontend/src/lib/backend.ts"
click node_market_ui "https://github.com/jundizhou/easy-stock/blob/main/frontend/src/components/MarketOverviewWorkspace.tsx"
click node_market_views "https://github.com/jundizhou/easy-stock/blob/main/frontend/src/components/market/MarketDataViews.tsx"
click node_market_logic "https://github.com/jundizhou/easy-stock/blob/main/frontend/src/lib/market-overview.ts"
click node_limit_ui "https://github.com/jundizhou/easy-stock/blob/main/frontend/src/components/LimitUpWorkspace.tsx"
click node_short_term "https://github.com/jundizhou/easy-stock/blob/main/frontend/src/lib/short-term.ts"
click node_theme_radar "https://github.com/jundizhou/easy-stock/blob/main/frontend/src/lib/theme.ts"
click node_stock_ui "https://github.com/jundizhou/easy-stock/blob/main/frontend/src/components/StockAIAnalysisWorkspace.tsx"
click node_research_report "https://github.com/jundizhou/easy-stock/blob/main/frontend/src/components/StockResearchReport.tsx"
click node_research_client "https://github.com/jundizhou/easy-stock/blob/main/frontend/src/lib/stock-research.ts"
click node_portfolio_ui "https://github.com/jundizhou/easy-stock/blob/main/frontend/src/components/PortfolioInspectionWorkspace.tsx"
click node_portfolio_service "https://github.com/jundizhou/easy-stock/blob/main/backend/internal/portfolioinspection/service.go"
click node_reviews_ui "https://github.com/jundizhou/easy-stock/blob/main/frontend/src/components/ReviewDiary.tsx"
click node_review_service "https://github.com/jundizhou/easy-stock/blob/main/backend/internal/review/daily_summary.go"
click node_methodology "https://github.com/jundizhou/easy-stock/blob/main/backend/internal/methodology/library.go"
click node_local_records "https://github.com/jundizhou/easy-stock/blob/main/backend/internal/stockanalysis/research_store.go"
click node_chat_ui "https://github.com/jundizhou/easy-stock/blob/main/frontend/src/components/AIChatWorkspace.tsx"
click node_agent_service "https://github.com/jundizhou/easy-stock/blob/main/backend/internal/agent/service.go"
click node_stock_engine "https://github.com/jundizhou/easy-stock/blob/main/backend/internal/stockanalysis/engine.go"
click node_market_sources "https://github.com/jundizhou/easy-stock/tree/main/backend/internal/providers"
click node_backend_api "https://github.com/jundizhou/easy-stock/blob/main/backend/internal/httpapi/server.go"

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_api_client,node_backend_api toneBlue
class node_market_ui,node_market_views,node_market_logic,node_limit_ui,node_short_term,node_theme_radar,node_market_sources toneAmber
class node_stock_ui,node_research_report,node_research_client,node_portfolio_ui,node_portfolio_service toneMint
class node_reviews_ui,node_review_service,node_methodology,node_local_records toneRose
class node_chat_ui,node_agent_service,node_stock_engine,node_investor toneIndigo
```

## Components

### Desktop experience

- [Research workbench](https://github.com/jundizhou/easy-stock/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Backend API client](https://github.com/jundizhou/easy-stock/blob/main/frontend/src/lib/backend.ts): `frontend/src/lib/backend.ts`
- [Backend HTTP API](https://github.com/jundizhou/easy-stock/blob/main/backend/internal/httpapi/server.go): `backend/internal/httpapi/server.go`

### Market intelligence

- [Market overview](https://github.com/jundizhou/easy-stock/blob/main/frontend/src/components/MarketOverviewWorkspace.tsx): `frontend/src/components/MarketOverviewWorkspace.tsx`
- [Market data views](https://github.com/jundizhou/easy-stock/blob/main/frontend/src/components/market/MarketDataViews.tsx): `frontend/src/components/market/MarketDataViews.tsx`
- [Market data model](https://github.com/jundizhou/easy-stock/blob/main/frontend/src/lib/market-overview.ts): `frontend/src/lib/market-overview.ts`
- [Limit-up analysis](https://github.com/jundizhou/easy-stock/blob/main/frontend/src/components/LimitUpWorkspace.tsx): `frontend/src/components/LimitUpWorkspace.tsx`
- [Short-term signals](https://github.com/jundizhou/easy-stock/blob/main/frontend/src/lib/short-term.ts): `frontend/src/lib/short-term.ts`
- [Trend theme radar](https://github.com/jundizhou/easy-stock/blob/main/frontend/src/lib/theme.ts): `frontend/src/lib/theme.ts`
- [Market data providers](https://github.com/jundizhou/easy-stock/tree/main/backend/internal/providers): `backend/internal/providers`

### Stock research

- [Stock AI analysis](https://github.com/jundizhou/easy-stock/blob/main/frontend/src/components/StockAIAnalysisWorkspace.tsx): `frontend/src/components/StockAIAnalysisWorkspace.tsx`
- [Research report](https://github.com/jundizhou/easy-stock/blob/main/frontend/src/components/StockResearchReport.tsx): `frontend/src/components/StockResearchReport.tsx`
- [Research requests](https://github.com/jundizhou/easy-stock/blob/main/frontend/src/lib/stock-research.ts): `frontend/src/lib/stock-research.ts`
- [Portfolio inspection](https://github.com/jundizhou/easy-stock/blob/main/frontend/src/components/PortfolioInspectionWorkspace.tsx): `frontend/src/components/PortfolioInspectionWorkspace.tsx`
- [Portfolio analysis](https://github.com/jundizhou/easy-stock/blob/main/backend/internal/portfolioinspection/service.go): `backend/internal/portfolioinspection/service.go`

### Review and memory

- [Review journal](https://github.com/jundizhou/easy-stock/blob/main/frontend/src/components/ReviewDiary.tsx): `frontend/src/components/ReviewDiary.tsx`
- [Review automation](https://github.com/jundizhou/easy-stock/blob/main/backend/internal/review/daily_summary.go): `backend/internal/review/daily_summary.go`
- [Trading methodology](https://github.com/jundizhou/easy-stock/blob/main/backend/internal/methodology/library.go): `backend/internal/methodology/library.go`
- [Local research records](https://github.com/jundizhou/easy-stock/blob/main/backend/internal/stockanalysis/research_store.go): `backend/internal/stockanalysis/research_store.go`

### AI and services

- [AI copilot](https://github.com/jundizhou/easy-stock/blob/main/frontend/src/components/AIChatWorkspace.tsx): `frontend/src/components/AIChatWorkspace.tsx`
- [Agent runtime](https://github.com/jundizhou/easy-stock/blob/main/backend/internal/agent/service.go): `backend/internal/agent/service.go`
- [Stock analysis engine](https://github.com/jundizhou/easy-stock/blob/main/backend/internal/stockanalysis/engine.go): `backend/internal/stockanalysis/engine.go`

### Other components

- **Investor**

## Connections

- Investor → Research workbench: opens (evidence: `frontend/src/App.tsx`)
- Research workbench → Market overview: selects workspace (evidence: `frontend/src/App.tsx`)
- Research workbench → Limit-up analysis: selects workspace (evidence: `frontend/src/App.tsx`)
- Research workbench → Stock AI analysis: selects workspace (evidence: `frontend/src/App.tsx`)
- Research workbench → Portfolio inspection: selects workspace (evidence: `frontend/src/App.tsx`)
- Research workbench → Review journal: selects workspace (evidence: `frontend/src/App.tsx`)
- Research workbench → AI copilot: selects workspace (evidence: `frontend/src/App.tsx`)
- Market overview → Backend API client: requests data (evidence: `frontend/src/components/MarketOverviewWorkspace.tsx`)
- Market overview → Market data views: renders views (evidence: `frontend/src/components/MarketOverviewWorkspace.tsx`)
- Market overview → Market data model: uses data model (evidence: `frontend/src/components/MarketOverviewWorkspace.tsx`)
- Limit-up analysis → Backend API client: requests data (evidence: `frontend/src/components/LimitUpWorkspace.tsx`)
- Stock AI analysis → Backend API client: requests analysis
- Stock AI analysis → Research report: presents report
- Research report → Research requests: uses research helpers (evidence: `frontend/src/components/StockResearchReport.tsx`)
- Portfolio inspection → Backend API client: requests inspection (evidence: `frontend/src/components/PortfolioInspectionWorkspace.tsx`)
- Review journal → Backend API client: requests review data (evidence: `frontend/src/components/ReviewDiary.tsx`)
- AI copilot → Backend API client: sends requests (evidence: `frontend/src/components/AIChatWorkspace.tsx`)
- Backend API client → Backend HTTP API: HTTP requests
- Backend HTTP API → Market data providers: fetches market data
- Backend HTTP API → Stock analysis engine: dispatches analysis
- Backend HTTP API → Portfolio analysis: dispatches inspection
- Backend HTTP API → Review automation: dispatches summaries
- Backend HTTP API → Agent runtime: dispatches AI tasks
- Stock analysis engine → Local research records: stores research
- Review journal → Review automation: generates consensus
- AI copilot → Agent runtime: runs copilot tasks
- Trading methodology → Agent runtime: informs AI research
