This repo hosts a web app that gives language games to users, and returns their solutions to a database.
Key specs:
To run/develop wugsy locally, first, make sure you have Docker installed, and the Docker daemon running. Then, clone the repo, cd
into it, make a local settings file, and use the provided script to launch:
git clone https://github.com/acdh-oeaw/wugsy
cd wugsy
cp src/wugsy/settings/local.sample.env src/wugsy/settings/local.env
sh ./start.sh
Then, point your web browser to http:/localhost:8000/
.
Docker is the preferred way to do development, because we can all be more certain that we are running code in the same environment. It also simplifies deployment a lot.
But, if you don't have or want to use Docker, there is still hope. If this is you, please work from within a Python 3 virtualenv. Then, do something like:
git clone https://github.com/acdh-oeaw/wugsy
cd wugsy
cp src/wugsy/settings/local.sample.env src/wugsy/settings/local.env
pip install -r requirements.txt
python src/manage.py makemigrations
python src/manage.py migrate
python src/manage.py runserver
Then, point your web browser to http://127.0.0.1:8000/
.
To make collaboration between backend and frontend devs easier, we use JSON to exchange data. To aid this process, we have some schemata that describe how the JSON should be structured. Information about these schemata can be found in schemata/schemata.md
.
The backend -> frontend format, which gives the frontend everything needed to set the look and behaviour of the game board, is provided in schemata/new-game.json
.
The frontend -> backend format, used to communicate game results, is provided in schemata/end-game.json
.
Python code for validating JSON is in src/wugsy/validate.py
.
For each game type, there should be an associated rule list described in rules/
. For game00
, for example, in rules/game00.md
we may find:
* TITLE: "Describe the concept to your opponent without using any of the displayed words"
* CARDS: each card shows text, can be deleted, but not selected
* TIMER: countdown from 30 seconds
* ENDING: when the user hits hits the 'Done' button
... etc.
Backend developers will use the game rules to write code that extracts useful data from the database, and to store game results in a different database. Frontend developers will formulate each game as a class or method that can be applied to the game board in order to turn various functionalities on or off, to populate text fields, and so on.
The frontend receives JSON that can be used to start the right game, display the user's score and opponent, and populate the various fields with words and so on. All games share a fairly similar board, though game boards may not be identical. The board will contain:
For example, for the sample data in schemata/new-game.json
, the frontend would generate a 2x2 grid, with board functionality determined by code that implements rules/game00.md
.
For a hypothetical game03
:
src/static/site/js/game.js
BaseGame
(only needs to be done once)Game03
that takes one argument, the JSON from the backend.rules/game03.md
src/templates/game.html
)./game_result
that conforms to schemata/end-game.json
games
map so that it will be automatically foundThe game should be aesthetically pleasing, minimalistic and clean. Animations, transitions etc. are not required for the prototype, but should be included later.
Project is open source and anybody can contribute. Please use issue tracking. Create branches for each issue and submit PRs.