Files
Wizard/wizard_website
marvinandClaude Opus 5.5 87dfcd55b7 Add resource limits, abuse protection and overload handling
Running games always continue; new work is refused when there is no
capacity; abuse is rejected immediately.

- Docker: CPU/memory/pids caps per container (overridable in .env);
  uvicorn message size, queue and concurrency limits
- Server abuse limits: connections total/per IP (close 1013), message
  rate per connection (token bucket, close 1008 on floods), lobby
  creation rate per IP
- Load monitor: event loop lag, CPU of the own cgroup quota and
  throttling, with hysteresis (normal/busy/overloaded, severe lag
  overloads immediately)
- Admission control: create_lobby and start_game refused while
  overloaded or MAX_ACTIVE_GAMES are running; server_status message
  broadcast on changes; /health reports load but stays ok
- AI bridge: timeout sent with requests, in-flight cap, circuit breaker
- AI service: bounded workers and queue ("overloaded"), drops expired
  requests, degrades to the heuristic agent when busy or too slow
- Website: busy notices, Create/Start disabled when not accepting
  games, slow retry when the server is full
- Tests for limiters, load levels, admission control and AI service
  limits; docs updated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 12:51:46 +02:00
..
2026-09-27 09:52:00 +02:00
2026-09-27 09:52:00 +02:00
2026-09-27 08:58:25 +02:00
2026-09-27 08:58:25 +02:00
2026-09-27 09:52:00 +02:00
2026-09-27 08:58:25 +02:00
2026-09-27 08:58:25 +02:00
2026-09-27 08:58:25 +02:00
2026-09-27 08:58:25 +02:00
2026-09-27 08:58:25 +02:00

wizard_website

React + TypeScript frontend (Vite). All component styles are CSS modules (*.module.css); the design tokens live on the .app root in src/App.module.css.

npm install
npm run dev      # http://localhost:5173, proxies /api/* (incl. websocket) to localhost:8000 without the /api prefix
npm run build
npm run lint

The app is built with relative asset paths and connects to ../api/ws relative to its own URL (/wizard/website/ → /wizard/api/ws). Set WIZARD_SERVER_URL to proxy to another server in development, or VITE_WS_URL at build time to use an absolute websocket URL instead.

Structure

  • src/api/ — protocol types and the useWizard hook (websocket connection, reconnect with a per-tab session token, game state)
  • src/components/ — reusable UI (button, playing card, modal, toasts)
  • src/screens/HomeScreen — enter a name, create or join a lobby
  • src/screens/LobbyScreen — lobby code, players, AI players, rule options, start
  • src/screens/GameScreen — the table: seats, trick, hand, bidding, trump choice, scoreboard, round summary, game over