# jesusdelri0/apis-proyecto architecture

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

- Interactive diagram: https://gitdiagram.com/jesusdelri0/apis-proyecto
- Repository: https://github.com/jesusdelri0/apis-proyecto

## Overview

This repository provides a sensor-records API: a client calls the FastAPI gateway, which forwards list or ID lookups to the matching humidity, pressure, sensors, or temperature service. Each service queries its corresponding PostgreSQL table and returns records. The four services are separate domain endpoints, not a demonstrated ingestion pipeline. The service and gateway relationships are visible in the sampled source; database setup files are present in the tree, but their contents were not sampled.

Main entry points: [`gateway/main.py`](https://github.com/jesusdelri0/apis-proyecto/blob/main/gateway/main.py) (Gateway Routes), [`db/init.sql`](https://github.com/jesusdelri0/apis-proyecto/blob/main/db/init.sql) (PostgreSQL Records), [`humidity/main.py`](https://github.com/jesusdelri0/apis-proyecto/blob/main/humidity/main.py) (Humidity API), [`pressure/main.py`](https://github.com/jesusdelri0/apis-proyecto/blob/main/pressure/main.py) (Pressure API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gateway["API Gateway"]
  node_gateway_app["Gateway Routes<br/>[main.py]"]
end

subgraph group_services["Sensor Services"]
  node_humidity["Humidity API<br/>[main.py]"]
  node_pressure["Pressure API<br/>[main.py]"]
  node_sensors["Sensors API<br/>[main.py]"]
  node_temperature["Temperature API<br/>[main.py]"]
end

subgraph group_storage["Data Storage"]
  node_postgres[("PostgreSQL Records<br/>[init.sql]")]
end

node_client(("API Client"))

node_client -->|"requests"| node_gateway_app
node_gateway_app -->|"forwards humidity"| node_humidity
node_gateway_app -->|"forwards pressure"| node_pressure
node_gateway_app -->|"forwards sensors"| node_sensors
node_gateway_app -->|"forwards temperature"| node_temperature
node_humidity -->|"queries humidity"| node_postgres
node_pressure -->|"queries pressure"| node_postgres
node_sensors -->|"queries sensors"| node_postgres
node_temperature -->|"queries temperature"| node_postgres

click node_gateway_app "https://github.com/jesusdelri0/apis-proyecto/blob/main/gateway/main.py"
click node_humidity "https://github.com/jesusdelri0/apis-proyecto/blob/main/humidity/main.py"
click node_pressure "https://github.com/jesusdelri0/apis-proyecto/blob/main/pressure/main.py"
click node_sensors "https://github.com/jesusdelri0/apis-proyecto/blob/main/sensors/main.py"
click node_temperature "https://github.com/jesusdelri0/apis-proyecto/blob/main/temperature/main.py"
click node_postgres "https://github.com/jesusdelri0/apis-proyecto/blob/main/db/init.sql"

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_gateway_app,node_client toneBlue
class node_humidity,node_pressure,node_sensors,node_temperature toneAmber
class node_postgres toneMint
```

## Components

### API Gateway

- [Gateway Routes](https://github.com/jesusdelri0/apis-proyecto/blob/main/gateway/main.py): `gateway/main.py`

### Sensor Services

- [Humidity API](https://github.com/jesusdelri0/apis-proyecto/blob/main/humidity/main.py): `humidity/main.py`
- [Pressure API](https://github.com/jesusdelri0/apis-proyecto/blob/main/pressure/main.py): `pressure/main.py`
- [Sensors API](https://github.com/jesusdelri0/apis-proyecto/blob/main/sensors/main.py): `sensors/main.py`
- [Temperature API](https://github.com/jesusdelri0/apis-proyecto/blob/main/temperature/main.py): `temperature/main.py`

### Data Storage

- [PostgreSQL Records](https://github.com/jesusdelri0/apis-proyecto/blob/main/db/init.sql): `db/init.sql`

### Other components

- **API Client**

## Connections

- API Client → Gateway Routes: requests (evidence: `gateway/main.py`)
- Gateway Routes → Humidity API: forwards humidity (evidence: `gateway/main.py`)
- Gateway Routes → Pressure API: forwards pressure (evidence: `gateway/main.py`)
- Gateway Routes → Sensors API: forwards sensors (evidence: `gateway/main.py`)
- Gateway Routes → Temperature API: forwards temperature (evidence: `gateway/main.py`)
- Humidity API → PostgreSQL Records: queries humidity (evidence: `humidity/main.py`)
- Pressure API → PostgreSQL Records: queries pressure (evidence: `pressure/main.py`)
- Sensors API → PostgreSQL Records: queries sensors (evidence: `sensors/main.py`)
- Temperature API → PostgreSQL Records: queries temperature (evidence: `temperature/main.py`)
