This contains everything you need to run your app locally.
View your app in AI Studio: https://ai.studio/apps/drive/1V19gClvDAEWuN4eIuan0VOHSnMXL8lRK
Prerequisites: Node.js
-
Install dependencies:
npm install
-
Set the
GEMINI_API_KEYin .env.local to your Gemini API key (optional, only needed for AI advisor) -
Run the app:
- For multiplayer (recommended): Run both the frontend and WebSocket server:
npm run dev:all
- Frontend only:
npm run dev
- Server only:
npm run server
- For multiplayer (recommended): Run both the frontend and WebSocket server:
The game now supports online multiplayer through WebSocket:
- Start the WebSocket server on port 3001 (default)
- Open the app in your browser (runs on port 3000 by default)
- Click "Search for Game" to enter the matching pool
- When another player searches, you'll be automatically paired
- Play in real-time with live updates!
The server handles:
- Player matching and pairing
- Game state synchronization
- Turn validation and enforcement
- Win condition detection
