Skip to content

dnd-al-krk/portal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

portAL

Code style: black Build Status

portAL - Adventure's League community management service

This repository is for orchestrating other services running in the portAL.

Other related and used repositories are:

Requirements

In order to run and develop this project you need docker and docker compose installed in your system. Nothing else is required.

Development

To start developing the project:

  1. Clone this repository to your directory
  2. Clone frontend and backend repositories to the following dirs:
    $ git clone [email protected]:dnd-al-krk/portal_frontend.git frontend
    $ git clone [email protected]:dnd-al-krk/portal_backend.git backend
    
  3. Run $ cp docker-compose.dev.yml docker-compose.override.yml -- this will create your own docker compose file for development. You can adjust it to your needs.
  4. Run $ docker-compose build - this will build necessary docker images.
  5. Run $ docker-compose run --rm backend bootstrap - this will create necessary files, migrate db and import fixtures

To start development run docker-compose up. You can now open front-end in the browser under localhost:3000 and backend under localhost:8000/admin/.

Pre-generated users

Fixtures for the project provide basic users for each type: admin, DM and player.

Admin credentials are:

There are also added numerous of players/DM accounts created:

Their passwords are the same as login.

Pre-generated data

The fixtures also provide necessary data to start development process. You have past and future game sessions, example adventures and game session DM bookings or signups from players. All you need to get started.

Development guidelines

  • We are deeloping for python 3.6+
  • We try to stick with fairly recent python/django versions
  • We stick to PEP-8 except lines length which can be up to 120 chars (PyCharm standard)

We are using black formatter to standarize code in the project. To use it fully:

  1. Create local virtualenv (see manual instalation below) and install black with pip install black
  2. Install pre-commit
  3. Run $ pre-commit install - this will install pre-commit hook to your git repository that will check code with black on commit
  4. Also we follow the pattern for branches like feature/123-that_was_ticket_number. You can use pre-commit install --hook-type commit-msg to install tool pre-ticket for automatic ticket number reference in the commit message (in the front by default).

Testing

You can run pytest tests with: docker-compose run backend pytest

Continuous Integration

We are using TravisCI to maintain project code quality on high level. Currently CI checks if pytest and black formatting passes. We check against python 3.6, 3.7 and 3.8-dev. This is done automatically, but in order to merge Pull Request, these checks have to pass.

Manual Installation without Docker (not recommended)

Backend

The steps are:

  1. Clone this repo

  2. cd to repo (with manage.py file)

  3. Create virtualenv with virtualenvwrapper: mkvirtualenv portal

  4. Install requirements pip install -r requirements/devel.txt

  5. Create file fabric_config.py with contents (adjust if something is different in your config):

    import os
    
    from fabric.decorators import task
    from fabric.utils import _AttributeDict
    
    
    class DevelConfig(_AttributeDict):
        def __init__(self):
            self.local = True
            self.environment = 'devel'
            self.domain = 'localhost'
            self.env_path = '~/.virtualenvs/portal'
    
            self.project_root = os.path.dirname(os.path.abspath(__file__))
            self.DJANGO_SETTINGS_MODULE = 'settings.{environment}'.format(**self)
    
    
    @task
    def devel():
        env.update(DevelConfig())
  6. Bootstrap app with fab devel bootstrap -- this command is run once only on the first setup. It will let you create superuser for instance, which you will use two steps later.

  7. Run server with fab devel runserver

  8. Open in the browser http://localhost:8000/admin/ to access admin interface and provide any starting data.

Note: If you already have virtualenv created previously simply enter it before starting server: workon portal

Testing

You can run pytest tests with:

fab devel test or simply pytest as well.

Frontend

  1. Clone this repo if not cloned yet
  2. Enter repo dir and inside the front dir
  3. Run npm install
  4. Run npm run start
  5. The browser will start page automatically (localhost:3000) -- this is the interface for the user

Build with npm run build - it will move static and template files to proper directories and thus you will be able to access user interface also under http://localhost:8000/

License disclaimer

portAL is unofficial Fan Content permitted under the Fan Content Policy. Not approved/endorsed by Wizards. Portions of the materials used are property of Wizards of the Coast. ©Wizards of the Coast LLC.

Note: Code itself is available under the open source licence, but part of the repository materials (especially images) are used under the Fan Content Policy and cannot be redistributed or used commercially.

Releases

No releases published

Packages

No packages published