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.
14 lines
509 B
Docker
14 lines
509 B
Docker
# Multi-stage: build the React app, then serve it with nginx.
|
|
# Self-hosters never need Node locally — `docker compose up` builds everything.
|
|
FROM node:22-alpine AS build
|
|
WORKDIR /app
|
|
COPY frontend/package.json frontend/package-lock.json* ./
|
|
RUN npm ci 2>/dev/null || npm install
|
|
COPY frontend/ ./
|
|
RUN npm run build
|
|
|
|
FROM nginx:alpine
|
|
COPY web/nginx.conf /etc/nginx/conf.d/default.conf
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
|
# exercise media (img/gif) is mounted at runtime from the media volume
|