Skip to content

ONSdigital/classifications-ui

 
 

Repository files navigation

classifications-ui

To run this project:

Pre-requisites:

Setup Environment Variables

Environment Variable Value Command
export FLASK_APP "cims_ui" export FLASK_APP="cims_ui"
export FLASK_ENV "development" export FLASK_ENV="development"
export API_AUTH_TYPE "JWT" export API_AUTH_TYPE="JWT"
export API_JWT_TOKEN [enter_jwt_token_here] export API_JWT_TOKEN="[enter_jwt_token_here]"
export BM_API_URL [enter_bulk_match_url] export BM_API_URL="[enter_bulk_match_url]"
export BM_JWT_TOKEN [enter_jwt_token_here] export BM_JWT_TOKEN="[enter_jwt_token_here]"
export API_BSC_AUTH_USERNAME [enter_bsc_username] export API_BSC_AUTH_USERNAME="[enter_bsc_username]"
export API_BSC_AUTH_PASSWORD [enter_bsc_password] export API_BSC_AUTH_PASSWORD="[enter_bsc_password]"
export PROJECT_DOMAIN [enter_project_domain] export PROJECT_DOMAIN="[enter_project_domain]"

Set the "groups" of users (by default all users including the "NotLoggedInUser" are in the "default" group

export USER_AUTHS='{"developers":["NotLoggedinUer"]}'

Note: JWT token is exported WITHOUT 'Bearer ' before it

Install Python Packages

pip install -r requirements.txt

Install project as a python package*

pip install -e .

To run Flask Project

python3 -m flask run

To lint code

For python:

yapf --style='{based_on_style: pep8, indent_width: 2}' -ir .

For js/mjs:

npm run lint

To Test

Python

python3 -m pytest tests/pytest_tests

Javascript

npm run test:jest

FOR WINDOWS USERS ONLY:

Ensure you have python 3.9 installed

Run a command window as an administrator and cd to the project root pip install -r requirements.txt

Download the design system templates from https://github.com/ONSdigital/design-system/releases

Unzip the components and layout directories into the project's templates folder

Set environment variables and run (on localhost:5000) set FLASK_ENV=development set FLASK_APP=src/cims_ui python -m flask run

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 63.4%
  • HTML 12.1%
  • JavaScript 11.9%
  • Nunjucks 6.9%
  • CSS 5.3%
  • Shell 0.2%
  • Dockerfile 0.2%