Giter VIP home page Giter VIP logo

wqp_ui's Introduction

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>
SITES_MAP_GEOSERVER_ENDPOINT=<url to ogcproxy>
SLD_ENDPOINT=<url to SLD endpoint>
CODES_ENDPOINT=<url to lookup codes endpoint>
SEARCH_QUERY_ENDPOINT=<url to search query endpoint - should add with '/'
PUBLIC_SRSNAMES_ENDPOINT=<url to public srsnames endpoint>
NLDI_SERVICES_ENDPOINT=<url to NLDI>

In addition are the following optional environment variables that may be used:

WSGI_STR=<this string will be removed when using really URLS. Defaults to empty string
GA_TRACKING_CODE=<google analytics code, defaults to empty string
NLDI_DISABLED=<include this if NLDI feature should be disabled>
ROBOTS_WELCOME=<include if you want to allow robot crawling>
LOCAL_BASE_URL=<only needed if url mapping requires it>

# 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 if one doesn't exist. By default these will point to production services. You will need to fill in the url for the geoserver endpoint, WQP_MAP_GEOSERVER_ENDPOINT

For Windows machines it is recommended that Windows Subsystem for Linux (WSL) is used. At the time of writing this WSL version 1 must be used due to a bug in version 2. To install WSL:

  1. Go to https://docs.microsoft.com/en-us/windows/wsl/install-win10 and scroll to the section titled "Manual Installation Steps"
  2. Complete steps 1-4 in that section
  3. In powershell run wsl --set-default-version 1
  4. Go to https://docs.microsoft.com/en-us/windows/wsl/install-manual and download a distro of Linux
  5. Open up a powershell prompt inside the folder that contains the downloaded linux distro
  6. run Add-AppxPackage .\app_name.appx, substituting 'app_name' with the name of the file

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 on how to run for 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.

wqp_ui's People

Contributors

mbucknell avatar ayan-usgs avatar jkreft-usgs avatar lprivette avatar danielnaab avatar abriggs-usgs avatar lilyhoutman avatar skaymen avatar mitchas avatar dependabot-preview[bot] avatar orosz-usgs avatar cschroedl-gov avatar ssoper-usgs avatar abigail770 avatar kkehl-usgs avatar codacy-badger avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.