RPS Multiplayer is a simple real-time game where two players can play Rock, Paper, Scissors from different devices by sharing the same Game ID.
It uses Node.js, Express, and Socket.IO for the backend, and HTML + Tailwind CSS for the frontend.
| Layer | Technologies |
|---|---|
| Frontend | HTML, TailwindCSS, JavaScript, Socket.IO Client |
| Backend | Node.js, Express, Socket.IO |
| Styling | Tailwind CSS (via CDN) |
| Deployment | Render / Railway (WebSocket-friendly) |
rps-multiplayer/
├── package.json
├── server.js
├── README.md
└── public/
├── index.html
├── style.css
└── script.jsnpm installnpm run dev
# or
npm start- Open
http://localhost:3000in two devices or two browser tabs. - On the first tab/device:
- Click "Create Game".
- Note the generated Game ID.
- On the second tab/device:
- Enter the same Game ID.
- Click "Join Game" to connect.
-
Room Storage:
Rooms are stored in memory. This means data is lost when the server restarts.
For production, use Redis or a persistent database to handle:- Room persistence
- Scaling across multiple server instances
-
Player Limit:
Each room is limited to 2 players.
To deploy the app, make sure your hosting platform supports WebSockets.
✅ Always configure WebSockets properly in production environments for real-time communication.
Pull requests are welcome!
For major changes, please open an issue first to discuss what you’d like to change.
MIT License © 2025 Hadi Shah
