Prophet-Priest-King β authoritative technical reference
Last updated: 2026-03-10| Layer | Technology |
|---|---|
| Framework | Angular 19.2 (standalone components, no NgModules) |
| Language | TypeScript 5.8, SCSS |
| Backend | Firebase 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 Export | jsPDF 4.2 |
| Markdown | marked 13 |
| State | RxJS 7.8 (no NgRx) |
| Testing | Karma/Jasmine (unit), Playwright 1.56 (E2E) |
| Containerization | Docker + Docker Compose |
| CI/CD | GitHub Actions + Workload Identity Federation |
| Runtime | Node.js 20 |
20+ lazy-loaded routes. Guards: authGuard, noAuthGuard, superAdminGuard, maintenanceGuard.
RxJS observables + Firestore as single source of truth. Services are providedIn: 'root' singletons. Firebase Remote Config drives maintenance mode.
| Service | Responsibility |
|---|---|
AuthService | Sign-in/up, user profiles, org join workflow |
SurveyService | Survey CRUD, one-survey-per-user constraint, scoring |
OrganizationService | Org CRUD, member management, invite codes |
AiReflectionService | Wraps Cloud Function for AI reflection conversations |
PdfExportService | jsPDF-based result export |
MatchingService | Leadership profile matching algorithm |
TeamComparisonService | Team survey aggregation and comparison |
AdminService | User deletion, system maintenance operations |
MaintenanceService | Remote Config polling for maintenance mode |
/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)
| Collection | Purpose |
|---|---|
surveys | User survey responses + scores |
userProfiles | Extended user data (name, role, isAdmin) |
organizations | Org metadata + settings |
organizationMemberships | User-org relationships |
organizationSurveyData | Org-level aggregates |
organizationAnalytics | Analytics events |
organizationInvites | Invite tokens |
reflectionConversations | AI 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.
/join/{code}), member roles, visibility settings| Setting | Value |
|---|---|
| Project ID | prophet-priest-king |
| Primary site | https://prophet-priest-king.web.app |
| Hosting targets | app (Angular SPA), requirements (static), docs (this site) |
| Auth | Email/password only |
| Functions runtime | Node.js 20 |
reflectOnQuestionquestionId, questionText, questionCategory, conversationHistory, userMessage, userId, turnNumberclaude-sonnet-4-6 with category-specific system prompts (prophet/priest/king)reflectionConversationsANTHROPIC_API_KEY set via gcloud run services update --update-env-vars5-job workflow on push to main (skipped if [skip ci] in commit message):
| Job | What it does |
|---|---|
version | Semantic versioning from conventional commits |
build | Node 20, npm install, npm run build:prod + requirements site |
deploy | firebase deploy --only hosting,firestore,functions via WIF auth |
release-notes | AI-generated via Claude API (grep fallback) |
create-release | Git tag + GitHub Release |
The release-notes job calls the Anthropic API directly via curl to generate human-readable release notes from the commit log:
| Property | Value |
|---|---|
| Model | claude-sonnet-4-6 |
| Input | Conventional commit log for the release (feat:, fix:, perf:, docs:, refactor:) |
| Output | Categorized markdown: Features, Bug Fixes, Performance, Documentation, Refactoring |
| Fallback | Shell grep/sed pipeline renders the same section structure if API call fails |
| Secret | ANTHROPIC_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.
Beyond CI automation, Claude Code (Anthropic's AI coding assistant) is used interactively throughout development:
feat:, fix:, docs:, etc.), ensuring consistent style and accurate version bumping.github/agents/*.agent.md files written and updated by Claude CodeClaude 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].
src/styles/_tokens.scsssrc/styles/_mixins.scsssrc/styles/_components.scssdocker-compose up # App: http://localhost:4200 # Requirements site: http://localhost:4201 # Firebase Emulator: http://localhost:4000
npm install npm start # Angular dev server (port 4200) npm run start:requirements # Express requirements server (port 4201)
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.
| File | Purpose |
|---|---|
package.json | Dependencies + npm scripts |
angular.json | Build config, lazy loading, budget limits |
firebase.json | Hosting targets, Firestore config, emulator setup |
firestore.rules | Security rules (163 lines, 8 collections) |
src/main.ts | Bootstrap with Firebase providers, Remote Config init |
src/app/app.routes.ts | Route definitions with lazy loading |
functions/src/index.ts | reflectOnQuestion Cloud Function |
.github/workflows/deploy-and-release.yml | Main CI/CD pipeline |
.github/workflows/doc-update.yml | Post-deploy doc auto-update |
Requirements/ | 12 markdown business requirement documents |
Implementation Summaries/ | Feature-by-feature changelogs |
AGENTS.md | AI assistant guide (universal) |
CLAUDE.md | Claude Code-specific workflow |