A real-time multiplayer chess variant featuring portal mechanics. Pieces can teleport across the board through magical portals, adding a strategic twist to the classic game.
- Real-time multiplayer gameplay via WebSockets
- Portal mechanics - pieces teleport through linked portal pairs
- Multiple game modes with different portal behaviors
- Google OAuth authentication
- Player matchmaking and rating system
- Game history and replay support
- Responsive chess board UI
Client:
- React 19 + TypeScript
- Vite
- Socket.io Client
Server:
- Node.js + Express
- Socket.io for real-time communication
- PostgreSQL with Drizzle ORM
- Redis for session/game state
- Passport.js with Google OAuth
- JWT authentication
Shared:
- Game engine and types shared between client/server
portal-chess/
├── client/ # React frontend
├── server/ # Express backend
├── shared/ # Shared game engine & types
├── docs/ # Design documentation
└── package.json # Root workspace config
- Node.js 20+
- PostgreSQL
- Redis
- Google OAuth credentials
-
Clone the repository:
git clone https://github.com/Mnehmos/portal-chess.git cd portal-chess -
Install dependencies:
npm install
-
Configure environment variables:
cp server/.env.example server/.env # Edit server/.env with your configurationRequired environment variables:
DATABASE_URL- PostgreSQL connection stringREDIS_URL- Redis connection stringGOOGLE_CLIENT_ID- Google OAuth client IDGOOGLE_CLIENT_SECRET- Google OAuth client secretJWT_SECRET- Secret for JWT token signing
-
Set up the database:
npm run build:shared cd server && npx tsx scripts/setup-db.ts
Run both client and server concurrently:
npm run devOr run them separately:
npm run dev:client # React dev server on :5173
npm run dev:server # Express server on :3001Build all packages:
npm run build:allBuild server only (for deployment):
npm run build:serverBuild the server Docker image:
docker build -f server/Dockerfile -t portal-chess-server .Run with environment variables:
docker run -p 3001:3001 \
-e DATABASE_URL=... \
-e REDIS_URL=... \
-e GOOGLE_CLIENT_ID=... \
-e GOOGLE_CLIENT_SECRET=... \
-e JWT_SECRET=... \
portal-chess-serverRun client tests:
npm run testRun server tests:
npm run test:serverRun all tests:
npm run test:allPortal Chess follows standard chess rules with the addition of portals:
- Portals appear as linked pairs on the board
- When a piece moves onto a portal, it teleports to the linked portal
- Portals can be used strategically for attacks, defense, and positioning
- Different game modes offer varying portal behaviors (static, rotating, random)
MIT