- Terraform CLI installed.
- Google Cloud SDK installed.
-
Authenticate with GCP:
gcloud auth application-default login
-
Initialize Terraform:
terraform init
-
Review the Plan:
terraform plan
-
Apply Changes:
terraform apply
Access is managed via Google Groups to streamline permissions for the ML Engineering team.
- Group: Set via
ml_group_emailinterraform.tfvars - Permissions: Members of this group inherit read/write access to the storage buckets for ML and data work.
To onboard a new engineer:
- Add their email to the Google Group.
- Have them run the
gcloudauth command listed above.
The backend uses Firebase Cloud Functions with the following secrets:
-
POLAR_ACCESS_TOKEN: API token from Polar.sh dashboard
firebase functions:secrets:set POLAR_ACCESS_TOKEN
-
POLAR_WEBHOOK_SECRET: Webhook signing secret from Polar.sh webhook settings
firebase functions:secrets:set POLAR_WEBHOOK_SECRET
- RESEND_API_KEY: API key from Resend dashboard
firebase functions:secrets:set RESEND_API_KEY
After setting secrets, deploy functions:
cd functions
firebase deploy --only functionsAfter deployment, configure this webhook URL in your Polar.sh dashboard:
https://europe-west1-<ZEST_PROJECT_ID>.cloudfunctions.net/polar_webhook
Enable the following webhook events:
- order.created (fires when a one-time purchase is completed)
- order.paid (fires when payment is confirmed)
- order.refunded (fires when a refund is processed)
- checkout.updated (fires when checkout status changes)