Ir al contenido

ADR-003-b — Frontend Production Stack

Accepted

The Angular frontend (CSR) is deployed on AWS Amplify. Being a SPA, Amplify must redirect all routes to index.html.

The frontend is hosted on AWS Amplify with a provider-agnostic auth interceptor. Amplify builds automatically from the main branch using npx ng build --configuration production, outputs to dist/frontend/browser, and serves all SPA routes via a rewrite rule to index.html. Environment variables are injected via the Amplify Console — none are stored in the repository. Auth is provider-agnostic; details are decided in [[adr-008-authentication|ADR-008]].

ComponentDecision
HostingAWS Amplify — automatic build from main branch
Build commandbun run build (local) / npx ng build --configuration production (Amplify)
Output directorydist/frontend/browser
SPA routingRewrite rule: `</^[^.]+$
AuthProvider-agnostic — see [[adr-008-authentication
Environment variablesAMPLIFY_* in Console, not in the repository

The MVP must respect two Amplify constraints from day one. environment.prod.ts does not hardcode URLs — it uses variables injected by Amplify. The auth interceptor is JWT provider-agnostic — it handles httpOnly cookies regardless of the issuer; auth details are decided in [[adr-008-authentication|ADR-008]].

  • The rewrite rule is mandatory; without it, any refresh on a route other than / returns 404.
  • Cognito issues standard JWT tokens — the Angular interceptor does not change between dev and prod.