Web-based idle game in a medieval context. A project for the course Programming Project Databases (INFORMAT 1002WETDAT)
By Abobaker Rahman, Raadin Bahrami, Jonas Degruytere, Salaheddine Edfiri, Kars van Velzen
- Scope & Game Description
- Simple Auto-Build to server (Follow (autoBuild after the initial setup)
- Idle Game
- Multiplayer Mechanics
- Documentation
- See ultra-high-level for an incomplete but short overview of the game play
- Design Choices focused on a low server load
- Focus on database expandability
- Game is "user-interactive" in the sense that code only gets executed upon a user input
- Inappropriate username checker
- Username validation checker
- Narrator Intro
- In-game Guidance & Explanation
For the workings of the game, refer to the documentation in which every component is explained. We recommend reading from the database, to the backend to the frontend to get a solid grasp about the mechanics.
We don't own any right to the used artworks in our game (pictures, audio, 3D Models). We call upon the educational use of any potentially copyrighted materials. Throughout our files and code you may find credits to the original authors. (e.g. see buildingList)
This guide assumes you have an Ubuntu Server running with a Nginx Webserver & PostgreSQL configured with a valid SSL Certificate. Optionally, like we did, you can retrieve your free SSL Certificate using Certbot.
Don't forget to clone this repository!
- python3
sudo apt install nodejs
- psycopg2
sudo apt install python3-psycopg2
- nodejs
sudo apt install nodejs
- npm
sudo apt install npm
- nginx
sudo apt install nginx
- postgresql
sudo apt install postgresql
First configure the database with postgres
user:
sudo su postgres
psql
Create the database and adjust the password as written in database.py
CREATE DATABASE ppdb OWNER postgres;
ALTER USER postgres WITH PASSWORD 'password';
Then install the database and restarts postgresql
psql ppdb -f sql/schema.sql
sudo systemctl restart postgresql
virtualenv -p python3 env
source env/bin/activate
pip3 install -r requirements.txt
cd src/frontend/
sudo npm install
sudo npm run build
sudo adduser --disabled-login app
sudo su - app
Instead of using the Flask debug server, we use gunicorn to serve the application.
cd src/
gunicorn --bind 0.0.0.0:5000 wsgi:app
As an account with sudo access (not app), copy the file service/webapp.service
to /etc/systemd/system/
and enable the service:
sudo ln -s /home/app/Clash-of-ppdb-s/service/webapp.service /etc/systemd/system/
sudo systemctl enable webapp
sudo systemctl start webapp
A file src/webapp.sock
should be created.
Link or copy the nginx server block configuration file to the right nginx folders:
sudo ln -s /home/app/Clash-of-ppdb-s/nginx/webapp /etc/nginx/sites-available/
sudo ln -s /home/app/Clash-of-ppdb-s/nginx/webapp /etc/nginx/sites-enabled/
Test the configuration with sudo nginx -t
.
Restart the server with sudo systemctl restart nginx
. Your application should be available on port 443.