# hirdeshpal888527/vantage architecture

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

- Interactive diagram: https://gitdiagram.com/hirdeshpal888527/vantage
- Repository: https://github.com/hirdeshpal888527/vantage

## Overview

Vantage is an A/B experimentation platform with a dual-write feature store. Experiment owners design tests through the dashboard or API; the API sizes experiments, assigns users, records metric events, and computes monitored results. A separate feature workflow registers and writes features, then serves online or point-in-time offline lookups. The README documents PostgreSQL and Redis roles; sampled code confirms the statistical modules and their API use. Some API internals were omitted from excerpts, so the graph avoids inferring their unshown wiring.

Main entry points: [`api/main.py`](https://github.com/hirdeshpal888527/vantage/blob/main/api/main.py) (FastAPI Service), [`api/feature_store.py`](https://github.com/hirdeshpal888527/vantage/blob/main/api/feature_store.py) (Feature Store), [`dashboard/app.py`](https://github.com/hirdeshpal888527/vantage/blob/main/dashboard/app.py) (Streamlit Dashboard), [`api/assignment.py`](https://github.com/hirdeshpal888527/vantage/blob/main/api/assignment.py) (Variant Assignment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User Interfaces"]
  node_dashboard["Streamlit Dashboard<br/>[app.py]"]
  node_api["FastAPI Service<br/>[main.py]"]
end

subgraph group_experiments["Experiment Runtime"]
  node_experiment_design["Experiment Design<br/>[main.py]"]
  node_assignment["Variant Assignment<br/>[assignment.py]"]
  node_event_tracking["Metric Tracking<br/>[main.py]"]
  node_results["Experiment Results<br/>[main.py]"]
end

subgraph group_statistics["Statistical Methods"]
  node_power["Power Analysis<br/>[power_analysis.py]"]
  node_srm["SRM Check<br/>[assignment.py]"]
  node_sequential["Sequential Test"]
  node_cuped["CUPED Adjustment<br/>[cuped.py]"]
  node_bootstrap["Bootstrap Intervals<br/>[bootstrap.py]"]
end

subgraph group_features["Feature Store"]
  node_feature_api["Feature Endpoints<br/>[main.py]"]
  node_feature_store["Feature Store<br/>[feature_store.py]"]
end

subgraph group_storage["Data Stores"]
  node_postgres[("PostgreSQL")]
  node_redis[("Redis")]
end

node_owner(("Experiment Owner"))

node_owner -->|"uses"| node_dashboard
node_owner -->|"calls"| node_api
node_dashboard -->|"requests"| node_api
node_api -->|"handles"| node_experiment_design
node_experiment_design -->|"computes size"| node_power
node_experiment_design -->|"writes experiment"| node_postgres
node_api -->|"assigns users"| node_assignment
node_assignment -->|"stores assignment"| node_postgres
node_api -->|"handles events"| node_event_tracking
node_event_tracking -->|"writes events"| node_postgres
node_api -->|"computes results"| node_results
node_results -->|"reads experiment data"| node_postgres
node_results -->|"checks split"| node_srm
node_results -->|"tests outcomes"| node_sequential
node_results -->|"adjusts metrics"| node_cuped
node_results -->|"estimates intervals"| node_bootstrap
node_api -->|"serves features"| node_feature_api
node_feature_api -->|"delegates"| node_feature_store
node_feature_store -->|"writes history"| node_postgres
node_feature_store -->|"writes cache"| node_redis
node_feature_store -->|"reads online"| node_redis
node_feature_store -->|"queries as-of"| node_postgres

click node_dashboard "https://github.com/hirdeshpal888527/vantage/blob/main/dashboard/app.py"
click node_api "https://github.com/hirdeshpal888527/vantage/blob/main/api/main.py"
click node_experiment_design "https://github.com/hirdeshpal888527/vantage/blob/main/api/main.py"
click node_power "https://github.com/hirdeshpal888527/vantage/blob/main/stats/power_analysis.py"
click node_assignment "https://github.com/hirdeshpal888527/vantage/blob/main/api/assignment.py"
click node_event_tracking "https://github.com/hirdeshpal888527/vantage/blob/main/api/main.py"
click node_results "https://github.com/hirdeshpal888527/vantage/blob/main/api/main.py"
click node_srm "https://github.com/hirdeshpal888527/vantage/blob/main/api/assignment.py"
click node_sequential "https://github.com/hirdeshpal888527/vantage/blob/main/stats/sequential_testing.py"
click node_cuped "https://github.com/hirdeshpal888527/vantage/blob/main/stats/cuped.py"
click node_bootstrap "https://github.com/hirdeshpal888527/vantage/blob/main/stats/bootstrap.py"
click node_feature_api "https://github.com/hirdeshpal888527/vantage/blob/main/api/main.py"
click node_feature_store "https://github.com/hirdeshpal888527/vantage/blob/main/api/feature_store.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_dashboard,node_api toneBlue
class node_experiment_design,node_assignment,node_event_tracking,node_results toneAmber
class node_power,node_srm,node_sequential,node_cuped,node_bootstrap toneMint
class node_feature_api,node_feature_store toneRose
class node_postgres,node_redis,node_owner toneIndigo
```

## Components

### User Interfaces

- [Streamlit Dashboard](https://github.com/hirdeshpal888527/vantage/blob/main/dashboard/app.py): `dashboard/app.py`
- [FastAPI Service](https://github.com/hirdeshpal888527/vantage/blob/main/api/main.py): `api/main.py`

### Experiment Runtime

- [Experiment Design](https://github.com/hirdeshpal888527/vantage/blob/main/api/main.py): `api/main.py`
- [Variant Assignment](https://github.com/hirdeshpal888527/vantage/blob/main/api/assignment.py): `api/assignment.py`
- [Metric Tracking](https://github.com/hirdeshpal888527/vantage/blob/main/api/main.py): `api/main.py`
- [Experiment Results](https://github.com/hirdeshpal888527/vantage/blob/main/api/main.py): `api/main.py`

### Statistical Methods

- [Power Analysis](https://github.com/hirdeshpal888527/vantage/blob/main/stats/power_analysis.py): `stats/power_analysis.py`
- [SRM Check](https://github.com/hirdeshpal888527/vantage/blob/main/api/assignment.py): `api/assignment.py`
- [Sequential Test](https://github.com/hirdeshpal888527/vantage/blob/main/stats/sequential_testing.py): `stats/sequential_testing.py`
- [CUPED Adjustment](https://github.com/hirdeshpal888527/vantage/blob/main/stats/cuped.py): `stats/cuped.py`
- [Bootstrap Intervals](https://github.com/hirdeshpal888527/vantage/blob/main/stats/bootstrap.py): `stats/bootstrap.py`

### Feature Store

- [Feature Endpoints](https://github.com/hirdeshpal888527/vantage/blob/main/api/main.py): `api/main.py`
- [Feature Store](https://github.com/hirdeshpal888527/vantage/blob/main/api/feature_store.py): `api/feature_store.py`

### Data Stores

- **PostgreSQL**
- **Redis**

### Other components

- **Experiment Owner**

## Connections

- Experiment Owner → Streamlit Dashboard: uses (evidence: `README.md`)
- Experiment Owner → FastAPI Service: calls (evidence: `README.md`)
- Streamlit Dashboard → FastAPI Service: requests (evidence: `dashboard/app.py`)
- FastAPI Service → Experiment Design: handles (evidence: `api/main.py`)
- Experiment Design → Power Analysis: computes size (evidence: `api/main.py`)
- Experiment Design → PostgreSQL: writes experiment (evidence: `api/main.py`)
- FastAPI Service → Variant Assignment: assigns users (evidence: `api/main.py`)
- Variant Assignment → PostgreSQL: stores assignment
- FastAPI Service → Metric Tracking: handles events (evidence: `api/main.py`)
- Metric Tracking → PostgreSQL: writes events (evidence: `api/main.py`)
- FastAPI Service → Experiment Results: computes results (evidence: `api/main.py`)
- Experiment Results → PostgreSQL: reads experiment data (evidence: `api/main.py`)
- Experiment Results → SRM Check: checks split (evidence: `api/main.py`)
- Experiment Results → Sequential Test: tests outcomes (evidence: `api/main.py`)
- Experiment Results → CUPED Adjustment: adjusts metrics (evidence: `api/main.py`)
- Experiment Results → Bootstrap Intervals: estimates intervals (evidence: `api/main.py`)
- FastAPI Service → Feature Endpoints: serves features (evidence: `api/main.py`)
- Feature Endpoints → Feature Store: delegates (evidence: `api/main.py`)
- Feature Store → PostgreSQL: writes history (evidence: `api/feature_store.py`)
- Feature Store → Redis: writes cache (evidence: `api/feature_store.py`)
- Feature Store → Redis: reads online (evidence: `api/feature_store.py`)
- Feature Store → PostgreSQL: queries as-of (evidence: `api/feature_store.py`)
