How lazzerbeamstudios/spectra works
Project type and purpose
• This is a Go-based, monolithic backend API service (“api-v1”) that exposes REST endpoints for authentication (SignIn, SignUp), user profiles, and a home endpoint.
• It uses Ent (an ORM) and Atlas for schema migrations against a PostgreSQL database.
• It includes local collections (“collection-v1”) for API testing (Bruno scripts).
• Infrastructure is defined via Docker, Helm charts (“helm-v1”), Kubernetes manifests, and Terraform/OpenTofu (“opentofu-v1”) for provisioning on GCP (GKE).
• CI/CD workflows build, test, and push Docker images, then deploy to clusters via Helm/ArgoCD.
File structure
• Top level:
• api-v1/ – main Go service
• collection-v1/ – API test collections
• helm-v1/ – Helm chart and values for dev/stag/prod
• opentofu-v1/ – Terraform modules for GKE, VPC, GCP resources
• Dockerfile + docker-*.sh – container build scripts
• .github/workflows/*.yml – GitHub Actions (build, test, publish)
• Within api-v1:
• api.go (entry point)
• ent/ – generated ORM code, migrations, schema, hooks
• routes/ – handlers organized by feature (auth, users, home)
• mutations/ – business-logic layer
• utils/ – cross-cutting helpers (DB, Auth, Encode, GCP Files, Password)
• environment/ – loader for .env files (dev, docker)
• Infrastructure-as-code spans from local k3d clusters (k3d.yaml) to full GKE autopilot/standard Terraform.
Key README insights
• Dependencies: Go 1.23.6 (via asdf), Atlas CLI, ent code generator, Docker, k3d, Helm, ArgoCD, OpenTofu/Terraform, gcloud SDK.
• Common commands for running/migrating the database, generating ent code, and launching the API in various environments.
Diagramming conventions
• Use rectangles for compute components (API service, CI runner, Terraform controller).
• Blue for code/runtime (Go service)
• Green for infra components (K8s, Terraform)
• Orange for CI/CD (GitHub Actions, Docker Registry)
• Gray for utilities/external services