HQ Deploy Platform
Part of the split HQ ecosystem. HQ Deploy is the
hq-deploydata plane; deployments are visible in the hq-console admin UI, and it trusts the shared identity provisioned by hq-pro.
HQ Deploy is a platform-as-a-service built on AWS that lets you deploy web applications with a single CLI command. It supports static sites (S3 + CloudFront) and server-rendered Next.js and Hono apps (a per-app AWS Lambda function).
How It Works
Developer Control Plane AWS Data Plane───────── ───────────── ──────────────hq-deploy deploy ──────────► Control plane API │ ├─ Static? ──► POST /api/apps/:id/deploy │ → S3 upload + CloudFront invalidation │ └─ Next.js / Hono? ──► POST /api/deploys + /complete → per-app Lambda function │ ▼ {app}.indigo-hq.com ◄── edge routing {app}.hq.work- You run
hq-deploy deploy— the CLI detects your framework (Next.js, Hono, Astro, Vite, or plain static), builds your project, and uploads the output. - The control plane processes the deploy — creates an app record, provisions DNS, and routes the build artifact to the right infrastructure.
- The edge handles routing — inspects the
Hostheader, looks up the app, and routes to S3 (static) or to the app’s function (server-rendered).
Key Features
- Framework detection — Automatically identifies Next.js, Hono, Astro, Vite, and plain static sites.
- HQ sign-in — HQ Cognito tokens and HQ API keys (
hqk_); see Authentication. - Multi-tenant — Every app belongs to an org, and API routes check that the caller’s org owns the app before reading or changing it. See Multi-Tenant Orgs.
- Infrastructure template —
hq-deploy initwrites a CloudFormation template you can deploy in your own AWS account. - Promote and rollback (static apps) — Each static deploy is kept;
hq-deploy promoteandhq-deploy rollbackpoint an environment at an earlier healthy deployment. Next.js and Hono apps have one live production deployment that each new deploy replaces, so promote, rollback, and non-production--envare not available for them. - In-context comments — Viewers leave feedback directly on a gated deploy, anchored to a point or a region and tagged to their identity, behind the same access gate as the deploy.
Projects That Built This
The deploy platform was constructed across a series of sequential projects, each building on the last. Later work replaced several of them: Clerk auth gave way to HQ Cognito sign-in, the ECS container path for SSR is dormant, and the enterprise init and upgrade commands were not shipped in the CLI.
- Repo scaffold — TypeScript strict mode, ESLint, directory structure
- Domain hosting — Route 53, ACM cert, S3 bucket, CloudFront
- DB + API scaffold — Aurora/Neon Postgres, Drizzle ORM, Hono server
- Dual auth — Clerk JWT, API keys
- App DNS API — App registration, subdomain generation, CNAME management
- Static flow — Upload, extract, S3 sync, cache invalidation
- SSR infra — ECS cluster, ECR, ALB, Lambda@Edge routing
- SSR flow — Docker build, ECR push, ECS rolling deploy
- CLI — Framework detection, deploy command, login flow
- E2E tests — Staging infra, integration test suite
- Multi-tenant — Org model, context middleware, scoped queries
- Enterprise init — AWS credential resolution, CloudFormation deployment
- CloudFormation template — Parameterized IaC for customer accounts
- Upgrade flow — Version drift detection, ChangeSet preview