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
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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.
0.9
First you have to install Docker for your local workstation.
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
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