Skip to content

akbarpourmaryam/flask-tic-tac-toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎮 Flask Tic Tac Toe (Multiplayer, N x N)

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.


🚀 Features

  • 🔁 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

🛠️ Tech Stack

  • Backend: Python, Flask, Flask-SocketIO
  • Frontend: HTML, CSS, JavaScript
  • Real-Time: Socket.IO
  • Deployment: Render (free hosting)

🧑‍💻 Run Locally

1. Clone & set up environment

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

2. Install dependencies

pip install -r requirements.txt

3. Run the app

python app.py

Visit: http://localhost:5000


🌐 Deploy to Render (Free)

✅ One-time setup

  1. Push to a GitHub repo
  2. Go to https://render.com
  3. Click "New Web Service"
  4. Connect your GitHub repo
  5. 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")

📁 Project Structure

flask-tic-tac-toe/
├── app.py
├── Procfile
├── requirements.txt
├── templates/
│   ├── index.html
│   └── game.html
├── static/
│   ├── styles.css
│   └── game.js

🙋‍♀️ Author

Maryam Akbarpour
GitHub


⭐️ Like this project?

Star it on GitHub and share with a friend!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •