Skip to content

"Connect4 Game" modernizes the classic Connect Four, merging React for the frontend, Flask for the backend, and Python for AI. Offering Two-player and AI modes, it boasts an intuitive UI for an engaging experience, breathing new life into this nostalgic game with cutting-edge web technologies.

License

Notifications You must be signed in to change notification settings

protyayofficial/connect4game

Repository files navigation

Flask NPM NodeJS React React Router TailwindCSS Vite Visual Studio Code Python JavaScript HTML5 CSS3 Debian

Connect4 Game

This repository contains the code for a Connect Four game built using React for the frontend, Flask for the backend, and Python for the AI logic.

Features

  • Two gameplay modes: Two-player mode and Play with AI mode.
  • Intuitive UI with a board for gameplay and options for starting, restarting, and exiting the game.

Tech Stack

Frontend

  • React
  • Vite (for fast development)
  • Tailwind CSS (for styling)
  • HTML

Backend

  • Flask (Python web framework)
  • Python (for AI logic)

Prerequisites

  • Node.js and npm (for running the frontend)
  • Python (for running the backend and AI logic)

Getting Started

Frontend

  1. Clone the repository: git clone https://github.com/yourusername/connect-four.git
  2. Navigate to the frontend directory: cd connect-four/frontend
  3. Install dependencies: npm install
  4. Run the frontend: npm run dev
  5. Access the application in your browser at http://localhost:3000.

Backend

  1. Navigate to the backend directory: cd ../backend
  2. Create a virtual environment (optional but recommended): python -m venv venv source venv/bin/activate # for Unix/Linux
  3. Install Flask and required dependencies: pip install -r requirements.txt
  4. Run the Flask server: python app.py

This will start the Flask server for the backend.

AI Logic

The AI logic is implemented in Python. The Flask backend provides an API endpoint /get_ai_move that serves AI moves during the game.

Additional Notes

Update the setupProxy.jsx in the frontend to specify the correct backend URL if the Flask server runs on a different port or domain.

Credits

Developed by Protyay Dey. Inspired by the classic game of Connect 4.

License

License: MIT

About

"Connect4 Game" modernizes the classic Connect Four, merging React for the frontend, Flask for the backend, and Python for AI. Offering Two-player and AI modes, it boasts an intuitive UI for an engaging experience, breathing new life into this nostalgic game with cutting-edge web technologies.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published