Skip to content

Latest commit

 

History

History
107 lines (73 loc) · 2.88 KB

README.md

File metadata and controls

107 lines (73 loc) · 2.88 KB

WQP_UI

===================

Codacy Badge Build Status codecov Dependabot Status

Water Quality Portal User Interface

This application should be built using python 3.6.x and node version > 8.x.x.

Local development - Docker

Two containers are provided - one for node-based build tooling, the second for a Python server container.

Build

docker-compose build

Development server

The Docker Compose configuration provides a default application configuration suitable for local development. If you would like to modify the configuration (see server/config.py), set the appropriate environment variables in the local.env file in the root directory of the project. The Geoserver Proxy requires a Geoserver URL. Example local.env file:

WQP_MAP_GEOSERVER_ENDPOINT=<url to Geoserver>
# Run in the foreground
docker-compose up

# Run in the background
docker-compose up -d

# Run just the Python dev server on port 5050
docker-compose up server

# Run just the node.js build server on port 9000
docker-compose up assets

Run tests

# Run Python server tests
docker-compose run server make test

# Run Javascript tests
docker-compose run assets npm test

Local development - Makefile configuration

Application configuration may be specified by creating an instance config in server/instance/config.py. This configuration augments the default one. The make devenv target will copy a sample, server/instance/config.py.sample, as a convenience. You will need to edit this to set WQP_MAP_GEOSERVER_ENDPOINT.

Install dependencies

The repository contains a make target to configure a local development environment:

make devenv

To manually configure your environment, please see the READMEs of each separate project.

Development server

To run each dev server individually:

cd server && make watch
cd assets && make watch

See the specific project READMEs for additional information, including how to use Redis and Celery with local development.

Run tests

To run all project tests:

make test

Clean targets

make clean      ; clean build artifacts
make cleanenv   ; clean environment configuration and build artifacts

make supports chaining targets, so you could also make clean watch, etc.