# nichsedge/idx-bei architecture

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

- Interactive diagram: https://gitdiagram.com/nichsedge/idx-bei
- Repository: https://github.com/nichsedge/idx-bei

## Overview

IDX-BEI is a data-collection and quantitative-analysis toolkit for Indonesian equities, with command-line, REST/WebSocket, dashboard, and MCP interfaces. Its main workflow collects IDX market and company data, ingests and stores it as time series and Parquet exports, then serves analysis such as screening, signals, backtests, dividends, and ownership graphs. The React dashboard presents those capabilities and can trigger ingestion. The README documents additional screens and interfaces not visible in sampled implementation excerpts; their exact wiring is therefore represented only where documented, not as speculative internal call chains.

Main entry points: [`python/src/idx/cli.py`](https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/cli.py) (CLI Commands), [`python/src/idx/core/query.py`](https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/core/query.py) (DuckDB Query Layer), [`python/src/idx/api.py`](https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/api.py) (REST & WebSocket API), [`python/src/idx/ingestion.py`](https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/ingestion.py) (Ingestion & Backfill)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Collection &amp; Ingestion"]
  node_scrapers["IDX Scrapers"]
  node_http["IDX HTTP Client<br/>[client.py]"]
  node_ingestion["Ingestion &amp; Backfill<br/>[ingestion.py]"]
  node_daily["Daily Pipeline<br/>[daily.py]"]
end

subgraph group_storage["Storage &amp; Query"]
  node_parquet_export["Parquet Export<br/>[parquet.py]"]
  node_timeseries[("Time-Series Store<br/>[timeseries.py]")]
  node_query["DuckDB Query Layer<br/>[query.py]"]
end

subgraph group_analysis["Quantitative Analysis"]
  node_backtest["Strategy Backtester<br/>[backtest.py]"]
  node_signals["Decision Signals<br/>[signals.py]"]
  node_dividend["Dividend Analysis<br/>[dividend.py]"]
  node_compounder["Compounder Screener<br/>[compounder.py]"]
  node_ownership["Ownership Graph<br/>[graph.py]"]
end

subgraph group_interfaces["User Interfaces"]
  node_cli["CLI Commands<br/>[cli.py]"]
  node_api["REST &amp; WebSocket API<br/>[api.py]"]
  node_dashboard["React Dashboard<br/>[App.tsx]"]
  node_api_service["Frontend API Client<br/>[api.ts]"]
  node_stream_service["Live Stream Client<br/>[websocket.ts]"]
  node_ingestion_ui["Ingestion Controls<br/>[IngestionTab.tsx]"]
  node_mcp["MCP Tool Server<br/>[server.py]"]
end

subgraph group_integration["External Integrations"]
  node_webhook{{"Notification Webhooks"}}
  node_neo4j[("Neo4j Graph Database")]
end

node_user(("Investor / Analyst"))
node_idx{{"IDX Data Services"}}
node_assistant(("AI Assistant"))

node_user -->|"runs commands"| node_cli
node_cli -->|"dispatches jobs"| node_ingestion
node_cli -->|"runs strategies"| node_backtest
node_cli -->|"builds briefings"| node_signals
node_cli -->|"analyzes dividends"| node_dividend
node_cli -->|"screens companies"| node_compounder
node_cli -->|"runs graph analysis"| node_ownership
node_scrapers -->|"requests IDX data"| node_http
node_http -->|"fetches data"| node_idx
node_ingestion -->|"runs daily jobs"| node_daily
node_daily -->|"collects market data"| node_scrapers
node_ingestion -->|"exports backfills"| node_parquet_export
node_parquet_export -->|"writes partitions"| node_timeseries
node_ingestion -->|"checks coverage"| node_timeseries
node_query -->|"reads partitions"| node_timeseries
node_backtest -->|"queries history"| node_query
node_signals -->|"queries market data"| node_query
node_dividend -->|"queries market data"| node_query
node_compounder -->|"queries fundamentals"| node_query
node_ownership -.->|"analyzes network"| node_neo4j
node_user -->|"uses dashboard"| node_dashboard
node_dashboard -->|"loads data"| node_api_service
node_api_service -->|"calls REST endpoints"| node_api
node_dashboard -->|"subscribes to stream"| node_stream_service
node_stream_service -->|"opens WebSocket"| node_api
node_api -->|"queries datasets"| node_query
node_api -->|"serves analysis"| node_signals
node_api -->|"serves analysis"| node_dividend
node_dashboard -->|"shows ingestion controls"| node_ingestion_ui
node_ingestion_ui -->|"requests job status"| node_api_service
node_ingestion_ui -->|"triggers jobs"| node_api_service
node_api -->|"starts background jobs"| node_ingestion
node_assistant -->|"invokes tools"| node_mcp
node_mcp -->|"queries time series"| node_query
node_mcp -->|"builds briefing"| node_signals
node_mcp -->|"queries holdings"| node_ownership
node_signals -.->|"broadcasts summary"| node_webhook

