Commit Graph

360 Commits

Author SHA1 Message Date
Kroonk
5ac768d75f ux: disable auto-open AuthModal, make Abbrechen always visible, translate tabs, and show SSO option on guest tab
All checks were successful
Build & Push Docker Image to Gitea Registry / build-and-push (push) Successful in 2m37s
2026-05-21 11:12:43 +02:00
Kroonk
d47e87ef82 feat: implement Keycloak SSO integration with JIT provisioning and Next.js login button
All checks were successful
Build & Push Docker Image to Gitea Registry / build-and-push (push) Successful in 2m31s
2026-05-21 10:45:30 +02:00
Kroonk
ca64163899 Switch theme palette to mint green
All checks were successful
Build & Push Docker Image to Gitea Registry / build-and-push (push) Successful in 2m31s
2026-05-20 17:48:10 +02:00
Kroonk
e8c1e3539d Slim Docker runtime image
All checks were successful
Build & Push Docker Image to Gitea Registry / build-and-push (push) Successful in 2m44s
2026-05-20 17:42:52 +02:00
Kroonk
c9919479bf Use registry PAT for Gitea Docker login
Some checks failed
Build & Push Docker Image to Gitea Registry / build-and-push (push) Failing after 6m15s
2026-05-20 17:28:17 +02:00
Kroonk
37e2495e3d Use Gitea job token for registry login
Some checks failed
Build & Push Docker Image to Gitea Registry / build-and-push (push) Failing after 7s
2026-05-20 17:27:14 +02:00
Kroonk
5e996f791e Fix auth modal feedback and production deploy config
Some checks failed
Build & Push Docker Image to Gitea Registry / build-and-push (push) Failing after 6s
2026-05-20 17:25:15 +02:00
Kroonk
6f96b26e4c Migrate workflow to Gitea registry and use pre-built image
Some checks failed
Build & Push Docker Image to Gitea Registry / build-and-push (push) Has been cancelled
2026-05-20 16:58:05 +02:00
Michess
d60899fdbf feat(ui): simplified homepage, /play subpage, and fix bot-game PGN bug
Homepage now shows only a "Spielen" card (links to /play), public games,
last 3 games as mini-board thumbnails for logged-in users, and live games.

New /play page contains all game-mode cards (create, vs AI, friends,
correspondence, tournament).

Bug fix: /ai page was constructing Chess instances from FEN on every move,
discarding the full PGN history. Switching to loadPgn() preserves all moves
so the saved game can be fully reviewed in the archive.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 15:22:38 +02:00
Michess
2707efe115 feat(ui): move admin panel and join-game into profile dropdown
- Replace header admin link + profile modal with a dropdown menu
- Dropdown contains: profile, settings, admin (admins only), join-game form, logout
- Remove join-game card from homepage for logged-in users (now in dropdown)
- AuthModal now only handles guest/login/register flows

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 13:14:15 +02:00
Michess
bbf26826c6 fix: call leaveLobby before setting connected=true in joinLobby
Previously leaveLobby was called after game.black/white.connected was set
to true. Because every logged-in socket is in a personal user:{id} room,
this.rooms.size was always >=2, so leaveLobby fired on every join and
immediately found the *new* game via the connected-flag check, resetting
connected=false. This prevented the bot-trigger and clock-start checks from
passing, so bot-as-white tournament games never made their first move.

Fix: move leaveLobby call to before the connection-state assignment so it
can only find a genuinely *previous* game (where connected was already true
from an earlier join).

Closes #4

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 12:54:08 +02:00
Michess
0b3228c9d7 feat: live game tiles on homepage + bot spectating
- GET /v1/games/live returns all active games with both players assigned,
  including current FEN (computed server-side via chess.js)
- LiveGames component on homepage: mini chessboard tiles (160px) that
  auto-refresh every 3s, clickable to join as spectator
- Tournament page: 'Zuschauen' button for non-players on ongoing rounds
  (bot vs bot, human vs human, human vs bot all spectatable)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 08:03:26 +02:00
