The frontend for the Chess platform. This app is where players:
Built with Next.js App Router and wired to both REST and WebSocket backends.
Run the dependent services first:
api-server on http://localhost:4000ws-server on ws://localhost:8080Then in client/:
pnpm install
pnpm dev
Open http://localhost:3000.
Set these in .env.local (or .env):
# Browser-visible websocket endpoint used by the arena
NEXT_PUBLIC_WS_URL=ws://localhost:8080
# Server-side upstream used by app/api proxy route
REST_BACKEND_ORIGIN=http://localhost:4000
The client intentionally uses a split transport model:
NEXT_PUBLIC_WS_URL/api/*, and app/api/[...path]/route.ts forwards to REST_BACKEND_ORIGINWhy this exists:
/api/*) while allowing backend origin changes per environment.Use app/lib/api.ts for REST requests so headers, errors, and base path behavior stay consistent.
/: product landing page/lobby: player discovery, friend requests, invite creation/arena: websocket gameplay, room join, invite accept, identity mode controls/settings: board/sound/UX preferencesapp/lib/auth.tsapp/lib/session.tsapp/lib/usePlayerIdentity.tsCurrent product behavior:
REST_BACKEND_ORIGIN and that api-server is running.NEXT_PUBLIC_WS_URL and that ws-server is running.api-server are applied.