albertonline.org docs
Apps

lila-web

Next.js web client for the Lila chess scaffold - local, engine, and online play with an agent-readiness surface.

Overview

lila-web is the browser front end of the Lila chess scaffold ("lila" is the lichess codename). It renders the board, move list, and replay controls, and supports hot-seat local play, play against a computer engine with adjustable skill, and online play against another human with optional video chat. It talks to the sibling lila-server backend for game state and online play, and ships an agent-readiness surface (llms.txt site index, a read-only MCP server, and /.well-known protocol discovery artifacts).

Stack

  • Next.js (App Router) + React 19, bundled with Turbopack
  • Effect v4 for typed effects/domain logic
  • @repo/chess-ui (board UI) and @repo/chess-domain (rules) workspace packages, plus chess.js
  • canvas-confetti for celebrations
  • Vitest for tests, oxlint for linting

Online features need apps/lila-server (default http://localhost:3030, override with NEXT_PUBLIC_LILA_API). Start it alongside lila-web for local dev.

Develop

pnpm -F lila-web dev          # next dev --turbopack --port 3031
pnpm -F lila-web lint         # oxlint src/
pnpm -F lila-web check-types  # tsc --noEmit --incremental

Test

pnpm -F lila-web test         # vitest (watch)
pnpm -F lila-web test:ci      # vitest run + junit report

Build & deploy

pnpm -F lila-web build        # next build --turbopack
pnpm -F lila-web start        # next start --port 3031

Deployed on Vercel (albertonline-org-lila-web) at lila-web.albertonline.org. The online features need apps/lila-server, which has no production host yet, so the deployed client is UI-only where the server is required.

Structure

  • src/app/ - App Router routes: / (home), /play (local board), /play/online/[joinCode] (online), /mcp (MCP server), /api/agent/well-known/[...seg] (discovery artifacts)
  • src/components/ - board views, move list, replay controls, video chat
  • src/lib/ - online client, replay/FEN history, guest id helpers
  • src/proxy.ts - middleware adding agent-discovery Link headers and Markdown content negotiation
  • public/ - llms.txt, robots.txt, sitemap.xml, auth.md

See the apps overview and the monorepo overview.

On this page