# onehandedwonder/klima-kontrolloeren architecture

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

- Interactive diagram: https://gitdiagram.com/onehandedwonder/klima-kontrolloeren
- Repository: https://github.com/onehandedwonder/klima-kontrolloeren

## Overview

Klima-Kontrolloeren collects temperature, humidity, and CO2 readings from Raspberry Pi sensors, then serves user-scoped readings, averages, and CSV exports through an ASP.NET Core API to a Vue dashboard. Users sign in with Firebase and manage their sensors through the profile. The graph preserves the documented weather and comfort-setting capabilities, though their detailed implementation was not sampled; those links are therefore limited to documented frontend components and integrations.

Main entry points: [`Klima-Kontrolloeren-Frontend/src/components/KlimaDashboard.vue`](https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Frontend/src/components/KlimaDashboard.vue) (Climate dashboard), [`Klima-Kontrolloeren-Backend/Controllers/SensorController.cs`](https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Backend/Controllers/SensorController.cs) (Sensor API), [`Klima-Kontrolloeren-Backend/Controllers/DataController.cs`](https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Backend/Controllers/DataController.cs) (Data API), [`Klima-Kontrolloeren-Backend/Data/DbConnectionFactory.cs`](https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Backend/Data/DbConnectionFactory.cs) (Database access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sensor["Sensor ingestion"]
  node_pi["Raspberry Pi sender<br/>[sensor_app.py]"]
end

subgraph group_api["Backend API"]
  node_sensorcontroller["Sensor API"]
  node_datacontroller["Data API<br/>[DataController.cs]"]
  node_authcontroller["Auth API<br/>[Auth.cs]"]
  node_sensorservice["Sensor service<br/>[SensorService.cs]"]
  node_authservice["Auth service<br/>[AuthService.cs]"]
  node_averages["Average calculations<br/>[AverageService.cs]"]
  node_csv["CSV export<br/>[csvService.cs]"]
  node_dbfactory["Database access"]
end

subgraph group_frontend["Vue dashboard"]
  node_app["App shell<br/>[App.vue]"]
  node_router["Protected routes<br/>[index.js]"]
  node_signin["Sign-in screen<br/>[SignInBoard.vue]"]
  node_dashboard["Climate dashboard<br/>[KlimaDashboard.vue]"]
  node_profile["Profile management<br/>[ProfilePage.vue]"]
  node_firebaseclient["Firebase client<br/>[firebase.js]"]
  node_cache[("Dashboard cache<br/>[App.vue]")]
end

subgraph group_services["External services"]
  node_sql[("SQL Server")]
  node_firebase["Firebase services"]
  node_weather["Open-Meteo"]
end

node_user(("Dashboard user"))

node_pi -->|"posts readings"| node_sensorcontroller
node_sensorcontroller -->|"saves and queries"| node_sensorservice
node_datacontroller -->|"fetches readings"| node_sensorservice
node_datacontroller -->|"calculates averages"| node_averages
node_datacontroller -->|"generates exports"| node_csv
node_sensorcontroller -->|"via service"| node_dbfactory
node_sensorservice -->|"uses"| node_dbfactory
node_authcontroller -->|"authenticates"| node_authservice
node_authservice -->|"verifies credentials"| node_firebase
node_authservice -->|"checks user"| node_dbfactory
node_dbfactory -->|"reads and writes"| node_sql
node_user -->|"signs in"| node_signin
node_user -->|"views climate"| node_dashboard
node_user -->|"manages sensors"| node_profile
node_app -->|"renders routes"| node_router
node_app -->|"tracks auth state"| node_firebaseclient
node_firebaseclient -->|"authenticates"| node_firebase
node_signin -->|"requests sign-in"| node_authcontroller
node_dashboard -->|"requests data"| node_datacontroller
node_dashboard -->|"loads sensors"| node_sensorcontroller
node_dashboard -->|"caches dashboard data"| node_cache
node_profile -->|"manages sensors"| node_sensorcontroller
node_profile -.->|"updates account"| node_authcontroller
node_dashboard -.->|"fetches weather"| node_weather

click node_pi "https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Senson_app/sensor_app.py"
click node_sensorcontroller "https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Backend/Controllers/SensorController.cs"
click node_datacontroller "https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Backend/Controllers/DataController.cs"
click node_authcontroller "https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Backend/Controllers/Auth.cs"
click node_sensorservice "https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Backend/Services/SensorService.cs"
click node_authservice "https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Backend/Services/AuthService.cs"
click node_averages "https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Backend/Services/AverageService.cs"
click node_csv "https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Backend/Services/csvService.cs"
click node_dbfactory "https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Backend/Data/DbConnectionFactory.cs"
click node_app "https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Frontend/src/App.vue"
click node_router "https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Frontend/src/router/index.js"
click node_signin "https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Frontend/src/components/SignInBoard.vue"
click node_dashboard "https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Frontend/src/components/KlimaDashboard.vue"
click node_profile "https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Frontend/src/components/ProfilePage.vue"
click node_firebaseclient "https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Frontend/src/firebase.js"
click node_cache "https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Frontend/src/App.vue"

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_pi,node_user toneBlue
class node_sensorcontroller,node_datacontroller,node_authcontroller,node_sensorservice,node_authservice,node_averages,node_csv,node_dbfactory toneAmber
class node_app,node_router,node_signin,node_dashboard,node_profile,node_firebaseclient,node_cache toneMint
class node_sql,node_firebase,node_weather toneRose
```

## Components

### Sensor ingestion

- [Raspberry Pi sender](https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Senson_app/sensor_app.py): `Senson_app/sensor_app.py`

### Backend API

- [Sensor API](https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Backend/Controllers/SensorController.cs): `Klima-Kontrolloeren-Backend/Controllers/SensorController.cs`
- [Data API](https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Backend/Controllers/DataController.cs): `Klima-Kontrolloeren-Backend/Controllers/DataController.cs`
- [Auth API](https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Backend/Controllers/Auth.cs): `Klima-Kontrolloeren-Backend/Controllers/Auth.cs`
- [Sensor service](https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Backend/Services/SensorService.cs): `Klima-Kontrolloeren-Backend/Services/SensorService.cs`
- [Auth service](https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Backend/Services/AuthService.cs): `Klima-Kontrolloeren-Backend/Services/AuthService.cs`
- [Average calculations](https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Backend/Services/AverageService.cs): `Klima-Kontrolloeren-Backend/Services/AverageService.cs`
- [CSV export](https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Backend/Services/csvService.cs): `Klima-Kontrolloeren-Backend/Services/csvService.cs`
- [Database access](https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Backend/Data/DbConnectionFactory.cs): `Klima-Kontrolloeren-Backend/Data/DbConnectionFactory.cs`

### Vue dashboard

- [App shell](https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Frontend/src/App.vue): `Klima-Kontrolloeren-Frontend/src/App.vue`
- [Protected routes](https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Frontend/src/router/index.js): `Klima-Kontrolloeren-Frontend/src/router/index.js`
- [Sign-in screen](https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Frontend/src/components/SignInBoard.vue): `Klima-Kontrolloeren-Frontend/src/components/SignInBoard.vue`
- [Climate dashboard](https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Frontend/src/components/KlimaDashboard.vue): `Klima-Kontrolloeren-Frontend/src/components/KlimaDashboard.vue`
- [Profile management](https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Frontend/src/components/ProfilePage.vue): `Klima-Kontrolloeren-Frontend/src/components/ProfilePage.vue`
- [Firebase client](https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Frontend/src/firebase.js): `Klima-Kontrolloeren-Frontend/src/firebase.js`
- [Dashboard cache](https://github.com/onehandedwonder/klima-kontrolloeren/blob/main/Klima-Kontrolloeren-Frontend/src/App.vue): `Klima-Kontrolloeren-Frontend/src/App.vue`

### External services

- **SQL Server**
- **Firebase services**
- **Open-Meteo**

### Other components

- **Dashboard user**

## Connections

- Raspberry Pi sender → Sensor API: posts readings
- Sensor API → Sensor service: saves and queries
- Data API → Sensor service: fetches readings
- Data API → Average calculations: calculates averages
- Data API → CSV export: generates exports
- Sensor API → Database access: via service
- Sensor service → Database access: uses
- Auth API → Auth service: authenticates
- Auth service → Firebase services: verifies credentials
- Auth service → Database access: checks user
- Database access → SQL Server: reads and writes
- Dashboard user → Sign-in screen: signs in
- Dashboard user → Climate dashboard: views climate
- Dashboard user → Profile management: manages sensors
- App shell → Protected routes: renders routes
- App shell → Firebase client: tracks auth state
- Firebase client → Firebase services: authenticates
- Sign-in screen → Auth API: requests sign-in
- Climate dashboard → Data API: requests data
- Climate dashboard → Sensor API: loads sensors
- Climate dashboard → Dashboard cache: caches dashboard data
- Profile management → Sensor API: manages sensors
- Profile management → Auth API: updates account
- Climate dashboard → Open-Meteo: fetches weather
