Developer Quick Reference

Commands, routes, files, and common gotchas for DIAL development

Local Development

Serve the app (production config)
# From the dora-tma project root
npx ng serve --configuration production --port 4201
# App: http://localhost:4201
With Firebase Emulators
firebase emulators:start
# Emulator UI: http://localhost:4000
# Firestore:   http://localhost:8080
# Auth:        http://localhost:9099
Build for production
npm run build:prod
# Output: dist/dora-tma/browser/

Firebase Commands

Deploy (only through CI)
# Never deploy from a laptop. Merge a pull request instead:
git checkout -b fix/short-description
git commit -m "fix: ..."
git ship
# The merge to main runs deploy-and-release.yml, which tests and deploys
Build Cloud Functions
cd functions && npm install && npm run build
# Compiled output: functions/lib/
Change ANTHROPIC_API_KEY
gh secret set ANTHROPIC_API_KEY
# The next deploy writes it into functions/.env, which the functions load
# Do NOT use gcloud run services update or firebase.json secrets
Re-authenticate Firebase CLI
firebase login --reauth

npm Scripts

Script What it does
npm run build:prod Production Angular build with optimization
npm run build Development build (no optimization)
npm test Run Karma/Jasmine unit tests
npm run lint ESLint check across the project
npm install Install dependencies β€” use this in CI, not npm ci

Route Map

Route Guard Description
/auth/signin noAuthGuard Sign-in page
/auth/signup noAuthGuard Registration page
/auth/reset noAuthGuard Password reset
/invite/:token noAuthGuard Org invite link β€” auto-joins org on sign-up
/dashboard authGuard Role-aware dashboard (member or admin view)
/assessment/new authGuard Start a new assessment
/assessment/:id/capabilities authGuard Capability scoring wizard
/assessment/:id/summary authGuard Radar chart + composite score
/assessment/:id/results authGuard Per-capability AI assessments + recommendations
/history authGuard Past assessments list
/compare adminGuard Team comparison view
/org/insights adminGuard Org-level AI insights

Environment Variables

Variable Where set Description
ANTHROPIC_API_KEY GitHub Actions secret Anthropic API key. The deploy job writes it into functions/.env for the Cloud Functions, and the release-notes job uses it too
WIF_PROVIDER GitHub Actions secret Workload Identity Federation provider resource name

Key Files

functions/src/index.ts
All 4 Cloud Functions: assessCapability, generateRecommendations, chatAboutRecommendations, generateInsights
src/app/data/capability-definitions.ts
Source of truth for all 20 DORA capabilities with maturity level descriptions (Emerging/Advancing/Leading)
src/app/app.routes.ts
All route definitions with lazy loading and guard assignments
src/app/services/
Core services: AuthService, AssessmentService, OrganizationService, AiService, PdfExportService, InsightsService
firestore.rules
Firestore security rules β€” org/team/assessment access control
firebase.json
Dual hosting targets: dial-app (Angular SPA) and docs (static docs site)
angular.json
Build config, lazy loading settings, budget limits, SCSS include paths
.github/workflows/deploy-and-release.yml
5-job CI/CD pipeline: version, build, deploy, release-notes, create-release

Common Gotchas

1
Certificate checks stay on
Do not set NODE_TLS_REJECT_UNAUTHORIZED. It turns off certificate checks while the Firebase CLI sends the deploy token. CI deploys without it.
firebase deploy runs only in CI, with certificate checks on
2
Firebase Tools is 15.6.0 in every job
CI once pinned 13.15.2 because later versions failed an extensions permission check. Version 15.6.0 passes that check, so every job and the emulator tests use it.
npm install -g firebase-tools@15.6.0
3
Firestore Timestamps in Angular templates
Firebase 11 returns raw Firestore Timestamp objects, not JS Dates. Angular's | date pipe throws NG02100 on a raw Timestamp. Add a toDate() helper to the component and call it in the template.
toDate(v: any): Date { return v?.toDate ? v.toDate() : v; }
4
auth.currentUser is null on page refresh
Firebase Auth is async β€” auth.currentUser is null immediately after a page load before the auth state is restored. Pattern: check authService.currentUserProfile first, then fall back to getUserProfile(auth.currentUser.uid) inside an authStateReady() callback.
5
Use npm install, not npm ci, in CI
The npm registry intermittently returns 403/404 for older pinned transitive deps (yallist, minimatch, core-util-is). npm ci hard-fails on these; npm install is resilient. Also: lock files generated on Node 25 locally are missing Node 20 optional deps, causing npm ci to fail with "lock file out of sync".
npm install # not npm ci
6
ANTHROPIC_API_KEY β€” through functions/.env, not firebase.json
Using secrets: ["ANTHROPIC_API_KEY"] in firebase.json causes deploy-time 403 permission errors, and a key set with gcloud run services update --update-env-vars is lost on the next deploy. The deploy job writes the GitHub secret into functions/.env, which each deployed revision keeps.
7
firebase@11 required with @angular/fire@19
If firebase@10 is in package.json, you get a runtime error: "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?" Fix: upgrade to firebase@11.
npm install firebase@11

Firebase Project

Setting Value
Project ID dora-tma
App site https://dial-assessment.web.app
Docs site https://dial-docs.web.app
Auth Email/password
Functions runtime Node.js 20
Service account firebase-adminsdk-fbsvc@dora-tma.iam.gserviceaccount.com
↑