The beachfront API (bf-api) project is a standalone web service which provides the Beachfront UI and other external projects with a unified interface for creating and querying automated shoreline detection data.
Before building and/or running bf-api, please ensure that the following components are available and/or installed, as necessary:
- Java (JDK for building/developing, otherwise JRE is fine)
- Maven (v3 or later)
- Git
- PostgreSQL
- RabbitMQ
- An available instance of Beachfront IA Broker
- Access to Nexus is required to build
Ensure that the nexus url environment variable ARTIFACT_STORAGE_URL
is set:
$ export ARTIFACT_STORAGE_URL={Artifact Storage URL}
If running bf-api locally, the following components are also necessary:
- fake_geoaxis (to run locally
- PostGIS - Recommend Vagrant Box that comes with pz-ingest (vagrant up postgis)
- GeoServer - Recommend GeoServer Vagrant Box that comes with pz-access (vagrant up geoserver)
Create the directory the repository must live in, and clone the git repository:
$ mkdir -p {PROJECT_DIR}/src/github.com/venicegeo
$ cd {PROJECT_DIR}/src/github.com/venicegeo
$ git clone git@github.com:venicegeo/bf-api.git
$ cd bf-api
Note: In the above commands, replace {PROJECT_DIR} with the local directory path for where the project source is to be installed.
The src/main/resources/application.properties
file controls URL information for postgreSQL, ia-broker, and geoserver connection configurations. By default, PostgreSQL is assumed to be running locally on port 5432. If this needs to be changed, this can be done through application.properties
.
To build and run the Beachfront API locally, navigate to the project directory and run:
$ mvn clean install -U spring-boot:run
To run the Beachfront API unit tests from the main directory, run the following command:
$ mvn test