treffen

AGPL-3.0 License

Stars
2

Treffen

This project aims to implement a Killer game (also known as The Game of Assassination), but expand it with multiple modes.

The game in brief

The core principle is the following: every player involved in a game receive a ziel (german word for target) and a mission. In our example, if Alice and Bob are players, Alice has Bob as ziel and her mission could be Dance with your ziel during one song. If Alice succeeds, she will announce it to Bob, which discovers that Alice was his "hunter" (jaeger in the game), and give her his player code. Alice will now receive a new ziel and a new mission, and Bob will be out. The game continue until there is a single player left.

How to start a game

  • On a running instance, go the admin panel: if you're instance is hosted on treffen.example.com, the URL will be treffen.example.com/admin.
  • Enter your superuser credentials
  • Create a Game object. Choose the name wisely: it'll be the key to enter in the game
  • Create the required Missions you want for this Game. Don't forget to re-set the Game by linking missions to the game!
  • You can now announce your game to all players by giving them its name !
  • When everybody is registered, edit your game by switching its status from "Waiting to start" to "Started"
  • You're done ! The game is now running. You can see the advancement of the game on the /dashboard page(only accessible to superusers).

Implementation

The game is developed in the form of a web application built on the Django Framework and can currently by deployed through the following ways. If your's is missing please check out the infra issues here.

  • Docker deployment
  • Clever Cloud (because hosting is ).

Developement setup

Prerequesites : Postgresql, Python 3.9 at least, Pip. Done on Manjaro/ArchLinux, no guarantee on other OS yet _()_/.

  • Clone the project (git clone [email protected]:Dynnammo/treffen.git && cd treffen)
  • Install your virtual environment (in my case I use pew)
  • Go into your virtual environment (in my case pew new treffen && pew setproject treffen)
  • Install dependancies : pip install -r requirements.txt
  • Make migrations : python manage.py makemigrations
  • Run : python manage.py runserver
  • You're done. Give yourself a Kartoffelnsalat to celebrate.

Production setup

First and foremost...

For every deployment method, you'll need first:

  • a Postgres database available (mandatory for the next step)
  • a .env file completed with the appropriate values (follow .env.example model ):
    • set DJANGO_ENV to production
    • set SECRET_KEY to a long and unguessable string
    • set POSTGRES_ADDON_* variables set following your production-ready Postgres database

Running with CleverCloud

On clevercloud, you'll have to link your GitHub account or installing the Clever cloud CLI. Treffen works with a Postgres addon + a dozen of env variables provided in the .env.example file

Running with Docker

  1. Clone the project
git clone [email protected]:Dynnammo/treffen.git && cd treffen
  1. Build the image
docker-compose build
  1. Up the image (this will run all the development setup process)
docker-compose up (-d)

If you need to change any configuration such as db port, user, password, etc...,You can set it into the docker-compose.yml file

  1. Re - run migrations within the container
docker exec -it treffen_app python manage.py migrate       

Running on Ubuntu server

  • Connect to your instance in SSH
  • Setup your ~/.env file following .env.example guidelines (cf. here)
  • Run ./install.sh
  • You're done : go to the URL provided by host provider (e.g : http://example.com:8000).

Finally and aftermost...

  • Do not forget to setup SSL certificates
  • Setup your DNS

Contributing

See CONTRIBUTING.md file