A modern, real-time web implementation of Hangman with solo and ranked multiplayer modes, built with Next.js and Convex. Players can play casual solo games or compete in ranked head-to-head matches with an Elo-based rating system.
- Solo play: quick single-player Hangman.
- Ranked matches: pair with other players via matchmaking, play a word in real-time, and gain/lose Elo rating based on match results.
- Scheduler-backed timeouts: inactive matches are handled server-side via Convex scheduled functions.
- Leaderboards & stats: per-user statistics, recent games, and global ranking queries.
- Curated word list: the game uses a cleaned, pre-generated word list for consistent play experience.
- Frontend: Next.js 16 + React 19 (app router), TypeScript, Tailwind CSS
- Backend: Convex (serverless DB + functions + scheduler) with
convextypes and generated API - Auth:
@convex-dev/authfor session management and user tables
- Players enter matchmaking; the server pairs two waiting users and selects a word from the curated list.
- Each player takes alternating guesses; server stores guesses, mistakes, attempts and timestamps.
- Games are completed when a player guesses all unique letters or reaches a mistake limit (6). Elo rating is updated on completion.
- Server-side scheduled tasks handle stale matches and timeouts to ensure matches progress or clean up.
Requirements
- Node.js (recommended 18+)
- pnpm or npm
Install
pnpm installLocal development (Next.js)
pnpm run devConvex development
- Install and configure the Convex CLI and your Convex project per Convex docs.
- Ensure Convex environment variables (project URL / keys) are available locally as required by your Convex setup.
- Deploy or run local Convex functions if testing backend logic:
convex devThe game uses a curated word list located at convex/data/allWords.ts. This list is pre-filtered for appropriate word lengths and content to ensure a good gameplay experience. You can modify this list to add or remove words as desired, but be mindful of maintaining a balanced and fair selection for players.
Feel free to fork the repository and submit pull requests for improvements, bug fixes, or new features. Contributions are welcome!
There are no automated tests included in the repository in favor of development speed and simplicity.
For questions or help, open an issue in this repository.