# shlokaloni282/perigee architecture

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

- Interactive diagram: https://gitdiagram.com/shlokaloni282/perigee
- Repository: https://github.com/shlokaloni282/perigee

## Overview

Perigee turns simulated satellite telemetry into flagged anomalies, serves readings and summaries through a Django API, and presents them in a React mission-control dashboard. An operator can request an anomaly briefing: the API invokes an agent that searches and filters web evidence, asks Gemini to analyze the selected sources, and may perform one follow-up search. The README documents the detection and search capabilities; sampled source confirms key API, UI, and agent calls. Some subsystem wiring is documented rather than shown in source excerpts.

Main entry points: [`frontend/src/App.jsx`](https://github.com/shlokaloni282/perigee/blob/main/frontend/src/App.jsx) (Dashboard App), [`agent/orchestrator.py`](https://github.com/shlokaloni282/perigee/blob/main/agent/orchestrator.py) (Briefing Orchestrator), [`backend/telemetry/views.py`](https://github.com/shlokaloni282/perigee/blob/main/backend/telemetry/views.py) (Django API Views), [`agent/searcher.py`](https://github.com/shlokaloni282/perigee/blob/main/agent/searcher.py) (Search and Filtering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_detection["Telemetry Detection"]
  node_generator["Telemetry Generator"]
  node_detector["Anomaly Detector"]
end

subgraph group_backend["Telemetry API"]
  node_readings[("Telemetry Store<br/>[models.py]")]
  node_serializer["Reading Serializer<br/>[serializers.py]"]
  node_api["Django API Views<br/>[views.py]"]
end

subgraph group_frontend["Dashboard"]
  node_client["Telemetry API Client<br/>[telemetry.js]"]
  node_app["Dashboard App<br/>[App.jsx]"]
  node_stats["Stats Cards<br/>[StatsCards.jsx]"]
  node_trend["Telemetry Trends"]
  node_orbit["Orbit Illustration"]
  node_breakdown["Anomaly Breakdown"]
  node_table["Anomaly Review<br/>[AnomalyTable.jsx]"]
  node_backdrop["Space Backdrop<br/>[SpaceBackdrop.jsx]"]
end

subgraph group_agent["Evidence Agent"]
  node_orchestrator["Briefing Orchestrator<br/>[orchestrator.py]"]
  node_search["Search and Filtering<br/>[searcher.py]"]
  node_credibility["Source Credibility<br/>[credibility.py]"]
  node_analysis["LLM Analysis<br/>[llm.py]"]
end

node_operator(("Satellite Operator"))
node_serpapi["SerpApi Search"]
node_gemini["Gemini"]

node_generator -->|"generates input for"| node_detector
node_detector -->|"stores flagged readings"| node_readings
node_api -->|"queries"| node_readings
node_api -->|"serializes readings"| node_serializer
node_serializer -->|"serializes model"| node_readings
node_client -->|"requests data"| node_api
node_app -->|"loads dashboard data"| node_client
node_app -->|"renders"| node_stats
node_app -->|"renders"| node_trend
node_app -->|"renders"| node_orbit
node_app -->|"renders"| node_breakdown
node_app -->|"renders"| node_table
node_app -->|"renders"| node_backdrop
node_table -->|"requests briefing"| node_client
node_operator -.->|"reviews anomalies"| node_table
node_api -->|"requests explanation"| node_orchestrator
node_orchestrator -->|"gathers evidence"| node_search
node_orchestrator -->|"analyzes sources"| node_analysis
node_search -->|"labels sources"| node_credibility
node_search -->|"searches web"| node_serpapi
node_analysis -->|"generates analysis"| node_gemini
node_orchestrator -->|"runs follow-up"| node_search
node_orchestrator -->|"returns briefing"| node_api

click node_generator "https://github.com/shlokaloni282/perigee/blob/main/ml/data/generate_telemetry.py"
click node_detector "https://github.com/shlokaloni282/perigee/blob/main/ml/models/anomaly_detector.py"
click node_readings "https://github.com/shlokaloni282/perigee/blob/main/backend/telemetry/models.py"
click node_serializer "https://github.com/shlokaloni282/perigee/blob/main/backend/telemetry/serializers.py"
click node_api "https://github.com/shlokaloni282/perigee/blob/main/backend/telemetry/views.py"
click node_client "https://github.com/shlokaloni282/perigee/blob/main/frontend/src/api/telemetry.js"
click node_app "https://github.com/shlokaloni282/perigee/blob/main/frontend/src/App.jsx"
click node_stats "https://github.com/shlokaloni282/perigee/blob/main/frontend/src/components/StatsCards.jsx"
click node_trend "https://github.com/shlokaloni282/perigee/blob/main/frontend/src/components/TelemetryLineChart.jsx"
click node_orbit "https://github.com/shlokaloni282/perigee/blob/main/frontend/src/components/OrbitSimulation.jsx"
click node_breakdown "https://github.com/shlokaloni282/perigee/blob/main/frontend/src/components/AnomalyBarChart.jsx"
click node_table "https://github.com/shlokaloni282/perigee/blob/main/frontend/src/components/AnomalyTable.jsx"
click node_backdrop "https://github.com/shlokaloni282/perigee/blob/main/frontend/src/components/SpaceBackdrop.jsx"
click node_orchestrator "https://github.com/shlokaloni282/perigee/blob/main/agent/orchestrator.py"
click node_search "https://github.com/shlokaloni282/perigee/blob/main/agent/searcher.py"
click node_credibility "https://github.com/shlokaloni282/perigee/blob/main/agent/credibility.py"
click node_analysis "https://github.com/shlokaloni282/perigee/blob/main/agent/llm.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_generator,node_detector toneBlue
class node_readings,node_serializer,node_api toneAmber
class node_client,node_app,node_stats,node_trend,node_orbit,node_breakdown,node_table,node_backdrop,node_serpapi toneMint
class node_orchestrator,node_search,node_credibility,node_analysis toneRose
class node_operator,node_gemini toneIndigo
```

## Components

### Telemetry Detection

- [Telemetry Generator](https://github.com/shlokaloni282/perigee/blob/main/ml/data/generate_telemetry.py): `ml/data/generate_telemetry.py`
- [Anomaly Detector](https://github.com/shlokaloni282/perigee/blob/main/ml/models/anomaly_detector.py): `ml/models/anomaly_detector.py`

### Telemetry API

- [Telemetry Store](https://github.com/shlokaloni282/perigee/blob/main/backend/telemetry/models.py): `backend/telemetry/models.py`
- [Reading Serializer](https://github.com/shlokaloni282/perigee/blob/main/backend/telemetry/serializers.py): `backend/telemetry/serializers.py`
- [Django API Views](https://github.com/shlokaloni282/perigee/blob/main/backend/telemetry/views.py): `backend/telemetry/views.py`

### Dashboard

- [Telemetry API Client](https://github.com/shlokaloni282/perigee/blob/main/frontend/src/api/telemetry.js): `frontend/src/api/telemetry.js`
- [Dashboard App](https://github.com/shlokaloni282/perigee/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Stats Cards](https://github.com/shlokaloni282/perigee/blob/main/frontend/src/components/StatsCards.jsx): `frontend/src/components/StatsCards.jsx`
- [Telemetry Trends](https://github.com/shlokaloni282/perigee/blob/main/frontend/src/components/TelemetryLineChart.jsx): `frontend/src/components/TelemetryLineChart.jsx`
- [Orbit Illustration](https://github.com/shlokaloni282/perigee/blob/main/frontend/src/components/OrbitSimulation.jsx): `frontend/src/components/OrbitSimulation.jsx`
- [Anomaly Breakdown](https://github.com/shlokaloni282/perigee/blob/main/frontend/src/components/AnomalyBarChart.jsx): `frontend/src/components/AnomalyBarChart.jsx`
- [Anomaly Review](https://github.com/shlokaloni282/perigee/blob/main/frontend/src/components/AnomalyTable.jsx): `frontend/src/components/AnomalyTable.jsx`
- [Space Backdrop](https://github.com/shlokaloni282/perigee/blob/main/frontend/src/components/SpaceBackdrop.jsx): `frontend/src/components/SpaceBackdrop.jsx`

### Evidence Agent

- [Briefing Orchestrator](https://github.com/shlokaloni282/perigee/blob/main/agent/orchestrator.py): `agent/orchestrator.py`
- [Search and Filtering](https://github.com/shlokaloni282/perigee/blob/main/agent/searcher.py): `agent/searcher.py`
- [Source Credibility](https://github.com/shlokaloni282/perigee/blob/main/agent/credibility.py): `agent/credibility.py`
- [LLM Analysis](https://github.com/shlokaloni282/perigee/blob/main/agent/llm.py): `agent/llm.py`

### Other components

- **Satellite Operator**
- **SerpApi Search**
- **Gemini**

## Connections

- Telemetry Generator → Anomaly Detector: generates input for (evidence: `README.md`)
- Anomaly Detector → Telemetry Store: stores flagged readings (evidence: `README.md`)
- Django API Views → Telemetry Store: queries (evidence: `backend/telemetry/views.py`)
- Django API Views → Reading Serializer: serializes readings (evidence: `backend/telemetry/views.py`)
- Reading Serializer → Telemetry Store: serializes model (evidence: `backend/telemetry/serializers.py`)
- Telemetry API Client → Django API Views: requests data (evidence: `README.md`)
- Dashboard App → Telemetry API Client: loads dashboard data (evidence: `frontend/src/App.jsx`)
- Dashboard App → Stats Cards: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → Telemetry Trends: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → Orbit Illustration: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → Anomaly Breakdown: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → Anomaly Review: renders (evidence: `frontend/src/App.jsx`)
- Dashboard App → Space Backdrop: renders (evidence: `frontend/src/App.jsx`)
- Anomaly Review → Telemetry API Client: requests briefing (evidence: `frontend/src/components/AnomalyTable.jsx`)
- Satellite Operator → Anomaly Review: reviews anomalies
- Django API Views → Briefing Orchestrator: requests explanation (evidence: `backend/telemetry/views.py`)
- Briefing Orchestrator → Search and Filtering: gathers evidence (evidence: `agent/orchestrator.py`)
- Briefing Orchestrator → LLM Analysis: analyzes sources (evidence: `agent/orchestrator.py`)
- Search and Filtering → Source Credibility: labels sources (evidence: `agent/searcher.py`)
- Search and Filtering → SerpApi Search: searches web (evidence: `README.md`)
- LLM Analysis → Gemini: generates analysis (evidence: `README.md`)
- Briefing Orchestrator → Search and Filtering: runs follow-up (evidence: `agent/orchestrator.py`)
- Briefing Orchestrator → Django API Views: returns briefing (evidence: `backend/telemetry/views.py`)
