π¨ A real-time multiplayer drawing guessing game where players compete to draw and guess words.
- Real-Time Multiplayer Gaming - Play with up to 8 players
- Live Drawing Canvas - Smooth drawing with brush, eraser, and color picker
- Real-Time Chat - Guess words instantly, see reactions live
- Scoring System - Earn points for speed and accuracy
- Smart Word Selection - Customizable rounds, time limits, and player counts
- Player Statistics - Track scores across multiple games
- React 18 - UI library
- Vite - Fast build tool and dev server
- TypeScript - Type-safe JavaScript
- Zustand - Lightweight state management
- Socket.IO Client - Real-time communication
- TailwindCSS - Utility-first CSS
- React Router - Client-side routing
- Node.js 20 - JavaScript runtime
- Express - Web framework
- Socket.IO - WebSocket server
- TypeScript - Type-safe JavaScript
- nodemon - Development auto-reload
- PostgreSQL - Persistent data storage
- Redis - Session and cache storage
- Docker - Containerization
- Docker Compose - Multi-container orchestration
- Node.js 20+ and npm
- Docker and Docker Compose (for containerized setup)
- PostgreSQL 15+ (if running without Docker)
- Redis 7+ (if running without Docker)
git clone https://github.com/yourusername/sketch-frenzy.git
cd sketch-frenzy# Frontend dependencies
cd frontend && npm install
# Backend dependencies
cd backend && npm install# Start all services
docker compose up --build -d
# Access application
# Frontend: http://localhost:5173
# Backend API: http://localhost:5000
# View logs
docker compose logs -f
# Stop services
docker compose stopTerminal 1 - Backend:
cd backend
npm install
npm run dev
# Server runs on http://localhost:5000Terminal 2 - Frontend:
cd frontend
npm install
npm run dev
# App runs on http://localhost:5173Requirements:
- PostgreSQL running on localhost:5432
- Redis running on localhost:6379
sketch-frenzy/
βββ backend/ # Node.js + Express server
β βββ src/
β β βββ index.ts # Main server & Socket.IO handlers
β β βββ config/
β β β βββ gameConfig.ts # Game settings
β β βββ data/
β β β βββ words.ts # Word list for drawing
β β βββ db/
β β β βββ postgres.ts # Database connection
β β β βββ schema.sql # Database schema
β β βββ services/
β β βββ gameService.ts # Game logic
β β βββ roomService.ts # Room management
β βββ package.json
β βββ tsconfig.json
β βββ Dockerfile
β
βββ frontend/ # React + Vite application
β βββ src/
β β βββ App.tsx # Main app router
β β βββ main.tsx # Entry point
β β βββ components/
β β β βββ DrawingCanvas.tsx # Game interface
β β βββ pages/
β β β βββ home/ # Join/Create room
β β β βββ canvas/ # Game page
β β βββ store/
β β β βββ drawingStore.ts # Global state
β β βββ hooks/
β β β βββ useSocket.ts # Socket.IO hook
β β βββ services/ # Core logic
β β βββ types/
β β β βββ drawing.ts # TypeScript types
β β βββ config/
β β βββ gameConfig.ts # Game constants
β βββ package.json
β βββ vite.config.ts
β βββ tsconfig.json
β βββ Dockerfile
β
βββ docker-compose.yml # Services orchestration
βββ README.md # This file
- Enter your username
- Set game settings:
- Max Players: 2-12 players
- Rounds: 1-10 rounds per game
- Draw Time: 60/90/120 seconds per round
- Click Create Game
- Share the room code with friends
- Enter room code (from host)
- Enter your username
- Click Join
- Wait for host to start the game
-
Drawer's Turn:
- Pick your word from 3 options (15 sec)
- Draw to help others guess (80 sec)
- Reveal letters to help guessers
-
Guesser's Turn:
- Watch the drawing
- Look for hints (letters revealed)
- Type your guess in the chat
- Correct guesses get points
-
Scoring:
- Drawer: +100 base + +50 per correct guesser
- Guesser: 50-500 based on speed
-
End Game:
- Final standings after all rounds
- Highest score wins!
Edit GAME_CONFIG in backend/src/config/gameConfig.ts:
export const GAME_CONFIG = {
WORD_CHOICES_COUNT: 3, // Words shown to drawer
WORD_SELECT_TIME: 15, // Seconds to pick word
MAX_HINT_REVEALS: 2, // Max hints per round
MIN_PLAYERS: 2, // Minimum to start
};Backend (.env or Docker environment):
PORT=5000
NODE_ENV=development
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/sketchfrenzy
REDIS_URL=redis://localhost:6379
FRONTEND_URL=http://localhost:5173Frontend (.env or Docker environment):
VITE_BACKEND_URL=http://localhost:5000
VITE_SOCKET_URL=http://localhost:5000ββ Frontend (React + Vite) βββββββββββββββββββ
β β’ Pages: Home, Canvas β
β β’ State: Zustand store β
β β’ Realtime: Socket.IO client β
βββββββββββββββββββ¬βββββββββββββββββββββββββββ
β WebSocket
βββββββββββββββββββΌβββββββββββββββββββββββββββ
β Backend (Express + Socket.IO) β
β β’ Room management (Redis) β
β β’ Game logic (GameService) β
β β’ API endpoints (/health, etc) β
βββββββββββββββββββ¬ββββββββββββ¬βββββββββββββββ
β β
βββββββββββΌββ ββββββββΌβββββ
β PostgreSQLβ β Redis β
β (Data) β β (Cache) β
βββββββββββββ βββββββββββββ
- User Action β Frontend component
- Socket Event β Backend handler
- Business Logic β GameService / RoomService
- Database Query β PostgreSQL / Redis
- Response Event β Broadcast to clients
- State Update β Zustand store
- UI Render β React components
- users - Player profiles
- rooms - Game rooms
- room_players - Player room memberships
- rounds - Round history
- guesses - Guess history
See schema.sql for full details.