lonkaars / connect-4

It's like chess.com but for connect 4
https://connect4.pipeframe.xyz
MIT License
4 stars 0 forks source link
c connect-four flask nextjs nginx python python3 react reactjs socketio sql sqlite3 typescript venv

PO connect-4


GitHub package.json version Live commit version Live commit version
Discord invite

Some of this project's code is in Dutch (commit messages, documents etc.), along with the whole website. This was originally a school project, but I'm going to keep maintaining this project during my exams and summer break

Planned features:

Used libraries and frameworks:

A design prototype of the website can be found on Figma. The api documentation can be found in api/readme.md.

other readme's

setup

To set up this project you'll need to install npm and pip dependencies, pull all git submodules and compile voerbak and the sql extensions.

I haven't figured out how to run this project on Windows, so please install WSL if you want to run this yourself on Windows. The distro you choose doesn't matter, though package names in ./config may vary if your distro doesn't use the apt package manager.

automatic setup using ./config (debian/ubuntu)

This script might also work on other distro's using the apt package manager. To start the setup process you only need to run the following command:

./config

The script calls sudo and apt install so some password input/manual confirmation is required, but most of the install should be automated.

manual setup (other distro's)

If your disto doesn't use the apt package manager, you can still run this project by following these steps:

  1. git clone https://github.com/lonkaars/po-4-op-een-rij
  2. Make sure you have python (with pip and venv) installed.
  3. Make sure you have nodejs (with npm) installed.
  4. Make sure you have nginx installed.
  5. Make sure you have make and the gnu c compilers (gcc) installed (most distro's will have these by default).
  6. Install typescript and yarn:
    ./config yarn_install
  7. Create a new python virtual environment and install pip modules:
    ./config python_packages
  8. Install node modules:
    ./config node_packages
  9. Build voerbak:
    ./config voerbak
  10. Download submodules:
    ./config submodules
  11. Initialize database and build SQL extensions:
    ./config database

How to start

In order to start this project you'll need three terminal windows to start the flask server, react server, and nginx seperately:

# term 1
cd api
../venv/bin/python3 main.py

# term 2
yarn dev

# term 3
sudo nginx -c $PWD/nginx.conf

# if nginx can't run as the user nobody, try running the following command and restart nginx:
./config customize_config