A real-time multiplayer Texas Hold'em poker game built with React, Express, and Socket.io.
poker-solana/
├── backend/ # Express + Socket.io server
├── frontend/ # Vite + React client
├── shared/ # Shared TypeScript types
└── POKER_GAME_PLAN.md # Complete implementation guide
- Real-time multiplayer gameplay using WebSocket
- Full Texas Hold'em rules (preflop → flop → turn → river → showdown)
- Hand evaluation from Royal Flush to High Card
- Side pot calculation for all-in scenarios
- Lobby system with game creation and joining
- Turn timer with action panel (fold/check/call/raise/all-in)
- Responsive UI with TailwindCSS
- Node.js 18+
- pnpm
# Install backend dependencies
cd backend
pnpm install
# Install frontend dependencies
cd ../frontend
pnpm installOption 1: Run both servers separately
# Terminal 1 - Backend (port 3001)
cd backend
pnpm dev
# Terminal 2 - Frontend (port 5173)
cd frontend
pnpm devOption 2: Kill existing processes if ports are in use
# Kill process on port 3001 (backend)
lsof -ti:3001 | xargs kill -9
# Kill process on port 5173 (frontend)
lsof -ti:5173 | xargs kill -9Open your browser and navigate to:
- Frontend: http://localhost:5173
- Backend API: http://localhost:3001
- Game Contract: contract
- Shuffle Verifier Contract: contract
- Enter your name on the home page
- Create a game or join an existing game
- Wait in the lobby for other players to join
- Host starts the game (minimum 2 players required)
- Play poker! Follow Texas Hold'em rules
When creating a game, you can configure:
- Max Players: 2-8 players
- Blinds: Small blind and big blind amounts
- Starting Chips: Initial chip count for each player
- Turn Time: Seconds per turn (15-120)
- Express.js - HTTP server
- Socket.io - WebSocket communication
- TypeScript - Type safety
- UUID - Unique ID generation
- Vite - Build tool
- React 19 - UI framework
- React Router - Client-side routing
- Zustand - State management
- Socket.io-client - WebSocket client
- TailwindCSS - Styling
- Lucide React - Icons
POST /api/games- Create new gameGET /api/games- List active gamesGET /api/games/:id- Get game details
See POKER_GAME_PLAN.md for complete event documentation.
cd backend
pnpm dev # Runs with tsx watch for hot reloadcd frontend
pnpm dev # Runs Vite dev server with HMRIf you see EADDRINUSE errors:
# Backend (port 3001)
lsof -ti:3001 | xargs kill -9
# Frontend (port 5173)
lsof -ti:5173 | xargs kill -9The workbox warnings in the browser console are harmless and can be ignored. They appear because this app doesn't have PWA features configured.
- Ensure backend is running on port 3001
- Check CORS settings in
backend/src/index.ts - Verify Socket.io client URL in
frontend/src/services/socket.ts
MIT