âď¸ Darukaa.earth â Cloud Functions¶
This page documents every Google Cloud Function (GCF) that powers the Darukaa.earth data pipeline. It replaces the previous placeholder file that didnât reflect our current architecture.
Last updated: 23âŻJuneâŻ2025
đż Function Catalogue¶
| # | Function | Runtime | Region | Trigger | Purpose |
|---|---|---|---|---|---|
| 1 | process-site-boundary | Python 3.11 (GCF 2ndâŻgen) | usâcentral1 | HTTP | Ingest userâuploaded site shapefile (ZIP), convert to WKT, calculate centroid & area, persist to DB. |
| 2 | download-satellite-images | Python 3.11 | usâcentral1 | HTTP | Fetch multiâtemporal satellite mosaics from Google Earth Engine; return signed URLs that render directly on the client map. |
| 3 | biodiversity-analysis | Python 3.11 | usâcentral1 | HTTP | Core ecoâAI model: compute species richness, Shannon index, keystone species presence, habitat fragmentation scores for a site. Writes metrics back to DB. |
| 4 | carbon-analysis | Python 3.11 | usâcentral1 | HTTP | Estimate aboveâground biomass, soil organic carbon, and avoided deforestation tCOâe for a site; store outputs in DB. |
| 5 | env | Python 3.11 (Cloud Run) | usâcentral1 | HTTP | Generate environmental reporting KPIs (e.g., temperature anomaly, precipitation trend) using site centroid + climate reanalysis data. |
Note: All GCF URLs are secured by IAM; Cloud Run
envwill be migrated behind IAP in Q3Â 2025.
đ Execution Flow¶
sequenceDiagram
participant User as Frontâend User
participant API as Backend API (FastAPI)
participant F1 as processâsiteâboundary
participant F2 as downloadâsatelliteâimages
participant F3 as biodiversityâanalysis
participant F4 as carbonâanalysis
participant F5 as env
User->>API: Create Site + upload shapefile (.zip)
API->>F1: HTTP POST shapefile
F1-->>API: centroid, area, WKT saved to DB
API->>F2: HTTP POST site_id (WKT)
F2-->>API: signed GEE URLs (per date range)
Note over API,F3,F4,F5: Functions below run **only if enabled** for the site
API->>F3: site_id (WKT)
F3-->>API: biodiversity metrics
API->>F4: site_id (WKT)
F4-->>API: carbon metrics
API->>F5: site_id (centroid)
F5-->>API: climate KPIs
API-->>User: Dashboard & report data ready
âď¸ Deployment & CI/CD¶
- Sourceâofâtruth repo:
Product_backend/cloud_functions/* - Deployed via GitHub Actions â Cloud Build with pinned Python 3.11 runtime.
- Secrets: Accessed via Secret Manager.
Questions? Ping @Guneet (infra) or @Jaya (data science).