A multiplayer Player vs Player Wordle game where players compete in real-time to guess words.
- Real-time multiplayer gameplay
- Create and join game rooms with unique codes
- Public rooms displayed in lobby and private rooms with invitation codes
- Turn-based guessing with feedback for correct letters and positions
- WebRTC for peer-to-peer communication
- Automatic deployment with ngrok for backend connectivity
frontend/
: Client-side code (HTML, CSS, JavaScript)backend/
: Server-side code (Node.js, Socket.io)docs/
: Generated output for GitHub Pages deployment.notes/
: Project documentation and planningdeploy.js
: Automated deployment script
- Node.js (v14 or higher)
- npm (v6 or higher)
- ngrok installed and configured with an auth token
- Clone the repository
- Install dependencies:
npm install npm run setup
- Configure ngrok:
- Create a free account at ngrok.com
- Install ngrok CLI from ngrok.com/download
- Add your auth token:
ngrok config add-authtoken YOUR_TOKEN
-
Start the backend server:
npm run dev:server
-
Start the frontend development server:
npm run dev:client
-
Access the game at http://localhost:8080
The easiest way to deploy the game is using our automated deployment script:
npm run deploy
This script will:
- Check if port 3000 is available for the backend server
- Verify ngrok installation and configuration
- Start the backend server
- Launch ngrok and create a public URL for your backend
- Update the frontend code with the ngrok URL
- Deploy the frontend to GitHub Pages (if configured)
- Start a local frontend server if GitHub Pages is not configured
- Output the URLs you can share with friends
The script will keep running to maintain the ngrok tunnel. Press Ctrl+C to stop when you're done playing.
-
Deploy the frontend to GitHub Pages:
npm run deploy:github
-
Enable GitHub Pages in your repository settings, set the source to the
/docs
folder. -
Your frontend will be available at
https://yourusername.github.io/pvp-wordle/
-
Start the backend server:
npm run start:server
-
In a separate terminal, start ngrok:
npm run start:ngrok
-
Note the ngrok URL displayed (e.g.,
https://abc123.ngrok-free.app
). This is your backend URL. -
Manually update the
BACKEND_URL
infrontend/script.js
and redeploy.
- When you launch the game, you can either create a new room or join an existing one.
- If creating a room, you'll get a unique room code to share with your opponent.
- When both players join, the game will begin with a countdown.
- Take turns guessing 5-letter words. After each guess, you'll see feedback with colored tiles:
- Green: Correct letter in correct position
- Yellow: Correct letter in wrong position
- Gray: Letter not in the word
- The first player to guess the word correctly wins the game!
-
Port 3000 Already in Use: If the deploy script fails with port 3000 unavailable, try:
- Stop any existing node processes using
npx kill-port 3000
- Check for processes using port 3000 in Task Manager/Activity Monitor
- Stop any existing node processes using
-
ngrok Issues: If ngrok fails to start:
- Verify your auth token is configured correctly
- Check if your ngrok session limit has been reached
- Try restarting ngrok manually
MIT