keviinx / kickeridoo50

⚽ CS50x final project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kickeridoo50

TL;DR

CS50x Final Project: Kickeridoo50

Link to deployment on Render.com

https://kickeridoo50.onrender.com/

About Kickeridoo50

The name Kickeridoo came to be by fusing the word Kicker which is the German nickname of foosball and Didgeridoo (No idea how we came up with that name). Me and my colleague loves to play foosball during our break time and to keep track of the scores, I have been using spreadsheet.

Kickeridoo spreadsheet

So then I had the idea of making a web application so that updating the score of the player will be easier. The application is called Kickeridoo50.

The Kickeridoo50 app

Kickeridoo50 features

Main page

This is the first page when you access the application. The page basically lists out the features of Kickeridoo50 and a short description explaining the feature.

Add result

This page allows the user to add the result of a match. The game type can be chosen whether it was a solo match (1 vs 1) or team (2 vs 2). The user can then select players using the drop-down list. The player name list is based on the players added into the database. The user can then decide whether team 1 won, team 2 won or the match was a draw.

Add result user interface

Add player

This page allows the user to add a new player into the database. The new player will then be accessible in the Add result feature.

Add player user interface

Player ranking

This page displays the ranking of each player. The result is displayed in alphabetical order but the result can be sorted by clicking the table header. The total points is calculated using this formula: (win * 3 points) + (draw * 1 point)

Player ranking user interface

Team ranking

This page displays the ranking of teams. The result displayed is similar to Player ranking page. The result is sorted alphabetically for Player 1. The result can also be sorted by clicking the table header.

Team ranking user interface

Implementation

The application was developed using bootstrap and flask.

Setting up and running it

  1. Just clone the repo.
  2. (Optional) create a virtual environment

On Linux:

python3 -m venv venv

then activate the virtual environment

source venv/bin/activate
  1. Install required packages either by (i) install cs50
pip install cs50

or (ii) install using the requirements.txt

pip install -r requirements.txt
  1. then run
export FLASK_APP=application.py
  1. and finally
flask run

Automate starting application using bash script

  1. Modify the directory of kickeridoo 50 if necessary (default is ~/Github/kickeridoo50)

  2. Add the script to cron by running

crontab -e
  1. then add this line
@reboot /home/ubuntu/Github/kickeridoo50/startup.sh

Now the application should start after rebooting the system.

Using as Docker container

The docker container can be built manually by following the steps below:

  1. Ensure the Docker daemon is running, and is accessible by your user account

  2. Clone and deploy the docker app using the following commands

git clone https://github.com/keviinx/kickeridoo50.git
cd kickeridoo50
docker build . -t kickeridoo50
docker run -p 5000:5000 kickeridoo50

Using Docker Compose

With the created docker image, you can also use docker compose to start the kickeridoo server by running the command below:

docker compose up

About

⚽ CS50x final project


Languages

Language:Python 50.9%Language:HTML 45.6%Language:CSS 2.0%Language:Shell 0.8%Language:Dockerfile 0.8%