Skip to content

Repository files navigation

Chess Multiplayer

Real-time multiplayer chess built with Next.js and Supabase. Create a game, share the link, and play live — with standard chess and Chess960 (Fischer Random) support.

Features

  • ♟️ Real-time multiplayer over Supabase Realtime
  • 🎲 Standard chess and Chess960 (Fischer Random) variants
  • 🔗 Shareable game links — no account required
  • 📱 Mobile-friendly board with drag-and-drop
  • 🕘 Move history, captured pieces, and game-status overlays

Tech Stack

  • Next.js (App Router) + React
  • Supabase (Postgres + Realtime)
  • chess.js for move validation
  • Tailwind CSS
  • Vitest for tests

Getting Started

Prerequisites

1. Install dependencies

bun install

2. Configure environment

Create a .env.local file in the project root:

NEXT_PUBLIC_SUPABASE_URL=your-supabase-project-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key

3. Set up the database

Run the SQL in docs/sql_table_init.md against your Supabase project to create the games and moves tables and enable Realtime.

Note: Make sure Row Level Security (RLS) policies are enabled on these tables, since the anon key is exposed to the client.

4. Run the dev server

bun run dev

Open http://localhost:3000 in your browser.

To test on mobile devices on your local network:

bun run dev:network

Then visit http://<your-machine-ip>:3000 from your device.

Scripts

Command Description
bun run dev Start the dev server
bun run dev:network Start the dev server on all interfaces (for mobile testing)
bun run build Build for production
bun run start Start the production server
bun run lint Run ESLint
bun run test Run tests with Vitest

License

MIT

Releases

Packages

Contributors

Languages