NestJS API starter with Cognito JWT validation, MongoDB persistence, OpenAPI contracts, assistant/service boundaries, and AWS storage helpers.
npm ci
cp .env.example .env
npm run start:devThe API listens on http://localhost:3000 and uses the /api prefix. Its health endpoint is GET /api/health.
npm run verifyExport the OpenAPI contract with npm run contract:export. Build the container locally with npm run docker:build.
See .env.example for the full list. Production requires AWS region, Cognito pool/client IDs, MongoDB database and URI, frontend origin, and optionally the application storage bucket. The Terraform starter injects these values into ECS and reads MONGODB_URI from Secrets Manager.
Backend CI verifies pull requests and pushes to main. Deployment is intentionally manual through the Deploy Backend workflow. Configure the repository variables emitted by the Terraform github_backend_repository_variables output before running it.
The workflow verifies the backend, publishes or reuses an immutable commit-SHA image, updates the ECS task definition, scales the service, waits for stability, and checks /api/health through CloudFront. It authenticates to AWS through GitHub OIDC and requires no static AWS keys.