# chkrishnamurthy/trade-signals architecture

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

- Interactive diagram: https://gitdiagram.com/chkrishnamurthy/trade-signals
- Repository: https://github.com/chkrishnamurthy/trade-signals

## Overview

EquityWise is an NSE-equity research and decision-support product: people explore market conditions, stocks, disclosures, and IPOs, while a scheduled worker collects and stores market data for the web app to present. Its admin-only intraday workflow evaluates market bars into signals and simulates them in paper portfolios; it does not place real orders. The graph preserves documented research, account, and portfolio capabilities, but source excerpts are limited, so only explicit README or indexed-source relationships are connected.

Main entry points: [`apps/web/src/app/layout.tsx`](https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/web/src/app/layout.tsx) (Research web app), [`apps/worker/src/context.ts`](https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/worker/src/context.ts) (Scheduled worker), [`packages/core/src/intraday/session.ts`](https://github.com/chkrishnamurthy/trade-signals/blob/main/packages/core/src/intraday/session.ts) (Intraday strategy), [`apps/worker/src/jobs/ingest-ipos.ts`](https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/worker/src/jobs/ingest-ipos.ts) (IPO collection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_research["Market research"]
  node_web["Research web app<br/>[layout.tsx]"]
  node_markets["Market views"]
  node_signals["Daily signals<br/>[engine.ts]"]
  node_screen["Stock screener<br/>[screener-view.tsx]"]
  node_watch["Watchlists"]
  node_flows["Disclosures and flows<br/>[flow-view.tsx]"]
  node_announcements["Announcement analysis"]
end

subgraph group_issuance["IPO intelligence"]
  node_ipoingest["IPO collection<br/>[ingest-ipos.ts]"]
  node_ipodata[("IPO records<br/>[ipos.ts]")]
  node_ipos["IPO research views"]
end

subgraph group_portfolio["Portfolio tools"]
  node_portfolio["Portfolio analysis<br/>[analysis-view.tsx]"]
  node_tax["Tax lots<br/>[tax.ts]"]
end

subgraph group_operations["Data and simulation"]
  node_worker["Scheduled worker<br/>[context.ts]"]
  node_dailyingest["Daily ingestion<br/>[ingest-daily.ts]"]
  node_disclosurejob["Disclosure ingestion"]
  node_intraday["Intraday strategy<br/>[session.ts]"]
  node_paper["Paper trading<br/>[paper.ts]"]
  node_db[("Postgres data store<br/>[client.ts]")]
  node_providers{{"Market data providers<br/>[routed.ts]"}}
  node_fyers{{"Fyers adapter<br/>[adapter.ts]"}}
  node_dhan{{"Dhan adapter<br/>[adapter.ts]"}}
end

subgraph group_identity["Accounts and access"]
  node_account["Authentication and accounts<br/>[session.ts]"]
  node_authapi["Account API<br/>[route.ts]"]
  node_admin["Admin controls<br/>[page.tsx]"]
end

node_user(("Investor"))

node_user -->|"explores"| node_web
node_web -->|"presents"| node_markets
node_web -.->|"presents"| node_screen
node_web -.->|"presents"| node_watch
node_web -.->|"presents"| node_flows
node_web -.->|"presents"| node_ipos
node_web -.->|"presents"| node_portfolio
node_worker -->|"schedules"| node_dailyingest
node_worker -.->|"schedules"| node_disclosurejob
node_worker -.->|"schedules"| node_ipoingest
node_worker -->|"configures"| node_providers
node_providers -->|"builds"| node_fyers
node_providers -->|"builds"| node_dhan
node_dailyingest -.->|"stores"| node_db
node_disclosurejob -->|"writes"| node_db
node_disclosurejob -->|"interprets"| node_announcements
node_ipoingest -->|"writes"| node_ipodata
node_ipoingest -->|"persists"| node_db
node_ipos -.->|"displays"| node_ipodata
node_intraday -->|"simulates"| node_paper
node_worker -->|"runs"| node_intraday
node_worker -->|"stores results"| node_paper
node_web -->|"reads signals"| node_intraday
node_web -->|"reads simulation"| node_paper
node_signals -.->|"informs"| node_markets
node_user -.->|"signs in"| node_account
node_account -->|"serves"| node_authapi
node_admin -->|"restricts access"| node_intraday
node_portfolio -.->|"supports"| node_tax

click node_web "https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/web/src/app/layout.tsx"
click node_markets "https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/web/src/components/market-brief/market-brief-view.tsx"
click node_signals "https://github.com/chkrishnamurthy/trade-signals/blob/main/packages/core/src/signals/engine.ts"
click node_screen "https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/web/src/components/screener/screener-view.tsx"
click node_watch "https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/web/src/components/watchlists/watchlists-page.tsx"
click node_flows "https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/web/src/components/disclosures/flow-view.tsx"
click node_announcements "https://github.com/chkrishnamurthy/trade-signals/blob/main/packages/core/src/announcement-interpretation.ts"
click node_ipoingest "https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/worker/src/jobs/ingest-ipos.ts"
click node_ipodata "https://github.com/chkrishnamurthy/trade-signals/blob/main/packages/db/src/schema/ipos.ts"
click node_ipos "https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/web/src/components/ipos/pipeline/ipo-pipeline-view.tsx"
click node_portfolio "https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/web/src/components/portfolio/analysis-view.tsx"
click node_tax "https://github.com/chkrishnamurthy/trade-signals/blob/main/packages/core/src/portfolio/tax.ts"
click node_worker "https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/worker/src/context.ts"
click node_dailyingest "https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/worker/src/jobs/ingest-daily.ts"
click node_disclosurejob "https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/worker/src/jobs/ingest-disclosures.ts"
click node_intraday "https://github.com/chkrishnamurthy/trade-signals/blob/main/packages/core/src/intraday/session.ts"
click node_paper "https://github.com/chkrishnamurthy/trade-signals/blob/main/packages/shared/src/paper.ts"
click node_db "https://github.com/chkrishnamurthy/trade-signals/blob/main/packages/db/src/client.ts"
click node_providers "https://github.com/chkrishnamurthy/trade-signals/blob/main/packages/market-data/src/routed.ts"
click node_fyers "https://github.com/chkrishnamurthy/trade-signals/blob/main/packages/providers-fyers/src/adapter.ts"
click node_dhan "https://github.com/chkrishnamurthy/trade-signals/blob/main/packages/providers-dhan/src/adapter.ts"
click node_account "https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/web/src/server/auth/session.ts"
click node_authapi "https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/web/src/app/api/account/route.ts"
click node_admin "https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/web/src/app/admin/page.tsx"

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_web,node_markets,node_signals,node_screen,node_watch,node_flows,node_announcements toneBlue
class node_ipoingest,node_ipodata,node_ipos toneAmber
class node_portfolio,node_tax toneMint
class node_worker,node_dailyingest,node_disclosurejob,node_intraday,node_paper,node_db,node_providers,node_fyers,node_dhan toneRose
class node_account,node_authapi,node_admin,node_user toneIndigo
```

## Components

### Market research

- [Research web app](https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/web/src/app/layout.tsx): `apps/web/src/app/layout.tsx`
- [Market views](https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/web/src/components/market-brief/market-brief-view.tsx): `apps/web/src/components/market-brief/market-brief-view.tsx`
- [Daily signals](https://github.com/chkrishnamurthy/trade-signals/blob/main/packages/core/src/signals/engine.ts): `packages/core/src/signals/engine.ts`
- [Stock screener](https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/web/src/components/screener/screener-view.tsx): `apps/web/src/components/screener/screener-view.tsx`
- [Watchlists](https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/web/src/components/watchlists/watchlists-page.tsx): `apps/web/src/components/watchlists/watchlists-page.tsx`
- [Disclosures and flows](https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/web/src/components/disclosures/flow-view.tsx): `apps/web/src/components/disclosures/flow-view.tsx`
- [Announcement analysis](https://github.com/chkrishnamurthy/trade-signals/blob/main/packages/core/src/announcement-interpretation.ts): `packages/core/src/announcement-interpretation.ts`

### IPO intelligence

- [IPO collection](https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/worker/src/jobs/ingest-ipos.ts): `apps/worker/src/jobs/ingest-ipos.ts`
- [IPO records](https://github.com/chkrishnamurthy/trade-signals/blob/main/packages/db/src/schema/ipos.ts): `packages/db/src/schema/ipos.ts`
- [IPO research views](https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/web/src/components/ipos/pipeline/ipo-pipeline-view.tsx): `apps/web/src/components/ipos/pipeline/ipo-pipeline-view.tsx`

### Portfolio tools

- [Portfolio analysis](https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/web/src/components/portfolio/analysis-view.tsx): `apps/web/src/components/portfolio/analysis-view.tsx`
- [Tax lots](https://github.com/chkrishnamurthy/trade-signals/blob/main/packages/core/src/portfolio/tax.ts): `packages/core/src/portfolio/tax.ts`

### Data and simulation

- [Scheduled worker](https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/worker/src/context.ts): `apps/worker/src/context.ts`
- [Daily ingestion](https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/worker/src/jobs/ingest-daily.ts): `apps/worker/src/jobs/ingest-daily.ts`
- [Disclosure ingestion](https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/worker/src/jobs/ingest-disclosures.ts): `apps/worker/src/jobs/ingest-disclosures.ts`
- [Intraday strategy](https://github.com/chkrishnamurthy/trade-signals/blob/main/packages/core/src/intraday/session.ts): `packages/core/src/intraday/session.ts`
- [Paper trading](https://github.com/chkrishnamurthy/trade-signals/blob/main/packages/shared/src/paper.ts): `packages/shared/src/paper.ts`
- [Postgres data store](https://github.com/chkrishnamurthy/trade-signals/blob/main/packages/db/src/client.ts): `packages/db/src/client.ts`
- [Market data providers](https://github.com/chkrishnamurthy/trade-signals/blob/main/packages/market-data/src/routed.ts): `packages/market-data/src/routed.ts`
- [Fyers adapter](https://github.com/chkrishnamurthy/trade-signals/blob/main/packages/providers-fyers/src/adapter.ts): `packages/providers-fyers/src/adapter.ts`
- [Dhan adapter](https://github.com/chkrishnamurthy/trade-signals/blob/main/packages/providers-dhan/src/adapter.ts): `packages/providers-dhan/src/adapter.ts`

### Accounts and access

- [Authentication and accounts](https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/web/src/server/auth/session.ts): `apps/web/src/server/auth/session.ts`
- [Account API](https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/web/src/app/api/account/route.ts): `apps/web/src/app/api/account/route.ts`
- [Admin controls](https://github.com/chkrishnamurthy/trade-signals/blob/main/apps/web/src/app/admin/page.tsx): `apps/web/src/app/admin/page.tsx`

### Other components

- **Investor**

## Connections

- Investor → Research web app: explores
- Research web app → Market views: presents
- Research web app → Stock screener: presents
- Research web app → Watchlists: presents
- Research web app → Disclosures and flows: presents
- Research web app → IPO research views: presents
- Research web app → Portfolio analysis: presents
- Scheduled worker → Daily ingestion: schedules
- Scheduled worker → Disclosure ingestion: schedules (evidence: `apps/worker/src/jobs/ingest-disclosures.ts`)
- Scheduled worker → IPO collection: schedules (evidence: `apps/worker/src/jobs/ingest-ipos.ts`)
- Scheduled worker → Market data providers: configures (evidence: `apps/worker/src/context.ts`)
- Market data providers → Fyers adapter: builds
- Market data providers → Dhan adapter: builds
- Daily ingestion → Postgres data store: stores
- Disclosure ingestion → Postgres data store: writes (evidence: `apps/worker/src/jobs/ingest-disclosures.ts`)
- Disclosure ingestion → Announcement analysis: interprets (evidence: `apps/worker/src/jobs/ingest-disclosures.ts`)
- IPO collection → IPO records: writes (evidence: `apps/worker/src/jobs/ingest-ipos.ts`)
- IPO collection → Postgres data store: persists (evidence: `apps/worker/src/jobs/ingest-ipos.ts`)
- IPO research views → IPO records: displays
- Intraday strategy → Paper trading: simulates
- Scheduled worker → Intraday strategy: runs
- Scheduled worker → Paper trading: stores results
- Research web app → Intraday strategy: reads signals
- Research web app → Paper trading: reads simulation
- Daily signals → Market views: informs
- Investor → Authentication and accounts: signs in
- Authentication and accounts → Account API: serves (evidence: `apps/web/src/app/api/account/route.ts`)
- Admin controls → Intraday strategy: restricts access
- Portfolio analysis → Tax lots: supports
