diff --git a/README.md b/README.md index 1159d8ca6596425639f668ea4783b337c20c7a96..a132b590f6e710b7b86bc0ceaa4b7c16a60cb937 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Project Folder Structure and Functions -This document describes the purpose and functionality of the folders within the `web` directory of the project. +This document describes the purpose and functionality of the folders within the `web` directory of the project. It also contains german instructions on how to start the project using the docker-compose.yaml. --- @@ -72,4 +72,72 @@ This document describes the purpose and functionality of the folders within the - **Frontend**: Vue.js application for the user interface. - **Data Generation**: Simulates sensor data and sends it to the MQTT broker. - **Stream Processing**: Processes real-time data and writes it to InfluxDB. -- **Services**: Configurations for external services like InfluxDB and MQTT. \ No newline at end of file +- **Services**: Configurations for external services like InfluxDB and MQTT. + +## Anleitung + +- **Frontend + Backend:** + [co2ampel2 / Web · GitLab](https://transfer.hft-stuttgart.de/gitlab/co2ampel2/web) + +- **Firmware:** + [co2ampel2 / co2-ampel · GitLab](https://transfer.hft-stuttgart.de/gitlab/co2ampel2/co-2-ampel) + +> **Hinweis:** In der `Config.h` Datei die WLAN-Zugangsdaten und die korrekte Adresse der Ampel anpassen. +Frontend und Backend laufen nun – allerdings ist **InfluxDB noch nicht korrekt mit dem Django-Ninja-Backend verbunden**, da API-Calls auf InfluxDB-Daten **nicht authentifiziert** sind. +## Projekt starten + +```bash +docker-compose up --build +``` +## InfluxDB einrichten + +1. Öffne InfluxDB im Browser: + [http://localhost:8086/signin](http://localhost:8086/signin) - oder Server URL und entsprechender Port + +2. Melde dich an mit: + + - **Username:** `admin` + + - **Password:** `password` + +3. Token generieren: + + - Klicke auf **Python**: + ![[Pasted image 20250627200456.png]] + + - Klicke dann auf **"Get Token"**: + ![[Pasted image 20250627200618.png]] + +4. Token kopieren und in der Datei `.env.docker` im Verzeichnis `backend` **ersetzen**. + +5. Container neu starten: + + +```bash +docker-compose down +docker-compose up --build +``` + +--- + +## Testdaten generieren (für Entwicklung) + +1. Ins Daten-Generator-Verzeichnis wechseln: +```bash +cd data_generation +``` + +2. Virtuelle Umgebung einrichten: +```bash +uv sync +``` + +3. Umgebung aktivieren: +```bash +source .venv/bin/activate +``` + +4. Skript starten: +```bash +python main.py +``` diff --git a/frontend/src/views/ChartView.vue b/frontend/src/views/ChartView.vue index 3b8f619f019b649a952e7389a361227a6d3f16d5..d13922fa80a3fd40716cda5e0bb7ca23a75eeebd 100644 --- a/frontend/src/views/ChartView.vue +++ b/frontend/src/views/ChartView.vue @@ -217,6 +217,6 @@ export default defineComponent({ flex-wrap: nowrap; gap: 2rem; justify-content: flex-start; - flex-direction: row; + flex-direction: column; } </style>