Commit Graph

206 Commits

Author SHA1 Message Date
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
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
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
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
3508c664e0 fix: next start explicitly on port 3000 2026-04-13 13:12:06 +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
7dac042d73 feat: Michess – Initiales Setup auf Basis von chessu
- Rebranding: chessu → Michess (Header, Footer, Metadata, Session-Cookie)
- Stockfish KI-Integration: 6 Schwierigkeitsgrade (Anfänger bis Meister)
- Admin-Panel: Nutzerverwaltung, Sperren/Entsperren, Git-Pull-Update
- Freundessystem: Anfragen, Freundesliste, Nutzersuche
- DB-Schema: role, banned, friend_request, friendship Tabellen
- Docker: NAS-optimiertes docker-compose.yml mit PostgreSQL Healthcheck
- Stockfish binary via apk im Alpine-Image installiert
- .env.example für einfaches Deployment
- scripts/update.sh für manuelles NAS-Update
- Brain.md + Plan.md als Projekt-Gedächtnis

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 10:02:52 +02:00
Nathaniel Tampus
2ac873c5b1 update to node 20 & pnpm 9 2024-07-14 14:35:37 +08:00
Nathaniel Tampus
d5008a88fa format 2024-01-15 19:55:20 +08:00
Nathaniel Tampus
394644bc81 update deps 2024-01-15 19:54:50 +08:00
Nathaniel Tampus
f909419f8e update links 2023-11-23 11:49:52 +08:00
Nathaniel Tampus
d20ad3418a next 14, update deps 2023-11-20 17:30:40 +08:00
Nathaniel Tampus
a8c8b2e199 update links & names 2023-11-20 17:28:18 +08:00
Nathaniel Tampus
7d8d8850c0 add isolated install scripts for each workspace 2023-10-09 12:15:50 +08:00
Nathaniel Tampus
93d991a9b2 fix scripts for workspace-specific installs 2023-10-09 11:59:53 +08:00
Nathaniel Tampus
50bdd80d07 update deps 2023-10-09 11:02:49 +08:00
Nathaniel Tampus
8a003bf236 update links 2023-09-29 23:13:37 +08:00
Nathaniel Tampus
b4c1ee4db5 update deps 2023-09-29 23:13:27 +08:00
Nathaniel Tampus
8176ad36be update urls 2023-08-25 18:55:25 +08:00
Nathaniel Tampus
7086ed0b56 update deps 2023-08-25 18:53:58 +08:00
Nathaniel Tampus
f245060075 update deps 2023-08-17 21:20:03 +08:00
Nathaniel Tampus
98d5490de6 update deps 2023-08-16 13:19:01 +08:00
Nathaniel Tampus
57d453de88 remove optional client dependencies 2023-08-08 13:50:12 +08:00
Nathaniel Tampus
0dfb8bafd5 update deps 2023-08-08 13:46:54 +08:00
Nathaniel Tampus
efc2492275 add separate install scripts for each package 2023-07-27 18:07:01 +08:00
Nathaniel Tampus
2aea4af121 only run separate install scripts in root dir 2023-07-27 17:47:28 +08:00
Nathaniel Tampus
3e3b18b493 add install scripts for separate deployments 2023-07-27 17:33:27 +08:00
Nathaniel Tampus
db3b844802 link pre-alpha badge to roadmap 2023-07-27 16:27:30 +08:00
Nathaniel Tampus
d0f4ed995b adjust light secondary color 2023-07-27 16:14:27 +08:00
Nathaniel Tampus
2238038c95 update eslint configs 2023-07-27 15:02:34 +08:00
Nathaniel Tampus
a87cf86239 update deps 2023-07-27 14:53:25 +08:00
Nathaniel Tampus
3e7638b78d update label to pre-alpha 2023-07-10 17:01:06 +08:00
Nathaniel Tampus
2b57b3f116 update links 2023-07-01 19:40:14 +08:00
Nathaniel Tampus
88c86025f4 update deps 2023-07-01 19:39:28 +08:00
Nathaniel Tampus
dd48e3a890 update deps 2023-06-19 21:56:15 +08:00
Nathaniel Tampus
032fd8bf24 remove unused @ts-expect-error 2023-06-13 12:48:34 +08:00