Skip to content

uktrade/directory-companies-house-search

Repository files navigation

directory-companies-house-search

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

Companies House search service - the Department for Business and Trade (DBT)

For more information on installation please check the Developers Onboarding Checklist


Development

Read the Developers Onboarding Checklist

The back-end framework is Django. To provide accessibility, reduce technical complexity, and minimise cross-browser compatibility issues the front-end uses minimal JavaScript. Therefore most front-end work will be HTML and SASS/CSS development.

We aim to follow GDS service standards and GDS design principles.

Requirements

Python 3.9.13
Redis

SASS

We use SASS CSS pre-compiler. If you're doing front-end work your local machine will also need the following dependencies:
node
SASS

Running locally

Installing

$ git clone https://github.com/uktrade/directory-companies-house-search
$ cd directory-companies-house-search
$ python3.9 -m venv .venv
$ source .venv/bin/activate
$ make install_requirements
$ make manage migrate
$ make manage createsuperuser
$ make manage import_ch_companies

Configuration

Secrets such as API keys and environment specific configurations are placed in conf/env/secrets-do-not-commit - a file that is not added to version control. To create a template secrets file with dummy values run make init_secrets.

Commands

Command Description
make clean Delete pyc files
make pytest Run all tests
make pytest test_foo.py Run all tests in file called test_foo.py
make pytest -- --last-failed` Run the last tests to fail
make pytest -- -k foo Run the test called foo
make pytest -- Run arbitrary pytest command
make flake8 Run linting
make manage Run arbitrary management command
make webserver Run the development web server
make requirements Compile the requirements file
make install_requirements Installed the compile requirements file
make css Compile scss to css
make init_secrets Create your secret env var file

Configuration

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. In order to authenticate with the Companies House API set the DIRECTORY_CH_SEARCH_COMPANIES_HOUSE_API_KEY before you run the webserver

Running the webserver

$ source .venv/bin/activate
$ make webserver

API Schema

API schema is available at paths:
Direct download (yaml) - openapi/
Swagger UI - openapi/ui/
Redoc - openapi/ui/redoc/

Helpful links

Related projects:

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