A realtime multiplayer chess platform built with Next.js, Express, Socket.IO, and PostgreSQL.
chess-arena/
├── client/ Next.js frontend
└── server/
├── src/
│ ├── routes/
│ ├── middleware/
│ ├── services/
│ └── sockets/
└── prisma/
└── schema.prisma
Prerequisites: Node.js 18+, PostgreSQL
-
Install dependencies:
cd server && npm install cd ../client && npm install
-
Configure environment: Create
.envin theserverdirectory and.env.localin theclientdirectory by copying the examples:cp server/.env.example server/.env cp client/.env.example client/.env.local
Fill in the required environment variables in these files.
-
Push database schema:
cd server && npx prisma db push
-
Start development:
Terminal 1 (Backend):
cd server && npm run dev
Terminal 2 (Frontend):
cd client && npm run dev
Frontend runs on http://localhost:3000, backend on http://localhost:5000.
- Frontend: Next.js 15, TypeScript, react-chessboard
- Backend: Node.js, Express, Socket.IO, chess.js
- Database: PostgreSQL, Prisma ORM
- Auth: JWT, bcrypt
- Deploy: Vercel (frontend), Render (backend), Neon (database)