test
CI / build (push) Successful in 9s
CI / lint (push) Successful in 11s
CI / create-and-publish-docker-image (push) Successful in 10s

This commit is contained in:
2026-06-27 23:12:59 +02:00
parent 2a56faa1d1
commit 37557bed04
+1 -49
View File
@@ -1,27 +1,7 @@
## monitor-im-flur ## monitor-im-flur
![Build Status](https://git.rivercry.com/wg/monitor-im-flur/badges/master/pipeline.svg) ![example workflow](https://git.rivercry.com/wg/monitor-im-flur/actions/workflows/ci.yml/badge.svg)
Hallway / common-area wall monitor dashboard. A single-page React + Vite app that surfaces useful household + transit + weather + fun data on a passive display.
### Key Features
* Realtime-ish autorefresh via git commit hash file (`/git-hash.html`) hot-reloads the deployed page when a new build is published.
* Dynamic theming (day / evening / night) based on current time.
* Public transport departures (KVV) for two nearby stops (IDs 7000044 & 7000045).
* Weather (current, hourly, daily min/max) via OpenMeteo.
* Flatastic chores integration (tasks + flatmates) with API key.
* Home Assistant readings (tent temperature + humidity) displayed in a faux terminal with rotating shitposts.
* 4:20 easter egg card + Amogus sprite + other playful flourishes.
* Docker / Nginx static deployment image (`git.rivercry.com/wg/monitor-im-flur:latest`).
* Strict linting + formatting (ESLint AirBnB + Prettier + Biome optional).
* Zustand + RTK (toolkit present) state management (currently Zustand in active use).
### Tech Stack
* React 19 + TypeScript + Vite
* Zustand (with devtools) for app stores (weather, kvv, flatastic, home assistant)
* Nginx (static file serving) inside minimal Docker image
* OpenMeteo, Flatastic, KVV, Home Assistant external APIs
* Git hash pipeline script to trigger client selfreloads
### Project Structure (abridged) ### Project Structure (abridged)
``` ```
@@ -92,16 +72,6 @@ docker compose up -d
``` ```
Visit: http://localhost:9123 Visit: http://localhost:9123
### Git Hash AutoReload Mechanism
`pipeline/create-git-hash-html.sh` writes the current commit (`$GITHUB_SHA`) to `dist/git-hash.html` during CI. The dashboard polls `/git-hash.html` every 10s; when the value changes it performs `window.location.reload()`. Ensure your CI runs the script after `vite build` and before creating the Docker image.
Pseudo CI step example:
```
vite build
GITHUB_SHA=$(git rev-parse HEAD) ./pipeline/create-git-hash-html.sh
docker build -t git.rivercry.com/wg/monitor-im-flur:$(git rev-parse --short HEAD) .
```
### Data Sources ### Data Sources
* KVV Departures: Public endpoint (JSON) for stop IDs 7000044 / 7000045. * KVV Departures: Public endpoint (JSON) for stop IDs 7000044 / 7000045.
* Weather: OpenMeteo forecast API (lat 49.0094, lon 8.4044, Europe/Berlin TZ). * Weather: OpenMeteo forecast API (lat 49.0094, lon 8.4044, Europe/Berlin TZ).
@@ -115,21 +85,3 @@ docker build -t git.rivercry.com/wg/monitor-im-flur:$(git rev-parse --short HEAD
### State Management Notes ### State Management Notes
All data fetching is encapsulated inside zustand store `fetch` methods invoked on an interval within the respective components. Consider centralizing polling or using React Query if complexity grows. All data fetching is encapsulated inside zustand store `fetch` methods invoked on an interval within the respective components. Consider centralizing polling or using React Query if complexity grows.
### Potential Improvements / TODO
* Remove hardcoded Home Assistant token.
* Error + loading states (currently optimistic, failures would be silent / console only).
* Retry & backoff strategy for network calls.
* Dark mode override / manual theme toggle.
* Accessibility pass (ARIA, focus management) current dashboard is mostly passive.
* Tests (none yet). Could add Vitest + React Testing Library.
* Switch transit API code to gracefully handle outages (KVV sometimes rate limits).
### License
Add a license file if you plan to share externally (currently unspecified).
### Support / Contact
Internal project (wg). For issues open a ticket on Gitea: https://git.rivercry.com/wg/monitor-im-flur
---
Generated README draft adjust repository paths / badge branch name if different (e.g., replace `master` with your default branch).