# saladb4o/data-lake architecture

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

- Interactive diagram: https://gitdiagram.com/saladb4o/data-lake
- Repository: https://github.com/saladb4o/data-lake

## Overview

This repository appears to be a Vietnamese-equities research and analytics web application. Its user-facing entry point is a FastAPI server, with browser assets for dashboards and charts; the services cover market data, company analysis, valuation, forecasting, backtesting, and forensic signals. The excerpts explicitly show API dispatch to fair-value backtesting and monetary-policy retrieval, but do not establish most service wiring or frontend API calls. Those uncertain relationships are therefore omitted; several capabilities are represented by their exact service paths from the tree.

Main entry points: [`server.py`](https://github.com/saladb4o/data-lake/blob/main/server.py) (HTTP API), [`services/macro_monetary_service.py`](https://github.com/saladb4o/data-lake/blob/main/services/macro_monetary_service.py) (Monetary and macro), [`services/fair_value_backtest_service.py`](https://github.com/saladb4o/data-lake/blob/main/services/fair_value_backtest_service.py) (Fair-value backtests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and interface"]
  node_server["HTTP API<br/>[server.py]"]
  node_browser["Web interface<br/>[app.js]"]
  node_charts["Market charts<br/>[chart.js]"]
  node_treemap_ui["Market treemap<br/>[treemap.js]"]
end

subgraph group_market["Market intelligence"]
  node_market_data["Unified market data"]
  node_stock["Company data<br/>[stock_service.py]"]
  node_global_markets["Global markets"]
  node_macro["Monetary and macro"]
  node_sector["Sector rotation<br/>[rrg_service.py]"]
  node_treemap["Market treemap data<br/>[treemap_service.py]"]
  node_lake[("Financial filing lake<br/>[lake_store.py]")]
end

subgraph group_analysis["Company analysis"]
  node_valuation["Valuation and risk"]
  node_forecast["Three-statement forecast"]
  node_working_capital["Working capital"]
  node_debt["Debt and capital schedule"]
  node_forensics["Forensic intelligence"]
  node_ownership["Ownership analysis"]
  node_tunneling["Related-party analysis"]
end

subgraph group_research["Research and backtests"]
  node_smart_money["Smart-money flows"]
  node_commodities["Commodity spreads"]
  node_backtest["Fair-value backtests"]
  node_portfolio_backtest["Strategy backtests"]
end

node_user(("Investor"))

node_user -->|"sends requests"| node_server
node_server -->|"dispatches fair-value runs"| node_backtest
node_server -->|"retrieves monetary overview"| node_macro

click node_server "https://github.com/saladb4o/data-lake/blob/main/server.py"
click node_browser "https://github.com/saladb4o/data-lake/blob/main/static/js/app.js"
click node_charts "https://github.com/saladb4o/data-lake/blob/main/static/js/chart.js"
click node_treemap_ui "https://github.com/saladb4o/data-lake/blob/main/static/js/treemap.js"
click node_market_data "https://github.com/saladb4o/data-lake/blob/main/services/unified_data_service.py"
click node_stock "https://github.com/saladb4o/data-lake/blob/main/services/stock_service.py"
click node_global_markets "https://github.com/saladb4o/data-lake/blob/main/services/global_market_service.py"
click node_macro "https://github.com/saladb4o/data-lake/blob/main/services/macro_monetary_service.py"
click node_sector "https://github.com/saladb4o/data-lake/blob/main/services/rrg_service.py"
click node_treemap "https://github.com/saladb4o/data-lake/blob/main/services/treemap_service.py"
click node_lake "https://github.com/saladb4o/data-lake/blob/main/services/lake_store.py"
click node_valuation "https://github.com/saladb4o/data-lake/blob/main/services/valuation_engine.py"
click node_forecast "https://github.com/saladb4o/data-lake/blob/main/services/three_statement_engine.py"
click node_working_capital "https://github.com/saladb4o/data-lake/blob/main/services/working_capital_engine.py"
click node_debt "https://github.com/saladb4o/data-lake/blob/main/services/debt_capital_schedule_engine.py"
click node_forensics "https://github.com/saladb4o/data-lake/blob/main/services/forensic_intelligence_engine.py"
click node_ownership "https://github.com/saladb4o/data-lake/blob/main/services/cross_ownership_engine.py"
click node_tunneling "https://github.com/saladb4o/data-lake/blob/main/services/related_party_tunneling_engine.py"
click node_smart_money "https://github.com/saladb4o/data-lake/blob/main/services/smart_money_flow_engine.py"
click node_commodities "https://github.com/saladb4o/data-lake/blob/main/services/commodity_spread_engine.py"
click node_backtest "https://github.com/saladb4o/data-lake/blob/main/services/fair_value_backtest_service.py"
click node_portfolio_backtest "https://github.com/saladb4o/data-lake/blob/main/services/backtest_service.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_server,node_browser,node_charts,node_treemap_ui toneBlue
class node_market_data,node_stock,node_global_markets,node_macro,node_sector,node_treemap,node_lake toneAmber
class node_valuation,node_forecast,node_working_capital,node_debt,node_forensics,node_ownership,node_tunneling toneMint
class node_smart_money,node_commodities,node_backtest,node_portfolio_backtest toneRose
class node_user toneIndigo
```

## Components

### API and interface

- [HTTP API](https://github.com/saladb4o/data-lake/blob/main/server.py): `server.py`
- [Web interface](https://github.com/saladb4o/data-lake/blob/main/static/js/app.js): `static/js/app.js`
- [Market charts](https://github.com/saladb4o/data-lake/blob/main/static/js/chart.js): `static/js/chart.js`
- [Market treemap](https://github.com/saladb4o/data-lake/blob/main/static/js/treemap.js): `static/js/treemap.js`

### Market intelligence

- [Unified market data](https://github.com/saladb4o/data-lake/blob/main/services/unified_data_service.py): `services/unified_data_service.py`
- [Company data](https://github.com/saladb4o/data-lake/blob/main/services/stock_service.py): `services/stock_service.py`
- [Global markets](https://github.com/saladb4o/data-lake/blob/main/services/global_market_service.py): `services/global_market_service.py`
- [Monetary and macro](https://github.com/saladb4o/data-lake/blob/main/services/macro_monetary_service.py): `services/macro_monetary_service.py`
- [Sector rotation](https://github.com/saladb4o/data-lake/blob/main/services/rrg_service.py): `services/rrg_service.py`
- [Market treemap data](https://github.com/saladb4o/data-lake/blob/main/services/treemap_service.py): `services/treemap_service.py`
- [Financial filing lake](https://github.com/saladb4o/data-lake/blob/main/services/lake_store.py): `services/lake_store.py`

### Company analysis

- [Valuation and risk](https://github.com/saladb4o/data-lake/blob/main/services/valuation_engine.py): `services/valuation_engine.py`
- [Three-statement forecast](https://github.com/saladb4o/data-lake/blob/main/services/three_statement_engine.py): `services/three_statement_engine.py`
- [Working capital](https://github.com/saladb4o/data-lake/blob/main/services/working_capital_engine.py): `services/working_capital_engine.py`
- [Debt and capital schedule](https://github.com/saladb4o/data-lake/blob/main/services/debt_capital_schedule_engine.py): `services/debt_capital_schedule_engine.py`
- [Forensic intelligence](https://github.com/saladb4o/data-lake/blob/main/services/forensic_intelligence_engine.py): `services/forensic_intelligence_engine.py`
- [Ownership analysis](https://github.com/saladb4o/data-lake/blob/main/services/cross_ownership_engine.py): `services/cross_ownership_engine.py`
- [Related-party analysis](https://github.com/saladb4o/data-lake/blob/main/services/related_party_tunneling_engine.py): `services/related_party_tunneling_engine.py`

### Research and backtests

- [Smart-money flows](https://github.com/saladb4o/data-lake/blob/main/services/smart_money_flow_engine.py): `services/smart_money_flow_engine.py`
- [Commodity spreads](https://github.com/saladb4o/data-lake/blob/main/services/commodity_spread_engine.py): `services/commodity_spread_engine.py`
- [Fair-value backtests](https://github.com/saladb4o/data-lake/blob/main/services/fair_value_backtest_service.py): `services/fair_value_backtest_service.py`
- [Strategy backtests](https://github.com/saladb4o/data-lake/blob/main/services/backtest_service.py): `services/backtest_service.py`

### Other components

- **Investor**

## Connections

- Investor → HTTP API: sends requests
- HTTP API → Fair-value backtests: dispatches fair-value runs
- HTTP API → Monetary and macro: retrieves monetary overview
