# thomasfilemon/idx architecture

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

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

## Overview

Thomas IDX Lab is an Indonesian stock-market analytics platform: users explore a market snapshot, then search a ticker and inspect historical prices and indicators through a browser backed by a REST API. The repository also retains the upstream CLI and MCP interfaces, broader analytics, provider integrations, and KSEI ownership-data workflows. The README documents the browser/API/provider flow; source-index references and module documentation support several internal relationships. Some API routing and frontend request details were not sampled, so those links are omitted or marked unverified.

Main entry points: [`src/service.rs`](https://github.com/thomasfilemon/idx/blob/main/src/service.rs) (Shared services), [`src/providers/mod.rs`](https://github.com/thomasfilemon/idx/blob/main/src/providers/mod.rs) (Provider selection), [`src/http/mod.rs`](https://github.com/thomasfilemon/idx/blob/main/src/http/mod.rs) (HTTP and cache), [`web/public/dashboard/app.mjs`](https://github.com/thomasfilemon/idx/blob/main/web/public/dashboard/app.mjs) (Web dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User interfaces"]
  node_dashboard["Web dashboard<br/>[app.mjs]"]
  node_chart["Price charts"]
  node_cli["CLI<br/>[mod.rs]"]
  node_mcp["MCP tools<br/>[mod.rs]"]
  node_render["CLI output<br/>[mod.rs]"]
end

subgraph group_runtime["API and domain"]
  node_rest["REST API<br/>[idx-api.rs]"]
  node_service["Shared services<br/>[service.rs]"]
  node_analysis["Market analysis<br/>[bandar.rs]"]
  node_domain["Domain models<br/>[mod.rs]"]
  node_astro["Astrology analysis<br/>[mod.rs]"]
end

subgraph group_sources["Market data"]
  node_provider["Provider selection<br/>[mod.rs]"]
  node_yahoo["Yahoo data<br/>[mod.rs]"]
  node_idx["IDX data<br/>[mod.rs]"]
  node_ipot["IPOT data<br/>[mod.rs]"]
  node_stockbit["Stockbit data<br/>[mod.rs]"]
  node_fetch["HTTP and cache<br/>[mod.rs]"]
  node_cache[("Response cache<br/>[mod.rs]")]
end

subgraph group_ownership["Ownership data"]
  node_ownership["Ownership workflows<br/>[mod.rs]"]
  node_ingest["Register ingestion<br/>[ingest.rs]"]
  node_snapshot["Ownership snapshots<br/>[snapshot.rs]"]
end

node_visitor(("Market user"))

node_visitor -->|"explores market"| node_dashboard
node_dashboard -->|"requests data"| node_rest
node_dashboard -->|"renders history"| node_chart
node_rest -.->|"dispatches to"| node_service
node_service -->|"requests observations"| node_provider
node_service -->|"uses analysis"| node_analysis
node_provider -->|"selects source"| node_yahoo
node_provider -->|"selects source"| node_idx
node_provider -->|"selects source"| node_ipot
node_provider -->|"selects source"| node_stockbit
node_yahoo -->|"fetches data"| node_fetch
node_idx -->|"fetches data"| node_fetch
node_ipot -->|"fetches data"| node_fetch
node_stockbit -->|"fetches data"| node_fetch
node_fetch -->|"reads and writes"| node_cache
node_cli -->|"shares operations"| node_service
node_mcp -->|"shares operations"| node_service
node_cli -->|"formats results"| node_render
node_service -->|"returns domain data"| node_domain
node_ownership -->|"parses reports"| node_ingest
node_ownership -->|"serves published copy"| node_snapshot
node_service -->|"uses ownership data"| node_ownership

click node_dashboard "https://github.com/thomasfilemon/idx/blob/main/web/public/dashboard/app.mjs"
click node_chart "https://github.com/thomasfilemon/idx/blob/main/web/public/dashboard/financial-chart.mjs"
click node_rest "https://github.com/thomasfilemon/idx/blob/main/src/bin/idx-api.rs"
click node_service "https://github.com/thomasfilemon/idx/blob/main/src/service.rs"
click node_analysis "https://github.com/thomasfilemon/idx/blob/main/src/analysis/bandar.rs"
click node_domain "https://github.com/thomasfilemon/idx/blob/main/src/model/mod.rs"
click node_cli "https://github.com/thomasfilemon/idx/blob/main/src/cli/mod.rs"
click node_mcp "https://github.com/thomasfilemon/idx/blob/main/src/mcp/mod.rs"
click node_render "https://github.com/thomasfilemon/idx/blob/main/src/output/mod.rs"
click node_provider "https://github.com/thomasfilemon/idx/blob/main/src/providers/mod.rs"
click node_yahoo "https://github.com/thomasfilemon/idx/blob/main/src/providers/yahoo/mod.rs"
click node_idx "https://github.com/thomasfilemon/idx/blob/main/src/providers/idx/mod.rs"
click node_ipot "https://github.com/thomasfilemon/idx/blob/main/src/providers/ipot/mod.rs"
click node_stockbit "https://github.com/thomasfilemon/idx/blob/main/src/providers/stockbit/mod.rs"
click node_fetch "https://github.com/thomasfilemon/idx/blob/main/src/http/mod.rs"
click node_cache "https://github.com/thomasfilemon/idx/blob/main/src/cache/mod.rs"
click node_ownership "https://github.com/thomasfilemon/idx/blob/main/src/ownership/mod.rs"
click node_ingest "https://github.com/thomasfilemon/idx/blob/main/src/ownership/ingest.rs"
click node_snapshot "https://github.com/thomasfilemon/idx/blob/main/src/ownership/snapshot.rs"
click node_astro "https://github.com/thomasfilemon/idx/blob/main/src/astro/mod.rs"

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_dashboard,node_chart,node_cli,node_mcp,node_render,node_visitor toneBlue
class node_rest,node_service,node_analysis,node_domain,node_astro toneAmber
class node_provider,node_yahoo,node_idx,node_ipot,node_stockbit,node_fetch,node_cache toneMint
class node_ownership,node_ingest,node_snapshot toneRose
```

## Components

### User interfaces

- [Web dashboard](https://github.com/thomasfilemon/idx/blob/main/web/public/dashboard/app.mjs): `web/public/dashboard/app.mjs`
- [Price charts](https://github.com/thomasfilemon/idx/blob/main/web/public/dashboard/financial-chart.mjs): `web/public/dashboard/financial-chart.mjs`
- [CLI](https://github.com/thomasfilemon/idx/blob/main/src/cli/mod.rs): `src/cli/mod.rs`
- [MCP tools](https://github.com/thomasfilemon/idx/blob/main/src/mcp/mod.rs): `src/mcp/mod.rs`
- [CLI output](https://github.com/thomasfilemon/idx/blob/main/src/output/mod.rs): `src/output/mod.rs`

### API and domain

- [REST API](https://github.com/thomasfilemon/idx/blob/main/src/bin/idx-api.rs): `src/bin/idx-api.rs`
- [Shared services](https://github.com/thomasfilemon/idx/blob/main/src/service.rs): `src/service.rs`
- [Market analysis](https://github.com/thomasfilemon/idx/blob/main/src/analysis/bandar.rs): `src/analysis/bandar.rs`
- [Domain models](https://github.com/thomasfilemon/idx/blob/main/src/model/mod.rs): `src/model/mod.rs`
- [Astrology analysis](https://github.com/thomasfilemon/idx/blob/main/src/astro/mod.rs): `src/astro/mod.rs`

### Market data

- [Provider selection](https://github.com/thomasfilemon/idx/blob/main/src/providers/mod.rs): `src/providers/mod.rs`
- [Yahoo data](https://github.com/thomasfilemon/idx/blob/main/src/providers/yahoo/mod.rs): `src/providers/yahoo/mod.rs`
- [IDX data](https://github.com/thomasfilemon/idx/blob/main/src/providers/idx/mod.rs): `src/providers/idx/mod.rs`
- [IPOT data](https://github.com/thomasfilemon/idx/blob/main/src/providers/ipot/mod.rs): `src/providers/ipot/mod.rs`
- [Stockbit data](https://github.com/thomasfilemon/idx/blob/main/src/providers/stockbit/mod.rs): `src/providers/stockbit/mod.rs`
- [HTTP and cache](https://github.com/thomasfilemon/idx/blob/main/src/http/mod.rs): `src/http/mod.rs`
- [Response cache](https://github.com/thomasfilemon/idx/blob/main/src/cache/mod.rs): `src/cache/mod.rs`

### Ownership data

- [Ownership workflows](https://github.com/thomasfilemon/idx/blob/main/src/ownership/mod.rs): `src/ownership/mod.rs`
- [Register ingestion](https://github.com/thomasfilemon/idx/blob/main/src/ownership/ingest.rs): `src/ownership/ingest.rs`
- [Ownership snapshots](https://github.com/thomasfilemon/idx/blob/main/src/ownership/snapshot.rs): `src/ownership/snapshot.rs`

### Other components

- **Market user**

## Connections

- Market user → Web dashboard: explores market (evidence: `README.md`)
- Web dashboard → REST API: requests data (evidence: `README.md`)
- Web dashboard → Price charts: renders history (evidence: `web/public/dashboard/app.mjs`)
- REST API → Shared services: dispatches to
- Shared services → Provider selection: requests observations (evidence: `src/service.rs`)
- Shared services → Market analysis: uses analysis (evidence: `src/service.rs`)
- Provider selection → Yahoo data: selects source (evidence: `src/providers/mod.rs`)
- Provider selection → IDX data: selects source (evidence: `src/providers/mod.rs`)
- Provider selection → IPOT data: selects source (evidence: `src/providers/mod.rs`)
- Provider selection → Stockbit data: selects source (evidence: `src/providers/mod.rs`)
- Yahoo data → HTTP and cache: fetches data (evidence: `src/providers/yahoo/mod.rs`)
- IDX data → HTTP and cache: fetches data (evidence: `src/providers/idx/mod.rs`)
- IPOT data → HTTP and cache: fetches data (evidence: `src/providers/ipot/mod.rs`)
- Stockbit data → HTTP and cache: fetches data (evidence: `src/providers/stockbit/mod.rs`)
- HTTP and cache → Response cache: reads and writes (evidence: `src/http/mod.rs`)
- CLI → Shared services: shares operations (evidence: `src/service.rs`)
- MCP tools → Shared services: shares operations (evidence: `src/mcp/mod.rs`)
- CLI → CLI output: formats results (evidence: `src/cli/mod.rs`)
- Shared services → Domain models: returns domain data (evidence: `src/service.rs`)
- Ownership workflows → Register ingestion: parses reports (evidence: `src/ownership/mod.rs`)
- Ownership workflows → Ownership snapshots: serves published copy (evidence: `src/ownership/mod.rs`)
- Shared services → Ownership workflows: uses ownership data (evidence: `src/service.rs`)
