# atabeyaydi/bist-algotrading-stockanalysis architecture

> Architecture diagram of the GitHub repository atabeyaydi/bist-algotrading-stockanalysis, 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/atabeyaydi/bist-algotrading-stockanalysis
- Repository: https://github.com/atabeyaydi/bist-algotrading-stockanalysis

## Overview

BIST Analysis Pro presents bilingual market intelligence and simulated forecasts, alongside live BIST stock quotes and historical charts. Users enter through the single-page app, explore the analysis or stock list, and can open a symbol chart; stock data requests pass through tRPC to market procedures, which consult caches/database or Yahoo Finance. README capabilities such as PESTEL/SWOT narratives and forecast horizons are represented by documented client modules, but their internal wiring is not shown. Several page and data-module implementations were not sampled, so edges into them are omitted where callers are unverified.

Main entry points: [`client/src/App.tsx`](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/App.tsx) (App routes), [`server/_core/index.ts`](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/server/_core/index.ts) (Express server), [`server/routers/market.ts`](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/server/routers/market.ts) (Market procedures), [`server/db.ts`](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/server/db.ts) (Database access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_bootstrap["Client bootstrap<br/>[main.tsx]"]
  node_routes["App routes<br/>[App.tsx]"]
  node_trpcclient["tRPC client<br/>[trpc.ts]"]
end

subgraph group_market["Market intelligence"]
  node_analysis["Bilingual analysis<br/>[Home.tsx]"]
  node_stocklist["Stock explorer<br/>[Stocks.tsx]"]
  node_stockchart["Stock charts<br/>[StockChart.tsx]"]
  node_content["Analysis content<br/>[bistContent.ts]"]
  node_forecast["Forecast simulation<br/>[bistForecast.ts]"]
  node_marketdata["Market data helpers<br/>[bistMarketData.ts]"]
  node_commodities["Commodity coverage<br/>[bistCommodities.ts]"]
  node_indicator["Indicator studio"]
  node_chat["AI chat<br/>[AIChatBox.tsx]"]
end

subgraph group_api["API and identity"]
  node_server["Express server<br/>[index.ts]"]
  node_approot["API router<br/>[routers.ts]"]
  node_marketrouter["Market procedures<br/>[market.ts]"]
  node_auth["OAuth and sessions<br/>[oauth.ts]"]
  node_context["Request context<br/>[context.ts]"]
  node_system["System procedures<br/>[systemRouter.ts]"]
  node_notify["Owner notifications<br/>[notification.ts]"]
end

subgraph group_data["Persistence and providers"]
  node_catalog["BIST symbol catalog<br/>[bist100.ts]"]
  node_database[("MySQL market store<br/>[schema.ts]")]
  node_dbaccess["Database access<br/>[db.ts]"]
  node_yahoo["Yahoo Finance<br/>[yahooFinance.ts]"]
end

node_visitor(("Market visitor"))
node_externalfinance["Yahoo market feed"]
node_identityprovider["OAuth provider"]
node_databasehost[("MySQL database")]
node_storage["Storage proxy"]

node_visitor -->|"opens app"| node_bootstrap
node_bootstrap -->|"renders"| node_routes
node_routes -->|"routes to"| node_analysis
node_routes -->|"routes to"| node_stocklist
node_routes -->|"routes to"| node_stockchart
node_analysis -.->|"uses content"| node_content
node_analysis -.->|"uses simulation"| node_forecast
node_stocklist -.->|"requests data"| node_trpcclient
node_stockchart -.->|"requests data"| node_trpcclient
node_indicator -.->|"uses helpers"| node_marketdata
node_chat -.->|"requests service"| node_trpcclient
node_trpcclient -->|"calls API"| node_server
node_server -->|"mounts router"| node_approot
node_approot -->|"registers"| node_marketrouter
node_server -->|"registers OAuth"| node_auth
node_server -->|"creates context"| node_context
node_approot -->|"registers"| node_system
node_system -->|"calls"| node_notify
node_marketrouter -->|"looks up symbols"| node_catalog
node_marketrouter -->|"fetches quotes/history"| node_yahoo
node_yahoo -.->|"fetches market data"| node_externalfinance
node_marketrouter -->|"reads and writes"| node_dbaccess
node_dbaccess -->|"uses schema"| node_database
node_database -.->|"stores records"| node_databasehost
node_auth -->|"reads and upserts users"| node_dbaccess
node_auth -.->|"authenticates"| node_identityprovider
node_dbaccess -.->|"uploads and retrieves"| node_storage

click node_bootstrap "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/main.tsx"
click node_routes "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/App.tsx"
click node_analysis "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/pages/Home.tsx"
click node_stocklist "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/pages/Stocks.tsx"
click node_stockchart "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/pages/StockChart.tsx"
click node_content "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/lib/bistContent.ts"
click node_forecast "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/lib/bistForecast.ts"
click node_marketdata "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/lib/bistMarketData.ts"
click node_commodities "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/lib/bistCommodities.ts"
click node_indicator "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/components/IndicatorStudio.tsx"
click node_chat "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/components/AIChatBox.tsx"
click node_trpcclient "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/lib/trpc.ts"
click node_server "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/server/_core/index.ts"
click node_approot "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/server/routers.ts"
click node_marketrouter "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/server/routers/market.ts"
click node_auth "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/server/_core/oauth.ts"
click node_context "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/server/_core/context.ts"
click node_system "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/server/_core/systemRouter.ts"
click node_notify "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/server/_core/notification.ts"
click node_catalog "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/shared/bist100.ts"
click node_database "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/drizzle/schema.ts"
click node_dbaccess "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/server/db.ts"
click node_yahoo "https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/server/services/yahooFinance.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_bootstrap,node_routes,node_trpcclient toneBlue
class node_analysis,node_stocklist,node_stockchart,node_content,node_forecast,node_marketdata,node_commodities,node_indicator,node_chat,node_databasehost,node_storage toneAmber
class node_server,node_approot,node_marketrouter,node_auth,node_context,node_system,node_notify toneMint
class node_catalog,node_database,node_dbaccess,node_yahoo toneRose
class node_visitor,node_externalfinance,node_identityprovider toneIndigo
```

## Components

### Client experience

- [Client bootstrap](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/main.tsx): `client/src/main.tsx`
- [App routes](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [tRPC client](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/lib/trpc.ts): `client/src/lib/trpc.ts`

### Market intelligence

- [Bilingual analysis](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/pages/Home.tsx): `client/src/pages/Home.tsx`
- [Stock explorer](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/pages/Stocks.tsx): `client/src/pages/Stocks.tsx`
- [Stock charts](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/pages/StockChart.tsx): `client/src/pages/StockChart.tsx`
- [Analysis content](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/lib/bistContent.ts): `client/src/lib/bistContent.ts`
- [Forecast simulation](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/lib/bistForecast.ts): `client/src/lib/bistForecast.ts`
- [Market data helpers](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/lib/bistMarketData.ts): `client/src/lib/bistMarketData.ts`
- [Commodity coverage](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/lib/bistCommodities.ts): `client/src/lib/bistCommodities.ts`
- [Indicator studio](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/components/IndicatorStudio.tsx): `client/src/components/IndicatorStudio.tsx`
- [AI chat](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/client/src/components/AIChatBox.tsx): `client/src/components/AIChatBox.tsx`

### API and identity

- [Express server](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/server/_core/index.ts): `server/_core/index.ts`
- [API router](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/server/routers.ts): `server/routers.ts`
- [Market procedures](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/server/routers/market.ts): `server/routers/market.ts`
- [OAuth and sessions](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/server/_core/oauth.ts): `server/_core/oauth.ts`
- [Request context](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/server/_core/context.ts): `server/_core/context.ts`
- [System procedures](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/server/_core/systemRouter.ts): `server/_core/systemRouter.ts`
- [Owner notifications](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/server/_core/notification.ts): `server/_core/notification.ts`

### Persistence and providers

- [BIST symbol catalog](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/shared/bist100.ts): `shared/bist100.ts`
- [MySQL market store](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/drizzle/schema.ts): `drizzle/schema.ts`
- [Database access](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/server/db.ts): `server/db.ts`
- [Yahoo Finance](https://github.com/atabeyaydi/bist-algotrading-stockanalysis/blob/main/server/services/yahooFinance.ts): `server/services/yahooFinance.ts`

### Other components

- **Market visitor**
- **Yahoo market feed**
- **OAuth provider**
- **MySQL database**
- **Storage proxy**

## Connections

- Market visitor → Client bootstrap: opens app (evidence: `client/src/main.tsx`)
- Client bootstrap → App routes: renders (evidence: `client/src/main.tsx`)
- App routes → Bilingual analysis: routes to (evidence: `client/src/App.tsx`)
- App routes → Stock explorer: routes to (evidence: `client/src/App.tsx`)
- App routes → Stock charts: routes to (evidence: `client/src/App.tsx`)
- Bilingual analysis → Analysis content: uses content
- Bilingual analysis → Forecast simulation: uses simulation
- Stock explorer → tRPC client: requests data
- Stock charts → tRPC client: requests data
- Indicator studio → Market data helpers: uses helpers
- AI chat → tRPC client: requests service
- tRPC client → Express server: calls API
- Express server → API router: mounts router (evidence: `server/_core/index.ts`)
- API router → Market procedures: registers (evidence: `server/routers.ts`)
- Express server → OAuth and sessions: registers OAuth (evidence: `server/_core/index.ts`)
- Express server → Request context: creates context (evidence: `server/_core/index.ts`)
- API router → System procedures: registers (evidence: `server/routers.ts`)
- System procedures → Owner notifications: calls (evidence: `server/_core/systemRouter.ts`)
- Market procedures → BIST symbol catalog: looks up symbols (evidence: `server/routers/market.ts`)
- Market procedures → Yahoo Finance: fetches quotes/history (evidence: `server/routers/market.ts`)
- Yahoo Finance → Yahoo market feed: fetches market data
- Market procedures → Database access: reads and writes (evidence: `server/routers/market.ts`)
- Database access → MySQL market store: uses schema (evidence: `server/db.ts`)
- MySQL market store → MySQL database: stores records
- OAuth and sessions → Database access: reads and upserts users (evidence: `server/_core/oauth.ts`)
- OAuth and sessions → OAuth provider: authenticates
- Database access → Storage proxy: uploads and retrieves
