Cloud Functions for primap
flowchart TD
scheduler["Cloud Scheduler"] -- Runs once a day --> cron["CronUpdateShops"]
cron --> queue1["QueueSaveShop"]
cron --> queue2["QueueSaveShop"]
cron --> queue3["QueueSaveShop"]
queue1 --> firestore[(Cloud Firestore)]
queue2 --> firestore
queue3 --> firestore
There are the following functions.
- CronUpdateShops: Runs once a day with Cloud Scheduler, and get shops from PrismDB
- QueueSaveShop: Get geography from shop address and save to Cloud Firestore
Register followings from https://console.cloud.google.com/apis/credentials
GOOGLE_MAPS_API_KEY
- Application restrictions: None
- API restrictions: Geocoding API
Register following keys to Secret Manager
GOOGLE_MAPS_API_KEY
(required)
cp .env.examle .env
vi .env
Run one of the following
firebase --project test emulators:exec --only firestore,pubsub "make test"
- Requires Firebase CLI
docker-compose up --build