Skip to main content

Frontend Deployment

The Next.js frontend deploys to AWS Amplify with automatic builds triggered by Git pushes. There is no Docker container or EC2 instance -- Amplify handles build, hosting, and CDN distribution.

Amplify Configuration

PropertyValue
App IDd2x4yh9us5ctu1
Regioneu-north-1 (Stockholm)
FrameworkNext.js SSR
Build modeServer-side rendering (not static export)

Branch-to-Environment Mapping

BranchStageDomainPurpose
devDEVELOPMENTdev.aiqlick.comDevelopment environment
mainPRODUCTIONwww.aiqlick.comProduction environment

Pushes to either branch trigger an automatic build and deploy. No manual intervention is required.

Custom Domains

The root domain aiqlick.com is managed on one.com with DNS records pointing to Amplify:

  • www.aiqlick.com -- production (main branch)
  • dev.aiqlick.com -- development (dev branch)

Amplify provisions and renews SSL certificates automatically.

Environment Variables and Secrets

Each branch has a SECRET_NAME environment variable that points to an AWS Secrets Manager path. During the build phase, Amplify reads this variable and fetches the corresponding secrets for build-time injection.

BranchSECRET_NAME Value
devaiqlick-backend/development
mainaiqlick-backend/production

Key environment variables consumed by the frontend:

VariablePurpose
NEXT_PUBLIC_API_URLBackend GraphQL endpoint (also AI gateway HTTP + voice WS path)
NEXT_PUBLIC_GRAPHQL_WS_URLBackend GraphQL subscriptions (also subscribeAi for AI streaming)
NEXT_PUBLIC_APP_URLFrontend base URL (for redirects and links)

The legacy NEXT_PUBLIC_AI_GRAPHQL_URL / NEXT_PUBLIC_AI_GRAPHQL_WS_URL / NEXT_PUBLIC_AI_VOICE_WS_URL env vars were removed in the Phase 3.7 NestJS AI gateway cutover — the frontend no longer talks to background-tasks directly.

Build Process

Amplify runs the standard Next.js build:

npm install
npm run build

The build output includes both server-side and static assets. Amplify handles routing for SSR pages, API routes, and static files.

warning

There is no test suite for the frontend. The pre-commit hook runs scripts/verify-build.sh which executes npm run build and blocks the commit on failure. This is the only automated validation before deployment.

A Playwright E2E suite (e2e/ + playwright.yml) was retired in April 2026 — it had been getting cancelled on every run for months and was no longer maintained. Re-introducing it would need a real owner.

Ancillary GitHub Workflows

The frontend has two GitHub Actions workflows that run on the self-hosted runner (runs-on: [self-hosted, aiqlick-frontend]). Neither one is the actual deploy — Amplify still does that — they're observability + bridge workflows.

WorkflowTriggersWhat it does
ci.yaml — Amplify Deployment StatusPush to main/devPolls aws amplify list-jobs every 15 s, streams build logs into the Actions tab, marks the run failed if Amplify returns FAILED or CANCELLED. Useful for getting GitHub commit-status checkmarks that reflect Amplify's outcome.
sync-docs.yml — Sync Frontend DocsPush to main/dev with DOCS/** pathsChecks out the documentation repo using DOCS_DEPLOY_TOKEN, runs scripts/sync-docs.sh to mirror aiqlick-frontend/DOCS/*.md into documentation/docs/platform/frontend/guides/, and pushes a bot commit. Legacy bridge — the workspace rule is "all docs in the documentation/ repo", but historical DOCS/ content kept getting added in the frontend, and this workflow exists to surface it on the docs site. New docs should go directly to documentation/.

Deployment Workflow

Git push to dev/main
--> Amplify detects branch update
--> Fetches secrets from Secrets Manager (via SECRET_NAME)
--> Runs npm install + npm run build
--> Deploys SSR output to Amplify hosting
--> SSL certificate auto-provisioned
--> Available at dev.aiqlick.com or www.aiqlick.com

Build caching is handled by Amplify's built-in dependency cache for node_modules. Subsequent builds are faster when dependencies have not changed.