A real-time multiplayer Tic Tac Toe game built with Flask and Flask-SocketIO. Two users can join the same room from different devices, choose board size, and play live.
- 🔁 Real-time two-player gameplay via WebSockets
- 🧠 Configurable board size (e.g., 3x3, 4x4, 5x5...)
- 🎨 Player names, colors, and winning highlights
- 🔄 Restart/rematch button after game ends
- 📱 Mobile-friendly layout
- ☁️ Deployed via Render
- Backend: Python, Flask, Flask-SocketIO
- Frontend: HTML, CSS, JavaScript
- Real-Time: Socket.IO
- Deployment: Render (free hosting)
git clone https://github.com/akbarpourmaryam/flask-tic-tac-toe.git
cd flask-tic-tac-toe
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
python app.py
Visit: http://localhost:5000
- Push to a GitHub repo
- Go to https://render.com
- Click "New Web Service"
- Connect your GitHub repo
- Settings:
Setting | Value |
---|---|
Runtime | Python |
Build Command | pip install -r requirements.txt |
Start Command | python app.py |
Environment | Add ASYNC_MODE = eventlet |
Port binding | Automatically from os.environ.get("PORT") |
flask-tic-tac-toe/
├── app.py
├── Procfile
├── requirements.txt
├── templates/
│ ├── index.html
│ └── game.html
├── static/
│ ├── styles.css
│ └── game.js
Maryam Akbarpour
GitHub
Star it on GitHub and share with a friend!