Endgame OS is a modern chess training prototype built with Next.js, TypeScript, Tailwind CSS, Supabase, Stockfish, chess.js, and react-chessboard.
It lets a player:
- play as White against Stockfish
- choose AI difficulty
- review completed games with an AI Coach
- save finished games and reviews to Supabase
- track profile stats
- compare players on a Kazakhstan city leaderboard
- preview locked Pro features without real payments
- Next.js App Router
- TypeScript
- Tailwind CSS
- shadcn-style UI primitives
- Supabase Auth and Postgres
- Stockfish in a Web Worker
chess.jsreact-chessboard
Install dependencies:
npm installCreate a local env file:
cp .env.example .env.localFill in:
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=Run the app:
npm run devOpen:
http://localhost:3000
The chess trainer is at:
http://localhost:3000/play
Create a Supabase project, then get these values from:
Project Settings -> API
Use:
- Project URL
- anon public key
Put them in .env.local.
Login to Supabase CLI:
npx supabase loginLink the local repo to your project:
npx supabase link --project-ref YOUR_PROJECT_REFApply migrations:
npx supabase db pushMigration files live in:
supabase/migrations/
npm run dev
npm run build
npm run start
npm run db:dry-run
npm run db:pushDo not commit real secrets.
This repo intentionally ignores:
.env.env.local.env.*.localsupabase/.temp- local logs
.nextnode_modules
Safe to commit:
.env.example- SQL migrations
- app source code
Never commit:
- Supabase service role key
- Supabase access token
- database password
- real
.env.local - private API keys
The NEXT_PUBLIC_SUPABASE_ANON_KEY is designed to be used in browser apps, but it should still live in .env.local and not be hardcoded into source files.
If a secret was already pushed to GitHub, rotate it in Supabase immediately.
/landing page/playchess trainer/authsign in / sign up/profileplayer stats/leaderboardKazakhstan leaderboard
- Pro upgrade is a fake modal only.
- Stripe is not connected.
- Accuracy is estimated from Stockfish eval swings.
- Advanced weakness reports and opening prep are locked preview features.