# devopsinsiders/axion-telemetry-query-service architecture

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

- Interactive diagram: https://gitdiagram.com/devopsinsiders/axion-telemetry-query-service
- Repository: https://github.com/devopsinsiders/axion-telemetry-query-service

## Overview

Axion Telemetry Query Service exposes FastAPI endpoints for dashboard and device telemetry queries, backed by database query functions. The documented product also checks active bounds and returns alarms, though the sampled routes do not show that capability. The excerpts show the API calling database functions and managing database lifecycle; database.py was not sampled, so its internal query behavior and storage calls remain unverified.

Main entry points: [`main.py`](https://github.com/devopsinsiders/axion-telemetry-query-service/blob/main/main.py) (FastAPI endpoints), [`database.py`](https://github.com/devopsinsiders/axion-telemetry-query-service/blob/main/database.py) (Telemetry query functions), [`config.py`](https://github.com/devopsinsiders/axion-telemetry-query-service/blob/main/config.py) (Service settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_api["FastAPI endpoints<br/>[main.py]"]
end

subgraph group_queries["Telemetry Queries"]
  node_query_functions["Telemetry query functions<br/>[database.py]"]
  node_timescaledb[("TimescaleDB")]
end

subgraph group_runtime["Runtime Configuration"]
  node_settings["Service settings<br/>[config.py]"]
end

node_clients(("UI and AI clients"))

node_clients -->|"sends requests"| node_api
node_api -->|"calls queries"| node_query_functions
node_api -->|"manages connection"| node_query_functions
node_api -->|"reads port"| node_settings
node_query_functions -.->|"queries data"| node_timescaledb

click node_api "https://github.com/devopsinsiders/axion-telemetry-query-service/blob/main/main.py"
click node_query_functions "https://github.com/devopsinsiders/axion-telemetry-query-service/blob/main/database.py"
click node_settings "https://github.com/devopsinsiders/axion-telemetry-query-service/blob/main/config.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_api,node_clients toneBlue
class node_query_functions,node_timescaledb toneAmber
class node_settings toneMint
```

## Components

### HTTP API

- [FastAPI endpoints](https://github.com/devopsinsiders/axion-telemetry-query-service/blob/main/main.py): `main.py`

### Telemetry Queries

- [Telemetry query functions](https://github.com/devopsinsiders/axion-telemetry-query-service/blob/main/database.py): `database.py`
- **TimescaleDB**

### Runtime Configuration

- [Service settings](https://github.com/devopsinsiders/axion-telemetry-query-service/blob/main/config.py): `config.py`

### Other components

- **UI and AI clients**

## Connections

- UI and AI clients → FastAPI endpoints: sends requests (evidence: `README.md`)
- FastAPI endpoints → Telemetry query functions: calls queries (evidence: `main.py`)
- FastAPI endpoints → Telemetry query functions: manages connection (evidence: `main.py`)
- FastAPI endpoints → Service settings: reads port (evidence: `main.py`)
- Telemetry query functions → TimescaleDB: queries data
