A real-time multiplayer drawing game similar to skribbl.io, built with FastAPI, Python sockets, and React.
- Real-time drawing canvas with WebSocket communication
- Game room management with private/public rooms
- Turn-based gameplay with automatic rotation
- Word selection and scoring system
- Real-time chat system
- Player authentication and profiles
- Leaderboards and statistics
- FastAPI: REST API endpoints
- Raw Python Sockets: Low-level TCP socket communication for drawing and chat
- WebSocket Bridge: Browser-compatible WebSocket interface
- SQLAlchemy: Database ORM
- Redis: Session management and caching
drawsync/
├── backend/
│ ├── app/
│ │ ├── __init__.py
│ │ ├── main.py
│ │ ├── config.py
│ │ ├── database.py
│ │ ├── models/
│ │ ├── schemas/
│ │ ├── api/
│ │ ├── core/
│ │ └── services/
│ ├── requirements.txt
│ └── README.md
├── frontend/
└── README.md
- Create virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Set up environment variables:
cp .env.example .env
# Edit .env with your configuration- Run all backend services:
python start_drawsync.pyOr run services separately:
# Terminal 1: FastAPI Server
cd backend && uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
# Terminal 2: Socket Services (Python Socket Server + WebSocket Bridge)
cd backend && python start_socket_services.pyOnce the server is running, visit:
- API docs: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
join_room: Join a game roomleave_room: Leave current roomdraw: Send drawing datachat_message: Send chat messageguess_word: Submit word guessready: Player ready status
player_joined: New player joinedplayer_left: Player leftdraw_data: Drawing data from other playerschat_message: Chat message from other playersgame_state: Current game stateturn_update: Turn change notificationword_assigned: Word assigned to drawerguess_result: Result of word guessgame_end: Game ended with results