Familiarizing yourself with the codebase
Check the technical documentation. It is sparse, but it should contain the information necessary to have a good overview of the codebase, and have a local environment up and running.
Technical Documentation
General Architecture
The project is separated into 2 components:
A website in Python with the Django framework. This component handles user registrations, creating games as well as a joining them. It exposes a REST API used by the game server. Finally, it also contains the logic for the chat used in the games. The code is located in agot-bg-website/.
A game server in Typescript with React, mobx and bootstrap. It runs the games of AGoT. It is itself composed of a front-end and a back-end. The code is located in agot-bg-game-server/.
Additional documentation about how those components work can be found in the folder of each component.
How to Run
There a multiple ways to run the code, depending on what components on what you want to run.
Launching the Game Only
Requires NodeJS and yarn. Install the dependencies and initialize the environment variables by executing:
Code: Select all
cd agot-bg-game-server/
yarn install
yarn run generate-json-schemas
cp .env.dev.local .env
Code: Select all
yarn run run-client
Code: Select all
yarn run run-server
Closing and re-reunning run-server will create a new game.
Note: The chat, which is managed by the website, will not be available.
Launching the Website Only
Requires docker and python3.
To spin up the PostgreSQL database and a Redis database, open a terminal and execute docker-compose up.
Install the dependencies of the component, initialize the database and create a super user by running:
Code: Select all
cd agot-bg-website/
cp .env.dev .env
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python3 manage.py migrate
# This command will ask for a password. Use "rootroot"
python3 manage.py createsuperuser --username Longwelwind
Code: Select all
python3 manage.py runserver
Note: If you try to open a game via the website, you will land on a template page.
Launching the Game and the Website
To launch the 2 components and make them inter-connected, make sure the dependencies are installed and the database is up and running (follow the instructions given in the precedent sections).
Replace the environment configuration of the game-server with a live one: cp .env.live .env.
The front-end of the game server must be built and placed in the website. This can be done by executing
Code: Select all
./build_and_place_game_client_into_django.sh.
- In agot-bg-game-server/, execute yarn run run-server.
- In agot-bg-website/, execute python3 manage.py runserver.
- Make sure to create an issue (both for bugs and features) before working on any implementation. This will allow [mention]Longwelwind[/mention] and regular contributors to possibly help you on detailing where changes will need to be made in the code in order to resolve the issue.
You can create suggestions for features also in the idea section on the forum, and/or create a GitHub issue.
- In case of a new feature, make sure to detail exactly what you think should be added to Swords and Ravens. If it's related to the UI, don't hesitate to include a mock-up of how the features would look once implemented.
- Longelwind is generally open to new features for S&R, but reserve the right to refuse a feature that he feels like it would not be a good fit for the project.
Once you know the issue you want to work on, you can begin implementation on it. Don't hesitate to ask for help on how to implement a feature.
Once done, you can create a Pull Request on GitHub to have the feature merged in the codebase:
- Base your PR off master and try to keep it updated as much as possible, by using git rebase master.
- PR must be reviewed by myself before being merged into the codebase.
- If the PR includes changes to the UI, add a screenshot of the changes in the PR, this will help fasten the review process.
Development discussions happens in various relevant locations: