Skip to content
This repository has been archived by the owner on Aug 21, 2019. It is now read-only.

uktrade/directory-ui-supplier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

directory-ui-supplier

Find a Supplier

code-climate-image circle-ci-image codecov-image gitflow-image calver-image


Development

Installing

$ git clone https://github.com/uktrade/directory-ui-supplier
$ cd directory-ui-supplier
$ virtualenv .venv -p python3.6
$ source .venv/bin/activate
$ pip install -r requirements_text.txt

Requirements

Python 3.6

redis

Configurations

Secrets such as API keys and environment specific configurations are placed in conf/.env - a file that is not added to version control. You will need to create that file locally in order for the project to run.

Here are the env vars to get you going:

DIRECTORY_FORMS_API_API_KEY=debug
DIRECTORY_FORMS_API_SENDER_ID=debug

Directory Forms

Form submissions are powered by directory-forms-api. Set that up locally then generate a API client here and add the values to env vars to conf/.env.

Run the webserver

$ make debug_webserver

Run the test

$ make debug_test

CSS development

If you're doing front-end development work you will need to be able to compile the SASS to CSS. For this you need:

$ npm install yarn
$ yarn install --production=false

We add compiled CSS files to version control. This will sometimes result in conflicts if multiple developers are working on the same SASS files. However, by adding the compiled CSS to version control we avoid having to install node, npm, node-sass, etc to non-development machines.

You should not edit CSS files directly, instead edit their SCSS counterparts.

Update CSS under version control

$ gulp make compile_css

Session

Signed cookies are used as the session backend to avoid using a database. We therefore must avoid storing non-trivial data in the session, because the browser will be exposed to the data.

Translations

Follow the Django documentation.

To create or update .po files:

$ make debug_manage cmd="makemessages"

To compile .mo files (no need to add these to source code, as this is done automatically during build):

$ make debug_manage cmd="compilemessages"

Helpful links

Related projects:

https://github.com/uktrade?q=directory https://github.com/uktrade?q=great