Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Frontend

Tech Stack

KomponenteTechnologie
FrameworkReact 19 + TypeScript
Build ToolVite 7
RoutingReact Router DOM 7
AuthSupabase (managed)
StateReact Hooks + localStorage
StylingCustom CSS (Glassmorphic Design)

Seiten / Routen

RouteSeiteBeschreibung
/loginLoginAnmeldung / Registrierung via Supabase
/DashboardAktiver Plan, Tages-Predictions
/setup/bookmakerBookmaker SetupWizard: Anbieter waehlen + Einzahlung
/setup/planPlan SetupWizard: Risiko, Ziel, Budget, Quote
/plan/:idPlan DetailRun Table, aktive Wetten, Historie

Auth Flow

  1. User landet auf /login (oeffentliche Route)
  2. Registrierung (Name, Email, Passwort) oder Login
  3. Supabase verwaltet Auth-State via JWT
  4. Geschuetzte Routen per AuthGuard (redirect zu Login wenn nicht eingeloggt)
  5. Sign-out loescht Session

Design System

  • Farben: Deep Blue Background (#070b14), Cyan Glow (#00d4ff), Purple (#8b5cf6), Green (#00ff88), Red (#ff3366), Gold (#ffd700)
  • Fonts: Inter (Body), JetBrains Mono (Zahlen/Betraege)
  • Komponenten: Glass Cards (blur + backdrop filter), Pill Buttons, Risk Cards
  • Animationen: Fade-in, Heart Break/Gain, Confetti bei Gewinn
  • Responsive: Breakpoint bei 640px, Flex/Grid Layouts

State Management

Kein globaler Store - jeder Feature-Bereich hat einen eigenen Hook:

HooklocalStorage KeyFunktion
useBookmakers()ba_bookmakersWettanbieter verwalten
usePlans()ba_plansWettplaene CRUD
useBets()ba_betsWetten + Ergebnisse

Jeder Hook bietet refresh() zum Neuladen nach Aenderungen.

Betting Flow

  1. Dashboard zeigt Tages-Predictions von API (/api/v1/predictions/{date})
  2. User klickt Pick → Modal mit Details (Match, Liga, Tipp, Quote, Einsatz, Gewinn)
  3. Bestaetigung → Wette in localStorage gespeichert
  4. Plan-Detail zeigt aktive Wette mit Win/Loss Buttons
  5. Win: Lives Reset + Bankroll waechst, Loss: 1 Leben weniger

Run Table

Mathematische Einsatz-Berechnung:

  • r = quote / (quote - 1) (Martingale-Faktor)
  • Konstanter Profit pro Runde
  • Rekursive Berechnung ueber alle Runden
  • Visualisierung mit Fortschrittsbalken zum Ziel

Build & Deployment

# Development
cd /home/hlorenz/lite/frontend
npm run dev          # Vite Dev Server auf :5173, Proxy zu API :3030

# Production Build
npm run build        # Output in dist/

# Deployment
# Static Files in dist/ werden von Nginx served
# API Proxy ueber Nginx location /api/ → localhost:3030

Verzeichnisstruktur

frontend/
├── src/
│   ├── main.tsx          # Entry Point
│   ├── App.tsx           # Router Setup
│   ├── pages/            # Seiten-Komponenten
│   ├── components/       # Shared Components
│   ├── hooks/            # Custom Hooks (useStore, useAuth)
│   ├── styles/           # CSS Dateien
│   └── lib/              # Utilities, Supabase Client
├── dist/                 # Production Build Output
├── vite.config.ts        # Vite Config mit API Proxy
└── package.json