Rewrite frontend in React + Vite (organised component tree)
Ersetzt die 1900-Zeilen-Vanilla-SPA durch eine strukturierte React-App: - frontend/src: views/ (9 Views), components/ (Modals, LineChart, Heatmap, TabBar, Media, Stepper, RestTimer, Toast), store/ (Zustand: State+Sync, UI), lib/ (format, history, exercises, api/WebAuthn, sound, nav) - React Router (Hash), Zustand-Store mit localStorage + Server-Sync - Reaktives DOM-Diffing löst das manuelle Re-Render-Ruckeln (GIF läuft beim Set-Abhaken flüssig weiter) Self-Hosting bleibt ein Befehl: web/ ist jetzt ein Multi-Stage-Dockerfile, das das Frontend IM Container baut und mit nginx ausliefert — keine lokale Node/Build-Kette nötig. Übungsmedien nach ./media ausgelagert. Voller Ablauf im Headless-Browser getestet (Login→Plan→Workout→Stats→ Library→Settings, Feature-Parität) und Standalone-Compose Ende-zu-Ende (React-Build im Docker, /api-Proxy, geforgter Passkey-Login) verifiziert.
This commit is contained in:
1 parent
0c237f96dc
commit
7e1d27b218
49 files changed
+3014
-2014
No files matched your search
+10
-7
@@ -1,13 +1,13 @@
|
||||
name: opengym
|
||||
|
||||
services:
|
||||
# One-time: download the exercise images + GIFs into ./app (skipped if already there).
|
||||
# One-time: download the exercise images + GIFs into ./media (skipped if already there).
|
||||
# ~140 MB, from github.com/hasaneyldrm/exercises-dataset (CC).
|
||||
media:
|
||||
image: alpine/git
|
||||
volumes:
|
||||
- ./app/img:/out/img
|
||||
- ./app/gif:/out/gif
|
||||
- ./media/img:/out/img
|
||||
- ./media/gif:/out/gif
|
||||
entrypoint: ["/bin/sh", "-c"]
|
||||
command:
|
||||
- |
|
||||
@@ -32,9 +32,12 @@ services:
|
||||
volumes:
|
||||
- ./data:/data # users, passkeys, per-user state, session secret — BACK THIS UP
|
||||
|
||||
# Serves the app and proxies /api → api (single origin for passkeys).
|
||||
# Builds the React frontend (multi-stage) and serves it, proxying /api → api
|
||||
# and the exercise media from the shared volume. Single origin for passkeys.
|
||||
web:
|
||||
image: nginx:alpine
|
||||
build:
|
||||
context: .
|
||||
dockerfile: web/Dockerfile
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
media:
|
||||
@@ -44,5 +47,5 @@ services:
|
||||
ports:
|
||||
- "${WEB_PORT:-8080}:80"
|
||||
volumes:
|
||||
- ./app:/usr/share/nginx/html:ro
|
||||
- ./web/nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
- ./media/img:/usr/share/nginx/html/img:ro
|
||||
- ./media/gif:/usr/share/nginx/html/gif:ro
|
||||
Reference in new issue
Block a user