This is a production-style full-stack application built with Go and SvelteKit, designed to demonstrate a complete deployment to Google Kubernetes Engine (GKE). It includes: Clean Go architecture using dependency injection (repo -> service -> controller) gRPC for inter-service communication PostgreSQL with type-safe queries (SQLC) and managed migrations (Goose) Infrastructure-as-Code via Terraform (VPC, NAT, private GKE cluster, node pools) Kubernetes manifests + Gateway API for modern ingress routing
Backend:
Data:
Frontend:
VPC Network:
Subnets:
NAT Gateway:
Firewall Rules:
GKE Cluster:
Node Pool (small-pool):
(Optional — only if regenerating code)
I have hidden some secret files on git which include sensitive data, you will need to add your own to run this project.
You must create a secrets.yaml file in k8s folder and specify these 4 secrets:
apiVersion: v1
kind: Secret
metadata:
name: app-secrets
labels:
app: philosopher
type: Opaque
data:
pg_user:
pg_password: bXktYXdlc29tZS1wYXNzd29yZA==
db_name:
goose_string:
Create the secrets like this:
echo -n "my-awesome-password" | base64
bXktYXdlc29tZS1wYXNzd29yZA==
Then, in the terraform folder create terraform.tfvars and enter your project_id, default zone and default region of GCP:
project_id = "your-project"
region = "your-region"
zone = "your-zone"
In the .env file set the user and password you will use to connect to postgres
Run make dev
cd into the /terraform folder and run terraform plan and terraform apply
You will also need to update deploy.template.sh to add these env variables:
PROJECT_ID="" # Set your actual project ID here
REGION="" # Set your default region
REPO="" # Set the artifact registry repository name
Run make deploy-k8s. On the GCP console you should see all the resources created. Once they are ready, navigate to the external IP address of the gateway to test the full-stack app.