Implementation of maps for Akvo Flow, based on Windshaft.
Flow will push datapoints to a Kafka queue (one per tenant) and Flow Maps will store the required data in a Postgres DB (one per tenant) that will later be used by Windshaft to draw the tiles.
The components:
Notes:
- Nginx is the only component exposed to the external world
- The tenant dbs are created when the first datapoint is received
- The map consumer and the auth proxy are right now running in the same JVM process
The Kafka consumer will consume any topic that matches the regex .*datapoint.*.. It expects an avro message with the schema as defined at Akvo Flow Schemas
To view a map:
- The auth flow in the diagram is a Client Credentials Grant. See also the the keycloak documentation.
- The auth proxy checks that the JWT token has a "akvo_flow_maps_client" role.
- The /create-map API expects a POST request with a JSON body with two keys:
- topic: the name of the Kafka topic that the data is sent to.
- map: a Windshaft MapConfig
To begin developing:
docker-compose up
A Clojure REPL will be listening on port 47480.
Nginx will be listening on localhost:7070, with an example UI.
To add an example dataset, look at the akvo.flow.maps.push-some-test-data namespace in the test directory.
Testing is fastest through the REPL, as you avoid environment startup time.
(dev/test)
To run the unit tests:
docker-compose exec flow-maps lein test
or the integration tests:
docker-compose exec flow-maps lein test :integration
Copyright © 2017 Akvo Foundation
Distributed under the GNU Affero General Public License 3.0