Deployment Overview¶
PackyTrace has two deployment tracks:
- The application runs on AWS: one EC2 instance, Docker Compose, Caddy TLS, and Terraform. This is the accepted deployment decision in ADR-014.
- The documentation runs on Cloudflare Pages: MkDocs is built in GitHub Actions and uploaded to Cloudflare Pages.
The split is deliberate. The application needs containers, Postgres, a broker, and Keycloak. The docs are static files and should not consume the AWS box.
What Was Built¶
The AWS deployment is in deployment/aws. The docs deployment workflow is
.github/workflows/deploy-docs-cloudflare.yml.
Cloud Platform Choice¶
AWS was chosen for the application because the project needed to run on a real public URL within the AWS Free Plan / credit budget. Managed services such as RDS, MSK, ECS Fargate, load balancers, and EKS would consume the budget too quickly. The cheaper shape is one EC2 instance that runs the existing containers.
Cloudflare Pages was chosen only for documentation because it is free for static sites, simple, and independent from the application runtime.
Runtime Topology¶
Only Caddy is public. Postgres, Redpanda, Keycloak, and all seven services are private inside the Docker network.
Microservice Split¶
The platform is split by responsibility, not by technical layer.
| Service | Purpose | Stack |
|---|---|---|
api-gateway |
Public entry point, routing, token validation | Go |
passport-service |
GS1 resolver, product catalog, scan records | Go |
fridge-service |
Fridge items, expiry checks, waste summary | Go |
measurement-pipeline |
Consumer-side scan facts and aggregation pipeline | Go |
identity-service |
Visitors, accounts, consent, Keycloak integration | TypeScript |
personalization-service |
Health profiles and verdict rules | TypeScript |
brand-analytics-service |
Privacy-preserving brand aggregates | TypeScript |
The split preserves the main architecture rules:
- services share contracts, not code;
- every service owns its own database schema;
- events use JSON Schema contracts;
- raw consumer facts do not cross into brand analytics.