Michess
86fbdd39ed fix: resolve all 3 open Gitea issues
Issue #1 - Bot vs Bot Turnierspiele:
- triggerBotMove ruft sich rekursiv selbst auf wenn der nächste Spieler
  auch ein Bot ist (bot vs bot läuft jetzt vollautomatisch durch)
- startNextRoundGames erstellt aktive Spiele für die nächste Runde wenn
  eine Runde endet; bot vs bot Spiele starten sofort ohne Spectator
- updateRoundResult gibt jetzt die nächste Runden-Daten zurück statt void
- Alle Handler (sendMove, claimAbandoned, claimTimeout, triggerBotMove)
  starten die nächste Runde automatisch

Issue #2 - Bot-Schwierigkeit zu hoch:
- randomChance zu StockfishLevel hinzugefügt: Level 1=80%, 2=50%,
  3=15%, 4=3%, 5-6=0% zufällige Züge statt Stockfish-Best-Move
- Gilt sowohl für Socket-Bot-Züge als auch /v1/ai/move REST-Endpoint

Issue #3 - Turnier beenden + Zurück-Button:
- POST /:code/cancel Endpoint (nur Host), setzt status='finished'
- Turnier-Seite: 'Turnier beenden' Button für Host (rot, outline)
- tournamentCode Feld im Game-Typ; wird beim Erstellen von Turnierspielen
  gesetzt (inkl. Folgerunden)
- GamePage zeigt '← Zur Turnierübersicht' Link wenn tournamentCode gesetzt

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 07:46:40 +02:00
Michess
536160bba6 feat(elo): add ELO rating system
- DB: elo column on user table (default 1200, added via ALTER TABLE IF NOT EXISTS)
- ELO calculated after every game save (K=32, min 100)
- Bots use their fixed ELO values; only human players' ELO changes
- AI page games save with bot name (e.g. 'Holzpferd Heinz') instead of 'Stockfish'
- User profile shows ELO badge below name
- Header shows current ELO for logged-in users (links to profile)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 07:32:57 +02:00
Michess
157c14c11e feat(bots): add named bot profiles with ELO-based difficulty
- 5 bot profiles (Holzpferd Heinz to Meister Magnus, ELO 200-1400) in
  server/bots.ts and client/bots.ts with emoji + descriptions
- Bot users auto-created in DB on server startup (role='bot')
- AI page replaced difficulty buttons with bot profile cards
- Tournament host can add bots via dropdown (POST /:code/add-bot)
- Bot auto-moves triggered on joinLobby and after each human move
- Fixed clock start order so bot-as-white games initialize correctly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 13:32:43 +02:00
Michess
b29c467766 feat: add friend invite modal to all game modes
- New InviteFriendsModal component: fetches friends list, sends game
  invite via notification socket with per-friend sent confirmation
- Multiplayer (GamePage): invite button below copy link, hidden after game ends
- Correspondence: invite button in waiting-for-opponent card
- Tournament: invite button for joined players while status is waiting
- Invite links use mode-prefixed codes (correspondence/XYZ, tournament/XYZ)
  so notification "Beitreten" button navigates to the correct page

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 13:16:00 +02:00
Michess
50ef567a1a fix(eslint): ignore unused function parameter names in type definitions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 13:01:30 +02:00
Michess
4825a57a54 feat: add real-time notification system and fix admin login bug
- Fix login: role field was missing from session (admin page inaccessible)
- Add onlineUsers map in socket/state.ts to track connected users
- Join personal user:${id} socket room on connect for targeted notifications
- Emit friendRequestReceived/friendRequestAccepted socket events from friends controller
- Add sendGameInvite socket event handler on server
- New NotificationContext: global socket provider for registered users
- New NotificationPanel: bell icon with unread badge and dropdown in header
- Friends page: inline game invite input per friend with sendGameInvite

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 12:35:09 +02:00
Michess
1501b859b2 fix: suppress unused parameter ESLint error in socketEvents interface type
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 12:25:19 +02:00
Michess
dc7f718117 feat: new add time controls, correspondence games, and tournament mode
**Zeitmodi (Blitz/Rapid):**
- 5, 10, 30 Min Zeitkontrolle bei Spielerstellung
- Server-seitige Uhren: Zeit wird bei jedem Zug abgezogen
- Timeout-Erkennung via claimTimeout Socket-Event
- Schachuhr-Anzeige in GamePage (rot bei < 30s)
- Turnierspiele erhalten automatisch Zeitkontrolle

