# prathamd69/aeroenginetwin architecture

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

- Interactive diagram: https://gitdiagram.com/prathamd69/aeroenginetwin
- Repository: https://github.com/prathamd69/aeroenginetwin

## Overview

PINN-AeroEngineTwin exposes a FastAPI service for uploading aero-engine telemetry, listing runs, retrieving time-ranged channel data, and deleting runs. Ingestion validates and cleans Parquet data, writes telemetry and run metadata to TimescaleDB, and archives the raw upload in SeaweedFS. Retrieval reads selected channels, downsamples dense results, and serializes a response. The graph follows the sampled routes and service code; the README provides no further product detail, so alerting or other unshown capabilities are not inferred.

Main entry points: [`src/routers/simulation_routes.py`](https://github.com/prathamd69/aeroenginetwin/blob/main/src/routers/simulation_routes.py) (Simulation routes), [`src/services/simulation_ingestor.py`](https://github.com/prathamd69/aeroenginetwin/blob/main/src/services/simulation_ingestor.py) (Ingestion validation), [`config.py`](https://github.com/prathamd69/aeroenginetwin/blob/main/config.py) (Runtime configuration), [`app.py`](https://github.com/prathamd69/aeroenginetwin/blob/main/app.py) (FastAPI app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_service["API service"]
  node_app["FastAPI app<br/>[app.py]"]
  node_routes["Simulation routes"]
end

subgraph group_ingestion["Ingestion"]
  node_ingestor["Ingestion validation"]
  node_database[("TimescaleDB")]
  node_archive[("SeaweedFS archive")]
end

subgraph group_retrieval["Telemetry retrieval"]
  node_downsampler["Telemetry downsampling<br/>[downsampling.py]"]
  node_serializer["Telemetry serialization<br/>[serialization.py]"]
end

subgraph group_support["Schemas and configuration"]
  node_telemetry_schema["Telemetry schema<br/>[sim_table.py]"]
  node_payload_schema["Response schema<br/>[sim_payload.py]"]
  node_channel_limits["Channel limits<br/>[channel_limits.py]"]
  node_config["Runtime configuration<br/>[config.py]"]
  node_config_manager["Config managers<br/>[config_manager.py]"]
  node_limits_file["Channel limits data"]
end

node_client(("API client"))

node_client -->|"sends requests"| node_app
node_app -->|"mounts router"| node_routes
node_routes -->|"ingests upload"| node_ingestor
node_ingestor -->|"validates against"| node_telemetry_schema
node_routes -->|"passes pool"| node_database
node_ingestor -->|"writes run and rows"| node_database
node_routes -->|"stores raw upload"| node_archive
node_routes -->|"queries and deletes"| node_database
node_routes -->|"downsamples results"| node_downsampler
node_routes -->|"serializes results"| node_serializer
node_routes -->|"declares response model"| node_payload_schema
node_config -->|"builds channel limits"| node_channel_limits
node_config -->|"loads limits"| node_limits_file

click node_app "https://github.com/prathamd69/aeroenginetwin/blob/main/app.py"
click node_routes "https://github.com/prathamd69/aeroenginetwin/blob/main/src/routers/simulation_routes.py"
click node_ingestor "https://github.com/prathamd69/aeroenginetwin/blob/main/src/services/simulation_ingestor.py"
click node_telemetry_schema "https://github.com/prathamd69/aeroenginetwin/blob/main/src/schemas/sim_table.py"
click node_payload_schema "https://github.com/prathamd69/aeroenginetwin/blob/main/src/schemas/sim_payload.py"
click node_channel_limits "https://github.com/prathamd69/aeroenginetwin/blob/main/src/schemas/channel_limits.py"
click node_config "https://github.com/prathamd69/aeroenginetwin/blob/main/config.py"
click node_config_manager "https://github.com/prathamd69/aeroenginetwin/blob/main/src/utils/config_manager.py"
click node_downsampler "https://github.com/prathamd69/aeroenginetwin/blob/main/src/services/downsampling.py"
click node_serializer "https://github.com/prathamd69/aeroenginetwin/blob/main/src/utils/serialization.py"
click node_limits_file "https://github.com/prathamd69/aeroenginetwin/blob/main/config/channel_limits.yaml"

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_app,node_routes,node_client toneBlue
class node_ingestor,node_database,node_archive toneAmber
class node_downsampler,node_serializer toneMint
class node_telemetry_schema,node_payload_schema,node_channel_limits,node_config,node_config_manager,node_limits_file toneRose
```

## Components

### API service

- [FastAPI app](https://github.com/prathamd69/aeroenginetwin/blob/main/app.py): `app.py`
- [Simulation routes](https://github.com/prathamd69/aeroenginetwin/blob/main/src/routers/simulation_routes.py): `src/routers/simulation_routes.py`

### Ingestion

- [Ingestion validation](https://github.com/prathamd69/aeroenginetwin/blob/main/src/services/simulation_ingestor.py): `src/services/simulation_ingestor.py`
- **TimescaleDB**
- **SeaweedFS archive**

### Telemetry retrieval

- [Telemetry downsampling](https://github.com/prathamd69/aeroenginetwin/blob/main/src/services/downsampling.py): `src/services/downsampling.py`
- [Telemetry serialization](https://github.com/prathamd69/aeroenginetwin/blob/main/src/utils/serialization.py): `src/utils/serialization.py`

### Schemas and configuration

- [Telemetry schema](https://github.com/prathamd69/aeroenginetwin/blob/main/src/schemas/sim_table.py): `src/schemas/sim_table.py`
- [Response schema](https://github.com/prathamd69/aeroenginetwin/blob/main/src/schemas/sim_payload.py): `src/schemas/sim_payload.py`
- [Channel limits](https://github.com/prathamd69/aeroenginetwin/blob/main/src/schemas/channel_limits.py): `src/schemas/channel_limits.py`
- [Runtime configuration](https://github.com/prathamd69/aeroenginetwin/blob/main/config.py): `config.py`
- [Config managers](https://github.com/prathamd69/aeroenginetwin/blob/main/src/utils/config_manager.py): `src/utils/config_manager.py`
- [Channel limits data](https://github.com/prathamd69/aeroenginetwin/blob/main/config/channel_limits.yaml): `config/channel_limits.yaml`

### Other components

- **API client**

## Connections

- API client → FastAPI app: sends requests
- FastAPI app → Simulation routes: mounts router (evidence: `app.py`)
- Simulation routes → Ingestion validation: ingests upload (evidence: `src/routers/simulation_routes.py`)
- Ingestion validation → Telemetry schema: validates against (evidence: `src/services/simulation_ingestor.py`)
- Simulation routes → TimescaleDB: passes pool (evidence: `src/routers/simulation_routes.py`)
- Ingestion validation → TimescaleDB: writes run and rows (evidence: `src/services/simulation_ingestor.py`)
- Simulation routes → SeaweedFS archive: stores raw upload (evidence: `src/routers/simulation_routes.py`)
- Simulation routes → TimescaleDB: queries and deletes (evidence: `src/routers/simulation_routes.py`)
- Simulation routes → Telemetry downsampling: downsamples results (evidence: `src/routers/simulation_routes.py`)
- Simulation routes → Telemetry serialization: serializes results (evidence: `src/routers/simulation_routes.py`)
- Simulation routes → Response schema: declares response model (evidence: `src/routers/simulation_routes.py`)
- Runtime configuration → Channel limits: builds channel limits (evidence: `config.py`)
- Runtime configuration → Channel limits data: loads limits (evidence: `config.py`)
