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
| Property | Value |
|---|---|
| App ID | d2x4yh9us5ctu1 |
| Region | eu-north-1 (Stockholm) |
| Framework | Next.js SSR |
| Build mode | Server-side rendering (not static export) |
Branch-to-Environment Mapping
| Branch | Stage | Domain | Purpose |
|---|---|---|---|
dev | DEVELOPMENT | dev.aiqlick.com | Development environment |
main | PRODUCTION | www.aiqlick.com | Production 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.
| Branch | SECRET_NAME Value |
|---|---|
dev | aiqlick-backend/development |
main | aiqlick-backend/production |
Key environment variables consumed by the frontend:
| Variable | Purpose |
|---|---|
NEXT_PUBLIC_API_URL | Backend GraphQL endpoint (also AI gateway HTTP + voice WS path) |
NEXT_PUBLIC_GRAPHQL_WS_URL | Backend GraphQL subscriptions (also subscribeAi for AI streaming) |
NEXT_PUBLIC_APP_URL | Frontend 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.
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.
| Workflow | Triggers | What it does |
|---|---|---|
ci.yaml — Amplify Deployment Status | Push to main/dev | Polls 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 Docs | Push to main/dev with DOCS/** paths | Checks 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.