Essential commands, key files, environment setup, and common gotchas
NODE_TLS_REJECT_UNAUTHORIZED=0 prepended.
Solomon uses dual hosting targets defined in .firebaserc:
solomon-3ead2 β the main Angular application (dist/solomon-app/browser)solomon-docs β this documentation site (docs/)| Service | Purpose |
|---|---|
AuthService | Sign-in/up, user profiles, role-based access |
SessionService | CRUD for counseling sessions, couples/individual modes |
MessageService | Real-time message stream, sequence ordering |
AiService | Wraps Cloud Function chat (5-min timeout, 2-min client) |
EncryptionService | AES-256-GCM encrypt/decrypt for messages |
TtsService | ElevenLabs streaming TTS via Cloud Function |
CounselorService | Counselor profiles, annotations, assignments |
InviteService | Couples invite workflow |
SubscriptionService | Stripe subscription management |
PdfExportService | jsPDF-based session export |
| Collection | Purpose |
|---|---|
userProfiles | User identity, denomination, profile context |
counselingSessions | Session metadata, participants, status |
chatMessages | Encrypted conversation history, sequence-ordered |
sessionKeys | AES-256-GCM encryption keys per session |
sessionInvites | Couples partner invite tokens (7-day expiry) |
counselorAnnotations | Pastoral notes on AI messages, encrypted |
counselorChats | Direct messages between counselor & counselee |
counselorApplications | Counselor approval workflow |
counselorSubscriptions | Stripe subscription state |
sessionGuidedPrompts | Counselor-seeded prompts for session openers |
secrets: ["ANTHROPIC_API_KEY"] in firebase.json or onCall() β this causes deploy-time permission errors. Do NOT use gcloud run services update --update-env-vars β it creates a separate revision that gets wiped on the next Firebase deploy. Instead, write secrets to functions/.env in CI before firebase deploy.
All Firebase commands that hit Google APIs fail without SSL bypass on this machine.
NODE_TLS_REJECT_UNAUTHORIZED=0 to every Firebase CLI command.Race condition β Firebase Auth hasn't restored the session yet when components initialize.
authService.currentUserProfile first, fallback to getUserProfile(auth.currentUser.uid).@angular/fire@19 requires firebase@11. Using firebase@10 causes "Type does not match the expected instance" at runtime.
npm install firebase@11Firebase 11 returns Timestamps, not JS Dates. Angular's | date pipe throws NG02100 on raw Timestamp.
toDate(v: any): Date { return v?.toDate ? v.toDate() : v; } to component and use toDate(field) | date:... in templates.Using secrets: ["ANTHROPIC_API_KEY"] in firebase.json triggers deploy-time Secret Manager permission errors. Using gcloud run services update creates a revision that gets wiped on next deploy and fails when the old container image is garbage-collected.
functions/.env in CI before firebase deploy. Firebase 2nd-gen functions natively load .env files.SCSS token imports like @use 'styles/tokens' won't resolve without the include path configured.
angular.json has stylePreprocessorOptions: { includePaths: ["src"] }.