πŸ—οΈ Tech Stack & Architecture

Prophet-Priest-King β€” authoritative technical reference

Last updated: 2026-03-10

Tech Stack

Angular 19.2 TypeScript 5.8 Firebase 11 @angular/fire 19.2 Node.js 20 RxJS 7.8 Claude Sonnet (AI) jsPDF 4.2 Playwright 1.56 Docker GitHub Actions + WIF
LayerTechnology
FrameworkAngular 19.2 (standalone components, no NgModules)
LanguageTypeScript 5.8, SCSS
BackendFirebase 11 (Auth, Firestore, Hosting, Functions, Remote Config)
Angular/Firebase@angular/fire 19.2
AI@anthropic-ai/sdk 0.39 via Cloud Functions (claude-sonnet-4-6)
PDF ExportjsPDF 4.2
Markdownmarked 13
StateRxJS 7.8 (no NgRx)
TestingKarma/Jasmine (unit), Playwright 1.56 (E2E)
ContainerizationDocker + Docker Compose
CI/CDGitHub Actions + Workload Identity Federation
RuntimeNode.js 20

Architecture

Routing

20+ lazy-loaded routes. Guards: authGuard, noAuthGuard, superAdminGuard, maintenanceGuard.

State Management

RxJS observables + Firestore as single source of truth. Services are providedIn: 'root' singletons. Firebase Remote Config drives maintenance mode.

Key Services

ServiceResponsibility
AuthServiceSign-in/up, user profiles, org join workflow
SurveyServiceSurvey CRUD, one-survey-per-user constraint, scoring
OrganizationServiceOrg CRUD, member management, invite codes
AiReflectionServiceWraps Cloud Function for AI reflection conversations
PdfExportServicejsPDF-based result export
MatchingServiceLeadership profile matching algorithm
TeamComparisonServiceTeam survey aggregation and comparison
AdminServiceUser deletion, system maintenance operations
MaintenanceServiceRemote Config polling for maintenance mode

Project Structure

/Prophet-Priest-King/
β”œβ”€β”€ src/app/
β”‚   β”œβ”€β”€ components/        # 40+ UI components (auth, survey, org, dashboard)
β”‚   β”œβ”€β”€ services/          # 14 core services
β”‚   β”œβ”€β”€ models/            # 12 data models
β”‚   β”œβ”€β”€ guards/            # authGuard, superAdminGuard, maintenanceGuard
β”‚   β”œβ”€β”€ content/           # Leadership profiles, insights, scripture constants
β”‚   └── app.routes.ts      # 20+ lazy-loaded routes
β”œβ”€β”€ functions/src/index.ts  # AI reflection Cloud Function
β”œβ”€β”€ Requirements/           # 12 markdown business requirements
β”œβ”€β”€ .github/
β”‚   β”œβ”€β”€ workflows/          # 6 CI/CD workflows
β”‚   └── agents/             # 8 specialized AI agent instruction files
β”œβ”€β”€ firestore.rules         # Security rules (163 lines, 8 collections)
└── firebase.json           # Hosting targets (app + requirements + docs)

Firestore Collections

CollectionPurpose
surveysUser survey responses + scores
userProfilesExtended user data (name, role, isAdmin)
organizationsOrg metadata + settings
organizationMembershipsUser-org relationships
organizationSurveyDataOrg-level aggregates
organizationAnalyticsAnalytics events
organizationInvitesInvite tokens
reflectionConversationsAI chat history

Security rules: 163 lines across 8 collections. Survey access: owner always; org members if visibility β‰  private; system admins always. isSystemAdmin() reads userProfiles.isAdmin. Membership checks enforced at app layer.

Core Features

Firebase Configuration

SettingValue
Project IDprophet-priest-king
Primary sitehttps://prophet-priest-king.web.app
Hosting targetsapp (Angular SPA), requirements (static), docs (this site)
AuthEmail/password only
Functions runtimeNode.js 20

Cloud Function: reflectOnQuestion

CI/CD Pipeline

5-job workflow on push to main (skipped if [skip ci] in commit message):

version
build
deploy
release-notes
create-release
JobWhat it does
versionSemantic versioning from conventional commits
buildNode 20, npm install, npm run build:prod + requirements site
deployfirebase deploy --only hosting,firestore,functions via WIF auth
release-notesAI-generated via Claude API (grep fallback)
create-releaseGit tag + GitHub Release

AI-Powered Release Notes

The release-notes job calls the Anthropic API directly via curl to generate human-readable release notes from the commit log:

PropertyValue
Modelclaude-sonnet-4-6
InputConventional commit log for the release (feat:, fix:, perf:, docs:, refactor:)
OutputCategorized markdown: Features, Bug Fixes, Performance, Documentation, Refactoring
FallbackShell grep/sed pipeline renders the same section structure if API call fails
SecretANTHROPIC_API_KEY GitHub Actions secret β€” CI only, never deployed to runtime

The final release notes are written to release-notes.md and passed to gh release create in the create-release job.

Claude Code as Development Assistant

Beyond CI automation, Claude Code (Anthropic's AI coding assistant) is used interactively throughout development:

Claude Code is configured via CLAUDE.md (Claude Code-specific instructions) and AGENTS.md (universal AI assistant instructions shared with other tools like Copilot and Cursor).

Post-deploy: doc-update.yml triggers after every successful deploy. Calls 8 AI agents to auto-update Requirements, Help docs, SDLC diagrams, and Implementation Summaries β€” commits back with [skip ci].

Design System

Local Development

Recommended (Docker)

docker-compose up
# App:                http://localhost:4200
# Requirements site:  http://localhost:4201
# Firebase Emulator:  http://localhost:4000

Without Docker

npm install
npm start                     # Angular dev server (port 4200)
npm run start:requirements    # Express requirements server (port 4201)

E2E Tests

source set-test-creds.sh
npm run test:e2e              # Headed
npm run test:e2e:headless     # CI mode

E2E tests run against production (not emulators). Requires TEST_USER_EMAIL, TEST_USER_PASSWORD, TEST_ORG_ID.

Key File Reference

FilePurpose
package.jsonDependencies + npm scripts
angular.jsonBuild config, lazy loading, budget limits
firebase.jsonHosting targets, Firestore config, emulator setup
firestore.rulesSecurity rules (163 lines, 8 collections)
src/main.tsBootstrap with Firebase providers, Remote Config init
src/app/app.routes.tsRoute definitions with lazy loading
functions/src/index.tsreflectOnQuestion Cloud Function
.github/workflows/deploy-and-release.ymlMain CI/CD pipeline
.github/workflows/doc-update.ymlPost-deploy doc auto-update
Requirements/12 markdown business requirement documents
Implementation Summaries/Feature-by-feature changelogs
AGENTS.mdAI assistant guide (universal)
CLAUDE.mdClaude Code-specific workflow