The GeoAwareness system consists of four primary components. Here is a description of each.
- Listens for telemetry event messages in the geoawareness-ingest Pub/Sub topic.
- Intersects events against geofence polygons stored in Datastore.
- Writes the results to Order and Event documents in Datastore.
REST API - Provides access to the Geoawareness data model and telemetry event ingest services.
Order Monitor - Website consisting of a near real-time dashboard of customer locations along with their ETAs. The dashboard includes both a map and order queue.
Mobile Tracker - Mobile website that emulates the customer experience for placing an order and tracking location as the customer progresses towards the store.
The Geofencing service and REST API are backend components while Order Monitor and Mobile Tracker are frontend components. Both frontend components are example integrations. Each component resides in its own repository.
Deploy to GCP
All components will be deployed into a single Google Cloud Project.
Decide on a project id, region, and zone.
export PROJECT_ID=<YOUR_PROJECT_ID> # Create new cloud project gcloud projects create $PROJECT_ID # Create new cloud project within GCP folder (optional) # If you have a Google Cloud Organization and policy requires you to create a project within a specific folder. gcloud projects create $PROJECT_ID --folder=<YOUR_FOLDER_ID> # Configure gcloud shell environment gcloud config set project $PROJECT_ID export GCP_REGION=<YOUR_GCP_REGION> gcloud config set compute/region $GCP_REGION export GCP_ZONE=<YOUR_GCP_ZONE> gcloud config set compute/zone $GCP_ZONE
Follow the instructions provided in the individual READMEs included with each repository. We recommend standing up each component in the following order:
- Geofencing service
- be sure the smoke test passes before proceeding
- REST API
- Order Monitor
- Mobile Tracker
Run the Demo
Open Order Monitor and click on the Carmelit store to view the near real-time dashboard.
Open Mobile Tracker. Click Place Order followed by Leaving Now. Take note of the fictitious customer’s name in the top right corner.
In Order Monitor, watch the order queue (left) and map (right) as the customer’s order appears in the dashboard. Zoom in to a geofence by clicking the drive-time group heading in the order queue.
Open a few more instances of Mobile Tracker in your browser (new tabs) or on your mobile device(s). Place some more orders and don’t forget to click Leaving Now.
In Order Monitor, spend some time watching the location updates on the map. As a customer crosses a geofence boundary, the order changes drive-time groups in the order queue.
Click Close on a customer order. The order disappears from the queue and map.