Gamebase
A real-time multiplayer gaming platform with matchmaking, in-game chat, and player presence — Tic-Tac-Toe and Ludo, playable in the browser. New games will be added as time goes.
A browser-based multiplayer gaming platform. Sign up, pick a game, get matched with someone, and play in real time. Currently supports Tic-Tac-Toe and Ludo, with matchmaking, in-game chat, profiles, and a report system.
Everything runs through a single WebSocket connection per player. When you connect, the server authenticates your token, marks you online, and broadcasts your presence to everyone else. From there, every interaction — joining a queue, making a move, sending a message, going idle — is a socket event.
Game rooms live in server memory and get persisted to MongoDB on every state change. That dual storage means the game is fast (memory reads for every move) but also recoverable (if the server restarts or a player drops, the room is rehydrated from the database on reconnect).
Two ways to get into a game:
- Queue — join the matchmaking queue for a game type. When a second player joins, the server creates a room, assigns marks/colors randomly, and drops both players in.
- Invite — send a private link to a specific player. They accept, and the room is created for just the two of you.
The queue state is broadcast to all connected clients so you can see who's waiting before you join.
Dropped connections are the hardest part of real-time multiplayer. If a player disconnects mid-game, they get a grace period. During that window, the game stays alive and the opponent sees a "reconnecting" state. If the player comes back, the server cancels the forfeit timer, re-joins them to the socket room, and sends the current game state so the client can pick up exactly where it left off. If they don't come back, the game is forfeited.
Each game room gets its own conversation. Messages are persisted in MongoDB and loaded when you rejoin a room. The presence system tracks three states — online, away, and in-game — and broadcasts changes to all connected clients in real time.
React with Tailwind and shadcn/ui. The auth flow has a space-themed background with shooting star animations. Game screens have sound effects for moves, wins, and draws. The Ludo board is a custom component with dice rolling and piece movement animations.
- React + TypeScript + Tailwind CSS for the frontend
- Node.js + Express for the API
- Socket.IO for all real-time communication
- MongoDB + Mongoose for persistence
- Deployed on Vercel