USGS-WiM / whispers

Wildlife Health Information Sharing Partnership event reporting system(WHISPers) v2
Other
2 stars 1 forks source link

This repository has been archived. It has been migrated to a new location at https://code.usgs.gov/WiM/whispers/

USGS WIM

whispers

WHISPers v2

This is the web client codebase for version 2 of Wildlife Health Information Sharing Partnership event reporting system. WHISPers allows users to enter, discover, and explore wildlife mortality data submitted by partners across North America and verified by trained biologists.

This project was built with Angular and generated with Angular CLI. It also relies on Leaflet, OpenStreetMap, NgxMatSelectSearch and the USGS Search API.

Installation

Prerequisite: Please install Angular-CLI by following these instructions.

git clone https://github.com/USGS-WiM/whispers.git

cd whispers

install the project's dependencies

npm install

Note: It is best to run npm install at least three times as it often takes several runs to successfully install all dependencies.

Environments

The three main environments are configured by environment files found at /src/enviroments/. The API / web services root URL for each environment is stored in these files. Default environment is development at environment.ts, used by the development server (see below). Test environment at environment.test.ts is used by the test build (see below). Production environment at environment.prod.tsis used by the production build (see below).

Development server for active development

Run ng serve for a dev server with live reload. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files. This will use the development environment configuration (environment.ts).

Documentation

The Compodoc documentation tool is used to generate static documenation of the WHISPers app.

Run npm run compodoc to generate and run the documentation server. Navigate to http://127.0.0.1:8080.

Angular code scaffolding

The Angular CLI offers a generate tool that makes the creation of some common component types a little easier.

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

User Interface Style Guide

For styling consistency, please refer to the UI Guidelines at UI_GUIDELINES.md.

Distribution build for test and production

When publishing the WHISPers app on the server for either the test phase or the final publishing to production level, a developer must run the Angular CLI build script to create a minimized, optimized package for server distribution. WHISPers has two build configurations: test and production.

Test

To be used when a new release version is ready for cooperator review but not yet ready for production.

Run ng build --configuration=test --base-href [relative path to web server root] to build the project. The build artifacts will be stored in the dist/ directory. This will use the test environment configuration.

Production

To be used when a release version has passed the testing phase by receiving approval for promotion by the cooperator.

Run ng build --prod --base-href [relative path to web server root] to build the project. The build artifacts will be stored in the dist/ directory. This will use the production environment configuration.

Note: the main differences between these two configurations are 1) the API root (prod services/database vs test services/database) and 2) the inclusion of Google Analytics for the production configuration.

Collaborative Development Process

Merging changes into the WHISPers codebase

WIM has established a collaborative development process that aims to ensure the integrity of the release process through stepwise and peer-reviewed code merges passing through a pipeline of protected branches.

The branches

After going to dev and possibly combined with other commits, the work will be packaged as part of a release tag and distribution build and merged with test and published to the test server.

Authors

See also the list of contributors who participated in this project.

License

This software is in the Public Domain. See the LICENSE.md file for details

Suggested Citation

In the spirit of open source, please cite any re-use of the source code stored in this repository. Below is the suggested citation:

This project contains code produced by the Web Informatics and Mapping (WIM) team at the United States Geological Survey (USGS). As a work of the United States Government, this project is in the public domain within the United States. https://wim.usgs.gov

Acknowledgments

About WIM