Skip to content

CoderDojoMaj/CoderBrothers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CoderBrothers

Install

Install Python3 for your OS:

Install libraries for the project

python3.8 -m pip install -r requirements.txt

Install MySQL

  • Windows: Installer
  • Mac OS X: Installer
  • Linux: Install MySQL with the package manager
    • Debian based (Ubuntu / Mint): sudo apt-get install mysql-server

mysql_secure_installation To configure root password (Maybe not needed on windows/MacOS, if the root password has been setup on the installation)

Setup the database

Linux / MacOS (Bash / Zsh / Fish)

cat setup.sql | mysql -uroot -p

Windows (CMD)

PowerShell -Command "cat setup.sql | mysql -uroot -p"

Windows (Powershell)

cat setup.sql | mysql -uroot -p

If none of that works, then execute this command on the project directory
mysql -uroot -p then put your root password
source setup.sql; to setup everything

Sidenote

Changing the coderbrothers user password is highly recomended, but for just testing it isn't necessary. To do it, the password on the mysql user has to be updated, as well as the password on the config.json file

Run

First, set up the environvemnt variable in your terminal

Loading the environment variables

Linux / MacOS (Bash / Zsh / Fish)

export FLASK_APP=server.py
export FLASK_ENV=development

Windows (CMD)

set FLASK_APP=server.py
set FLASK_ENV=development

Windows (Powershell)

$env:FLASK_APP = "server.py"
$env:FLASK_ENV = "development"

Actually running the server

flask run -p 8080

Go to http://localhost:8080 to see the page


Sidenote

On MacOS & Linux, start.sh can be run to do everything

First give it permissions to run with

chmod +x start.sh

And then just run it with

./start.sh

On Windows, start.bat can be run to do everything

Using Docker

Install

For ease of use you can run the project in Docker.

Install Docker

  • Windows: Docker Desktop on Windows

  • MacOS: Docker Desktop on Mac

  • Linux: Choose your distro

    • Or install using the convenience script (CentOS/ Debian/ Fedora/ Raspbian/ Ubuntu):

      curl -fsSL https://get.docker.com -o get-docker.sh
      sudo sh get-docker.sh
    • Docker compose does not install with the docker engine on linux. You can install it with the following commands:

      sudo curl -L "https://github.com/docker/compose/releases/download/1.28.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
      sudo chmod +x /usr/local/bin/docker-compose
    • In case you still can't docker-compose try adding it to your PATH:

      sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

Run

Once Docker is installed, go to the folder where you cloned the repository and run the following command:

docker-compose up

Server is now runing

Go to http://localhost:8080 to see the page.

About

Website for CoderDojo Majadahonda in Madrid, Spain

Resources

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •