Skip to content

Latest commit

 

History

History
89 lines (63 loc) · 2.06 KB

File metadata and controls

89 lines (63 loc) · 2.06 KB

Setup & Operations

Getting Started

Prerequisites

  1. Terraform CLI installed.
  2. Google Cloud SDK installed.

Setup & Deployment

  1. Authenticate with GCP:

    gcloud auth application-default login
  2. Initialize Terraform:

    terraform init
  3. Review the Plan:

    terraform plan
  4. Apply Changes:

    terraform apply

IAM & Security

Access is managed via Google Groups to streamline permissions for the ML Engineering team.

  • Group: Set via ml_group_email in terraform.tfvars
  • Permissions: Members of this group inherit read/write access to the storage buckets for ML and data work.

To onboard a new engineer:

  1. Add their email to the Google Group.
  2. Have them run the gcloud auth command listed above.

Firebase Functions Secrets

The backend uses Firebase Cloud Functions with the following secrets:

Polar.sh Payment Integration

  1. POLAR_ACCESS_TOKEN: API token from Polar.sh dashboard

    firebase functions:secrets:set POLAR_ACCESS_TOKEN
  2. POLAR_WEBHOOK_SECRET: Webhook signing secret from Polar.sh webhook settings

    firebase functions:secrets:set POLAR_WEBHOOK_SECRET

Email Service (Resend)

  1. RESEND_API_KEY: API key from Resend dashboard
    firebase functions:secrets:set RESEND_API_KEY

Deployment

After setting secrets, deploy functions:

cd functions
firebase deploy --only functions

Webhook Configuration

After 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)