Skip to content

Project for the course Project Programming Databases at the University of Antwerp

Notifications You must be signed in to change notification settings

JeCheeseSmith/Clash-of-ppdb-s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Travisia, Fallen Empire - README

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

Functionalities:

  • 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

Documentation

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.

Copyright Notice

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)

How to start?

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!

0. Install Dependencies

  • 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

1. Create the database

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

2. Install Python Dependencies

virtualenv -p python3 env
source env/bin/activate
pip3 install -r requirements.txt

3. Install npm packages & build the frontend files

cd src/frontend/
sudo npm install
sudo npm run build

4. Create a user to run application

sudo adduser --disabled-login app
sudo su - app

5. Test if wsgi entrypoint works

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

6. Enable the webservice

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.

7. Setup nginx

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.

8. Restart the server

Restart the server with sudo systemctl restart nginx. Your application should be available on port 443.

About

Project for the course Project Programming Databases at the University of Antwerp

Resources

Stars

Watchers

Forks