Onboarding Guide: treetracker-infrastructure

Machine-generated onboarding guide for Greenstand/treetracker-infrastructure, the infrastructure-as-code that provisions and operates the Greenstand treetracker platform across DigitalOcean and AWS.

Source commit a740d11 - snapshot 2026-09-03. Start here, then explore the knowledge graph in the dashboard.

Project Overview

Each stack shares a common pattern: a pinned cloud provider plus an S3-compatible remote state backend. DigitalOcean stacks pin the digitalocean provider and store state in Spaces buckets; AWS stacks use the hashicorp/aws provider with real S3.

Architecture Layers

The repository is organized into ten platform layers. They are the best map of the codebase.

  1. Terraform Cloud Provisioning (53 nodes) - Terraform IaC for DigitalOcean and AWS: droplets, domains/DNS, AWS access/IAM, and the bastion host.
  2. Database Provisioning & Grants (198 nodes) - PostgreSQL schema, role, grant and default-privilege Terraform resources, plus pgpool routing and database backup storage for the microservice databases. The largest layer.
  3. Kubernetes Workloads & Secrets (50 nodes) - Kubernetes and Kustomize manifests plus SealedSecrets definitions that deploy and configure cluster workloads.
  4. API Gateway & Ingress (29 nodes) - Ambassador/api_gateway routing, mappings and ingress that expose backend services over HTTP.
  5. Identity & Access (Keycloak) (29 nodes) - Keycloak identity server: custom Docker image and theme, realm/client config, and deployment manifests.
  6. Messaging & Workflow Orchestration (29 nodes) - RabbitMQ broker configuration plus Airflow workflow-orchestration deployments and DAGs.
  7. Search & Data Platform (34 nodes) - Solr search, CKAN open-data portal, OpenProject, and the tag_lister service.
  8. Static Web Apps & Sites (31 nodes) - Static front-end web apps, other-sites hosting, and the cdn-images-api CDN delivery config.
  9. Observability & Alerting (37 nodes) - Monitoring stack, distributed tracing, and the Botkube chat-ops alerting integration.
  10. Platform Ops, CI & Docs (16 nodes) - Operational shell scripts and tooling, GitHub Actions/pre-commit CI, docs, and repo-level config.

Key Concepts

Guided Tour

Follow these 13 steps in order. They trace the platform from foundations up to day-to-day operations.

  1. Project Overview & CI - README.md, .pre-commit-config.yaml, .github/workflows/pre-commit.yaml. What the repo is and the CI guardrail.
  2. Terraform Provisioning Foundations - provider + remote-state backend blocks shared by every stack.
  3. Compute: DOKS Clusters & Bastion - kubernetes/terraform/{dev,prod}/cluster.tf, bastion/bastion.tf.
  4. Managed Postgres Database - database/terraform/database.tf. The production data tier and its firewall rules.
  5. Database Schemas & Least-Privilege Grants - database-grants/terraform/prod/main.tf and the reusable microservice_schema module.
  6. Kubernetes Secrets: Sealed Secrets - sealed-secrets/README.md, sealed-secrets/scripts/create-secret.sh.
  7. API Gateway: Ambassador Ingress - api_gateway/ambassador-playbook.yml and a sample Mapping.
  8. Identity: Keycloak - custom Dockerfile, base deployment.yaml, production Kustomize overlay.
  9. Messaging: RabbitMQ - rabbitmq/deployment/base/definition.yaml and its PodMonitor.
  10. Workflow & Data Platform - Airflow, Solr (solr/solr_chart/main.tf), and CKAN (ckan/.../values.yaml).
  11. Static Web Apps & CDN - web-apps/terraform/prod-web-map.tf, cdn-images-api/main.tf. The only major AWS-hosted layer.
  12. Observability: Metrics, Logs & Tracing - Prometheus/Grafana, Loki, Jaeger, all behind Ambassador mappings.
  13. Operational Tooling & Backups - scripts/README.md, tag_lister/list_tags_for_deployments.py, database-backup-storage/production-backups.tf.

File Map (by layer)

Complexity Hotspots

Most files are simple (461 simple, 42 moderate, 4 complex). Approach the four complex files carefully:

The database-grants/terraform/prod/main.tf fan-out (fifteen per-microservice schemas via one module) and the shared managed Postgres cluster are the highest fan-in points in the graph. Changes there ripple widely; review them with care.