boundlessgeo/spatialconnect-server

Name: spatialconnect-server

Owner: Boundless

Description: null

Created: 2016-02-03 21:35:30.0

Updated: 2018-04-18 15:00:31.0

Pushed: 2018-01-19 20:07:42.0

Homepage: null

Size: 2115

Language: Clojure

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

spatialconnect-server

This server is the interface used to communicate with mobile clients using the SpatialConnect libraries. It's also the API that powers the dashboard web application.

Version

0.9

Running with Docker

First you have to install Docker for your local workstation.

Building the spatialconnect-server container

You can build the spatialconnect-server Docker container like this

er build -t boundlessgeo/spatialconnect-server .

Once you've built the container, you can push it to the Docker registry to trigger a redeployment:

er push boundlessgeo/spatialconnect-server

Note that anytime the boundlessgeo/spatialconnect-server GitHub repo is updated, the container will be rebuilt and deployed to the appropriate environment.

If you need to deploy to a Cloud Foundry environment, you can deploy the container like this:

ild the container for the environment
er build -t boundlessgeo/spatialconnect-server:devio .
sh to a container repo where PCF can access it
er push boundlessgeo/spatialconnect-server:devio
struct pcf to deploy the app using the container
ush efc -o boundlessgeo/spatialconnect-server:devio
Local development environment setup

First startup the database container:

er-compose up -d postgis

Then create the database and database user. (You may need to wait a few seconds for the db container to fully start)

er-compose run -e PGHOST=postgis -e PGUSER=postgres --rm postgis createuser spacon
er-compose run -e PGHOST=postgis -e PGUSER=postgres --rm postgis createdb spacon -O spacon

Then add the required extensions to our database.

er-compose run -e PGHOST=postgis -e PGUSER=postgres --rm postgis psql -d spacon -c "CREATE EXTENSION postgis;"
er-compose run -e PGHOST=postgis -e PGUSER=postgres --rm postgis psql -d spacon -c "CREATE EXTENSION pgcrypto;"

Now run the migration.

You will need to install leiningen to run the migration, if you haven't installed it yet. On OSX, run brew install leiningen.

erver/
 migrate

Start the spatialconnect-server container (which also starts the mosquitto container)

.
er-compose up -d spatialconnect-server
u can tail the logs to ensure everything worked as expected
er-compose logs -f spatialconnect-server

To run the webapp for local development,

path/to/spatialconnect-server/web
install
run start:local

The webpack-dev-server will host the app here http://localhost:8080 and rebuild the JS when you make changes.

When you're done, you can shut all the containers down with

er-compose stop

And if you want to remove all the containers, you can run

er-compose rm -vf

To test the TLS configuration, you can use the mosquitto_pub command line client. Make sure you obtain a valid token by authenticating to the spatialconnect-server container api first. Also note that the password is required even though it is not used.

uitto_pub -h <container hostname or ip> -p 8883 -t "test" -m "sample pub"  -u "valid jwt" -P "anypass" --cafile path/to/ca.crt --insecure -d

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.