click node_scrapers "https://github.com/nichsedge/idx-bei/tree/main/python/src/idx/scrapers"
click node_http "https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/core/client.py"
click node_ingestion "https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/ingestion.py"
click node_daily "https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/pipelines/daily.py"
click node_parquet_export "https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/pipelines/parquet.py"
click node_timeseries "https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/core/timeseries.py"
click node_query "https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/core/query.py"
click node_cli "https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/cli.py"
click node_api "https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/api.py"
click node_dashboard "https://github.com/nichsedge/idx-bei/blob/main/frontend/src/App.tsx"
click node_api_service "https://github.com/nichsedge/idx-bei/blob/main/frontend/src/services/api.ts"
click node_stream_service "https://github.com/nichsedge/idx-bei/blob/main/frontend/src/services/websocket.ts"
click node_ingestion_ui "https://github.com/nichsedge/idx-bei/blob/main/frontend/src/components/IngestionTab.tsx"
click node_backtest "https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/backtest.py"
click node_signals "https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/signals.py"
click node_dividend "https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/dividend.py"
click node_compounder "https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/compounder.py"
click node_ownership "https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/graph.py"
click node_mcp "https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/mcp/server.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_scrapers,node_http,node_ingestion,node_daily toneBlue
class node_parquet_export,node_timeseries,node_query toneAmber
class node_backtest,node_signals,node_dividend,node_compounder,node_ownership toneMint
class node_cli,node_api,node_dashboard,node_api_service,node_stream_service,node_ingestion_ui,node_mcp toneRose
class node_webhook,node_neo4j,node_user,node_idx,node_assistant toneIndigo
```

## Components

### Collection & Ingestion

- [IDX Scrapers](https://github.com/nichsedge/idx-bei/tree/main/python/src/idx/scrapers): `python/src/idx/scrapers`
- [IDX HTTP Client](https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/core/client.py): `python/src/idx/core/client.py`
- [Ingestion & Backfill](https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/ingestion.py): `python/src/idx/ingestion.py`
- [Daily Pipeline](https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/pipelines/daily.py): `python/src/idx/pipelines/daily.py`

### Storage & Query

- [Parquet Export](https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/pipelines/parquet.py): `python/src/idx/pipelines/parquet.py`
- [Time-Series Store](https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/core/timeseries.py): `python/src/idx/core/timeseries.py`
- [DuckDB Query Layer](https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/core/query.py): `python/src/idx/core/query.py`

### Quantitative Analysis

- [Strategy Backtester](https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/backtest.py): `python/src/idx/backtest.py`
- [Decision Signals](https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/signals.py): `python/src/idx/signals.py`
- [Dividend Analysis](https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/dividend.py): `python/src/idx/dividend.py`
- [Compounder Screener](https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/compounder.py): `python/src/idx/compounder.py`
- [Ownership Graph](https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/graph.py): `python/src/idx/graph.py`

### User Interfaces

- [CLI Commands](https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/cli.py): `python/src/idx/cli.py`
- [REST & WebSocket API](https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/api.py): `python/src/idx/api.py`
- [React Dashboard](https://github.com/nichsedge/idx-bei/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Frontend API Client](https://github.com/nichsedge/idx-bei/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`
- [Live Stream Client](https://github.com/nichsedge/idx-bei/blob/main/frontend/src/services/websocket.ts): `frontend/src/services/websocket.ts`
- [Ingestion Controls](https://github.com/nichsedge/idx-bei/blob/main/frontend/src/components/IngestionTab.tsx): `frontend/src/components/IngestionTab.tsx`
- [MCP Tool Server](https://github.com/nichsedge/idx-bei/blob/main/python/src/idx/mcp/server.py): `python/src/idx/mcp/server.py`

### External Integrations

- **Notification Webhooks**
- **Neo4j Graph Database**

### Other components

- **Investor / Analyst**
- **IDX Data Services**
- **AI Assistant**

## Connections

- Investor / Analyst → CLI Commands: runs commands
- CLI Commands → Ingestion & Backfill: dispatches jobs
- CLI Commands → Strategy Backtester: runs strategies
- CLI Commands → Decision Signals: builds briefings
- CLI Commands → Dividend Analysis: analyzes dividends
- CLI Commands → Compounder Screener: screens companies
- CLI Commands → Ownership Graph: runs graph analysis
- IDX Scrapers → IDX HTTP Client: requests IDX data
- IDX HTTP Client → IDX Data Services: fetches data
- Ingestion & Backfill → Daily Pipeline: runs daily jobs
- Daily Pipeline → IDX Scrapers: collects market data
- Ingestion & Backfill → Parquet Export: exports backfills
- Parquet Export → Time-Series Store: writes partitions
- Ingestion & Backfill → Time-Series Store: checks coverage
- DuckDB Query Layer → Time-Series Store: reads partitions
- Strategy Backtester → DuckDB Query Layer: queries history
- Decision Signals → DuckDB Query Layer: queries market data
- Dividend Analysis → DuckDB Query Layer: queries market data
- Compounder Screener → DuckDB Query Layer: queries fundamentals
- Ownership Graph → Neo4j Graph Database: analyzes network
- Investor / Analyst → React Dashboard: uses dashboard
- React Dashboard → Frontend API Client: loads data
- Frontend API Client → REST & WebSocket API: calls REST endpoints
- React Dashboard → Live Stream Client: subscribes to stream
- Live Stream Client → REST & WebSocket API: opens WebSocket
- REST & WebSocket API → DuckDB Query Layer: queries datasets
- REST & WebSocket API → Decision Signals: serves analysis
- REST & WebSocket API → Dividend Analysis: serves analysis
- React Dashboard → Ingestion Controls: shows ingestion controls
- Ingestion Controls → Frontend API Client: requests job status
- Ingestion Controls → Frontend API Client: triggers jobs
- REST & WebSocket API → Ingestion & Backfill: starts background jobs
- AI Assistant → MCP Tool Server: invokes tools
- MCP Tool Server → DuckDB Query Layer: queries time series
- MCP Tool Server → Decision Signals: builds briefing
- MCP Tool Server → Ownership Graph: queries holdings
- Decision Signals → Notification Webhooks: broadcasts summary