**Tagespartien (Correspondence):**
- Neue DB-Tabelle correspondence_game
- REST API: erstellen, beitreten, Zug machen, aufgeben
- Seite /correspondence: Liste aktiver Tagespartien
- Seite /correspondence/[code]: Spielen mit interaktivem Brett
- Einladungslink teilen, Gegner tritt via Link bei

**Turniermodus (Round-Robin):**
- Neue DB-Tabellen: tournament, tournament_player, tournament_round
- Round-Robin Paarungen mit Circle-Methode
- Turnier erstellen: /tournament/create
- Turnierliste: /tournament
- Turnierseite /tournament/[code]: Standings, Runden, Spiele
- Automatische Aktivisierung der nächsten Runde
- Turnierspiele werden als normale activeGames erstellt
- Ergebnisse aktualisieren Punkte automatisch

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 10:54:33 +02:00
Michess
aeb5fe313e feat: add time controls, correspondence games, and tournament mode
**Zeitmodi (Blitz/Rapid):**
- 5, 10, 30 Min Zeitkontrolle bei Spielerstellung
- Server-seitige Uhren: Zeit wird bei jedem Zug abgezogen
- Timeout-Erkennung via claimTimeout Socket-Event
- Schachuhr-Anzeige in GamePage (rot bei < 30s)
- Turnierspiele erhalten automatisch Zeitkontrolle

**Tagespartien (Correspondence):**
- Neue DB-Tabelle correspondence_game
- REST API: erstellen, beitreten, Zug machen, aufgeben
- Seite /correspondence: Liste aktiver Tagespartien
- Seite /correspondence/[code]: Spielen mit interaktivem Brett
- Einladungslink teilen, Gegner tritt via Link bei

**Turniermodus (Round-Robin):**
- Neue DB-Tabellen: tournament, tournament_player, tournament_round
- Round-Robin Paarungen mit Circle-Methode
- Turnier erstellen: /tournament/create
- Turnierliste: /tournament
- Turnierseite /tournament/[code]: Standings, Runden, Spiele
- Automatische Aktivisierung der nächsten Runde
- Turnierspiele werden als normale activeGames erstellt
- Ergebnisse aktualisieren Punkte automatisch

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 09:44:35 +02:00
Michess
09e5271dfb feat: redesign homepage layout and fix invite links
- Homepage: Grid-Layout mit 3 Karten (Spiel erstellen, KI, Freunde/Beitreten)
  statt vertikalem Stack mit Dividers
