We’re pleased that you are interested in working on Junction.
This document is meant to get you setup to work on Junction and to act as a guide and reference to the the development setup. If you face any issues during this process, please open an issue about it on the issue tracker.
Junction's development workflow is automated using nox. Thus, you need
the nox command to be installed on your system. We recommend using pipx
to install nox in its own isolated environment.
$ python -m pip install pipx
$ python -m pipx ensurepath
$ pipx install noxYou will need to have a working Redis server on your system. You may additionally want to install Postgres, although it is optional.
Note
On Debian based systems, these can be installed using:
$ sudo apt install redis-server postgresCreate a "settings" file for local development with Django.
$ cp settings/dev.py.sample settings/dev.pyCreate the database structure and populate it with sample data.
$ nox -- migrate --noinput
$ nox -- sample_dataWhen sample data is generated with nox -- sample_data, a superuser is
created with the username admin and password 123123.
Working on Junction's frontend requires NodeJS and yarn to be installed on your system. The frontend is built using grunt. To setup the working environment, run the following:
$ cd junction/static
$ yarn installJunction has a Grunt configuration that is useful when working on the frontend. The following command starts a build watcher which rebuilds the frontend on every file change.
$ gruntFor ease of development app.css is checked in to the source code. It is not
recommended to directly make changes to app.css, rather update the less files
and run grunt, then commit app.css
Junction's nox configuration is set up to invoke manage.py when no other
session (i.e. -s ...) is specified. This also automatically sets up an
isolated environment that contains the dependencies of Junction.
$ nox # equivalent to 'python manage.py'
$ nox -- runserver # equivalent to 'python manage.py runserver'
$ nox -- migrate # equivalent to 'python manage.py migrate'For running the tests, run:
$ nox -s testFor running the linters, run:
$ nox -s lintFor building the documentation, run:
$ nox -s docs