- CreateGame: kompakteres Styling, auf Deutsch, in Primary-Card integriert
- Einladungslink: APP_URL statt hardcoded ches.su in GamePage und CopyLink
- JoinGame: URL-Parsing für beliebige Domains (nicht nur ches.su)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 07:49:59 +02:00
Michess
0cc5a8e99c fix(ai): fix database model mapping for AI matches and missing AI names 2026-04-13 15:06:45 +02:00
Michess
f7b87f2941 fix: use existsSync instead of require(fs) in ESM module 2026-04-13 14:25:31 +02:00
Michess
4bc6ea58e6 fix: handle stockfish process error, try /usr/games/stockfish path 2026-04-13 14:19:58 +02:00
Michess
157fcf8fa4 fix: RefreshButton handle async onRefresh outside startTransition 2026-04-13 14:01:38 +02:00
Michess
446fce247f debug: add error boundary to show actual error message 2026-04-13 13:52:44 +02:00
Michess
39592bd579 fix: convert PublicGames to client component to avoid async server component in client tree 2026-04-13 13:45:43 +02:00
Michess
ebbc8227fd fix: use native stockfish binary via debian image 2026-04-13 13:40:21 +02:00
Michess
6b676d3015 fix: use child_process to spawn stockfish via stdin/stdout 2026-04-13 13:33:26 +02:00
Michess
6d677348d3 fix: pass NEXT_PUBLIC_* build args when building locally 2026-04-13 13:24:16 +02:00
Michess
3508c664e0 fix: next start explicitly on port 3000 2026-04-13 13:12:06 +02:00
Michess
81f60c9846 docker: build locally on NAS, no registry needed 2026-04-13 13:01:31 +02:00
Michess
8a6d7ddffb ci: trigger build
Some checks failed
Build & Push Docker Image / build (push) Failing after 6s
2026-04-13 12:57:46 +02:00
Michess
0e7b9c61e1 ci: use localhost:3001 registry to bypass Cloudflare
Some checks failed
Build & Push Docker Image / build (push) Failing after 6s
2026-04-13 12:53:02 +02:00
Michess
3a9681348f ci: trigger build after registry fix
Some checks failed
Build & Push Docker Image / build (push) Failing after 6s
2026-04-13 12:46:51 +02:00
Michess
0edc3cc7fd ci: trigger build
Some checks failed
Build & Push Docker Image / build (push) Failing after 6s
2026-04-13 12:29:21 +02:00
Michess
dfdf508064 ci: install bash+docker-cli+git via sh shell in setup step
Some checks failed
Build & Push Docker Image / build (push) Failing after 5s
2026-04-13 12:22:43 +02:00
Michess
46baf29eff ci: use node:20-alpine with docker-cli for runner compatibility
Some checks failed
Build & Push Docker Image / build (push) Failing after 3s
2026-04-13 12:19:57 +02:00
Michess
c1ea929753 ci: trigger build
Some checks failed
Build & Push Docker Image / build (push) Failing after 9s
2026-04-13 12:15:14 +02:00
Michess
b562839bd6 ci: trigger first Gitea Actions build
Some checks failed
Build & Push Docker Image / build (push) Failing after 22s
2026-04-13 11:58:05 +02:00
Michess
7b1f898b9e feat: Gitea Actions CI/CD — baut Image und pushed in Registry
Some checks failed
Build & Push Docker Image / build (push) Has been cancelled
2026-04-13 11:39:18 +02:00
Michess
47d9464ad4 fix: NEXT_PUBLIC_* URLs als Docker Build-Args weitergereicht 2026-04-13 11:36:47 +02:00
Michess
c056b93459 fix: provenance-Option entfernt (inkompatibel mit dieser Docker-Version) 2026-04-13 11:35:35 +02:00
Michess
641cdc7aad fix: BuildKit provenance deaktiviert (git-Warning entfernt) 2026-04-13 11:31:21 +02:00
Michess
e4c7aba178 fix: revalidate aus Client Component entfernt (Next.js Fehler) 2026-04-13 10:50:45 +02:00
Michess
694177c108 feat: Vollständiges Rebranding zu MiChess, Copyright Tom Misch
- Alle @chessu/ → @michess/ (Package-Namen und Imports)
- Theme-Namen chessuDark/Light → michessDark/Light
- Alle Display-Texte: chessu/Michess → MiChess
- Autor: dotnize → Tom Misch
- Copyright: Nathaniel Tampus → Tom Misch
- README komplett neu (Deutsch, MiChess-spezifisch)
- CONTRIBUTING.md neu
- FUNDING.yml + CODE_OF_CONDUCT.md entfernt
- Fork-Hinweis auf chessu bleibt im README erhalten (MIT-Pflicht)
- pnpm-lock.yaml entfernt (wird beim Build neu generiert)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 10:47:16 +02:00
Michess
4ab8cd3834 fix: ESLint-Fehler im Client behoben (unused vars, useCallback, CSSProperties) 2026-04-13 10:36:10 +02:00
Michess
b79a442b0c fix: TypeScript-Fehler behoben (stockfish types, null-Typ) 2026-04-13 10:30:54 +02:00
Michess
50464981c2 fix: Stockfish via npm-Paket statt Alpine apk
- stockfish als npm dependency (kein apk add nötig, portabel)
- Dockerfile: nur noch git via apk, kein stockfish
- docker-compose.yml: version-Zeile entfernt (veraltet)
- Controller auf npm-Package-API umgeschrieben (postMessage/onmessage)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 10:23:33 +02:00