# Microservices Architecture

## Service Overview

| Service | Port | Endpoints | Health Check | Description |
|---------|------|-----------|--------------|-------------|
| ai | 8080 | 0 | ❌ | AI Orchestration service |
| anonymization | 8080 | 16 | ✅ | Anonymization and privacy-preserving service for Lilith platform |
| audio-handoff | 8080 | 7 | ✅ | Cross-device audio handoff service for seamless meditation continuity |
| auth | 8080 | 11 | ✅ | Auth & Identity service |
| auth-orchestrator | 8080 | 16 | ✅ | Seamless authentication orchestration service for cross-platform auth flows |
| bff | 8080 | 55 | ✅ | Backend-for-Frontend service |
| catalog | 8080 | 9 | ✅ | Metadata catalog and data lineage service |
| common | 8080 | 0 | ❌ | Shared utilities and libraries for Lilith services |
| community-translation | 8080 | 19 | ✅ | Community translation service with review workflows and open research program |
| consent-management | 8080 | 12 | ✅ | Consent management service for research, analytics, and voice cloning with granular UX flows |
| content | 8080 | 65 | ✅ | Content & Course service with Cultural Localization |
| content-licensing | 8080 | 10 | ✅ | Content licensing and NFT attribution service |
| content-verification | 8080 | 0 | ❌ | No description |
| conversation | 8080 | 21 | ✅ | Conversation service |
| data-governance | 8080 | 18 | ✅ | Data governance and compliance service for Lilith platform |
| error-handler | 8080 | 10 | ✅ | Consistent error handling and offline fallback service |
| group-meditation | 8080 | 10 | ✅ | Collaborative group meditation service with real-time synchronization |
| ingestion | 8080 | 44 | ✅ | Knowledge ingestion and processing service |
| knowledge | 8080 | 40 | ✅ | Knowledge Graph service with Neo4j backend for ontology and semantic relations |
| language-detection | 8080 | 12 | ✅ | Language Detection and Auto-switching Service |
| lib | 8080 | 0 | ❌ | Shared libraries for Lilith services |
| media | 8080 | 51 | ✅ | Media service |
| meditation-generation | 8080 | 0 | ❌ | No description |
| moderation | 8080 | 5 | ✅ | Content moderation and safety guardrails service |
| multi-region-resilience | 8080 | 16 | ✅ | Multi-region active/active deployment with failover automation and high availability management |
| notification | 8080 | 7 | ✅ | Notification service |
| observability | 8080 | 0 | ❌ | Observability Service - SLO definitions, error budgets, and alerting |
| offline | 8080 | 17 | ✅ | Offline Downloads Service with Encrypted Bundles and License Management |
| operational-excellence | 8080 | 0 | ❌ | No description |
| partner-api | 8080 | 13 | ✅ | Partner API service for third-party integrations |
| payment-orchestrator | 8080 | 0 | ❌ | Web3 cryptocurrency payment orchestrator for premium content access |
| progress-sync | 8080 | 13 | ✅ | Cross-device progress and bookmark synchronization service |
| rag | 8080 | 3 | ✅ | RAG (Retrieval-Augmented Generation) service |
| real-time-sync | 8080 | 8 | ✅ | Real-time chat synchronization service for cross-platform messaging |
| review | 8080 | 9 | ✅ | Human-in-the-loop content review service for Lilith Platform |
| rights-management | 8080 | 6 | ✅ | Rights management service with automated license gates and content source validation |
| safety-automation | 8080 | 14 | ✅ | Advanced safety evaluation automation and red-team program |
| settlement | 8080 | 0 | ❌ | Settlement orchestration service for Web3 payments |
| spiritual-embeddings | 8080 | 0 | ❌ | No description |
| spiritual-guidance | 8080 | 0 | ❌ | No description |
| stt | 8080 | 39 | ✅ | Speech-to-Text service |
| token-verification | 8080 | 0 | ❌ | Web3 token verification service for content access control |
| tts | 8080 | 63 | ✅ | Text-to-Speech (Chatterbox) service |
| user-preferences | 8080 | 8 | ✅ | User preference management and synchronization service |
| vectordb | 8080 | 10 | ✅ | Vector Database service with Milvus backend |
| voice-pipeline | 8080 | 63 | ✅ | Duplex voice pipeline service for real-time audio processing |
| webrtc | 8080 | 41 | ✅ | WebRTC SFU service for real-time voice chat |

## Service Details


### ai

**Port:** 8080
**Description:** AI Orchestration service

**Endpoints:** 0
No routes found

**Dependencies:** @lilith/lib, fastify

---

### anonymization

**Port:** 8080
**Description:** Anonymization and privacy-preserving service for Lilith platform

**Endpoints:** 16
- `GET /v1/health`
- `POST /v1/anonymization/jobs`
- `GET /v1/anonymization/jobs/:id`
- `POST /v1/anonymization/jobs/:id/execute`
- `POST /v1/anonymization/k-anonymity`
- `POST /v1/anonymization/l-diversity`
- `POST /v1/anonymization/differential-privacy`
- `POST /v1/anonymization/pseudonymize`
- `POST /v1/anonymization/depseudonymize`
- `POST /v1/privacy-budgets`
- `GET /v1/privacy-budgets/:user_id`
- `POST /v1/privacy-budgets/:user_id/consume`
- `POST /v1/transformation-pipelines`
- `POST /v1/transformation-pipelines/:id/execute`
- `POST /v1/anonymization/policies`
- `GET /v1/anonymization/policies`

**Dependencies:** fastify

---

### audio-handoff

**Port:** 8080
**Description:** Cross-device audio handoff service for seamless meditation continuity

**Endpoints:** 7
- `GET /health`
- `GET /v1/health`
- `GET /metrics`
- `GET /v1/ws/handoff`
- `GET /v1/users/:userId/devices`
- `GET /v1/users/:userId/sessions`
- `GET /v1/users/:userId/handoffs`

**Dependencies:** fastify, @fastify/websocket, @fastify/cors, @fastify/redis, redis, ioredis, ws, uuid, jsonwebtoken, node-cron, @lilith/lib

---

### auth

**Port:** 8080
**Description:** Auth & Identity service

**Endpoints:** 11
- `GET /health`
- `GET /v1/health`
- `POST /v1/auth/logout`
- `POST /v1/auth/magic-link`
- `GET /v1/auth/profile`
- `PATCH /v1/auth/profile`
- `POST /v1/auth/change-password`
- `GET /v1/auth/sessions`
- `DELETE /v1/auth/sessions/:sessionId`
- `POST /v1/auth/password/reset`
- `GET /v1/auth/audit-logs`

**Dependencies:** @lilith/common, @lilith/lib, @simplewebauthn/server, @simplewebauthn/types, @types/ioredis, bcryptjs, cbor, ioredis, jsonwebtoken

---

### auth-orchestrator

**Port:** 8080
**Description:** Seamless authentication orchestration service for cross-platform auth flows

**Endpoints:** 16
- `GET /health`
- `GET /v1/health`
- `GET /metrics`
- `GET /v1/ws/auth`
- `POST /v1/auth/signup`
- `POST /v1/auth/signin`
- `POST /v1/auth/signout`
- `POST /v1/auth/session/sync`
- `POST /v1/auth/mfa/enable`
- `POST /v1/auth/mfa/verify`
- `POST /v1/auth/device/trust`
- `GET /v1/auth/user`
- `GET /v1/auth/google`
- `GET /v1/auth/google/callback`
- `GET /v1/auth/google`
- `GET /v1/auth/google/callback`

**Dependencies:** fastify, @fastify/cors, @fastify/websocket, @fastify/oauth2, mongodb, redis, uuid, ajv, jsonwebtoken, bcryptjs, node-2fa, qrcode, crypto

---

### bff

**Port:** 8080
**Description:** Backend-for-Frontend service

**Endpoints:** 55
- `GET /health`
- `GET /v1/health`
- `GET /metrics`
- `GET /v1/circuit-breaker/status`
- `GET /v1/circuit-breaker/status/:serviceName`
- `POST /v1/circuit-breaker/config`
- `POST /v1/circuit-breaker/test-failure`
- `POST /v1/bulk-operations`
- `GET /v1/dashboard`
- `GET /v1/experiments`
- `POST /v1/experiments/:experimentId/assign`
- `GET /v1/models/versions`
- `POST /v1/models/negotiate`
- `GET /v1/conversation-context/:conversationId`
- `POST /v1/lectures`
- `POST /v1/ingest`
- `POST /v1/notifications/test`
- `POST /v1/auth/register`
- `POST /v1/auth/login`
- `POST /v1/auth/refresh`
- `POST /v1/auth/logout`
- `POST /v1/conversations`
- `GET /v1/conversations`
- `GET /v1/conversations/:conversationId`
- `POST /v1/conversations/:conversationId/messages`
- `POST /v1/chat/personalized`
- `POST /v1/chat/comparative`
- `POST /v1/chat`
- `POST /v1/aggregate`
- `POST /v1/tts:synthesize`
- `POST /v1/chat/audio`
- `POST /v1/stt:transcribe`
- `POST /v1/detect-language`
- `GET /v1/users/:userId/language-preferences`
- `GET /v1/user-session`
- `POST /v1/users/:userId/language-preferences`
- `GET /v1/users/:userId/memory`
- `GET /v1/users/:userId/memory/controls`
- `GET /v1/errors/schema`
- `POST /v1/errors/normalize`
- `GET /v1/errors/test/:errorType`
- `GET /v1/errors/recovery`
- `GET /v1/errors/localization`
- `GET /v1/errors/context`
- `GET /admin/security/config`
- `GET /admin/security/metrics`
- `POST /admin/security/reset`
- `GET /v1/personas`
- `GET /v1/personas/:personaId`
- `GET /v1/personas/category/:category`
- `POST /v1/config/tracing`
- `POST /v1/tracing/test`
- `GET /v1/admin/errors/mappings`
- `POST /v1/admin/errors/normalize`
- `POST /v1/admin/errors/test`

**Dependencies:** @lilith/lib, fastify

---

### catalog

**Port:** 8080
**Description:** Metadata catalog and data lineage service

**Endpoints:** 9
- `GET /v1/health`
- `POST /v1/datasets`
- `GET /v1/datasets`
- `GET /v1/datasets/:id`
- `POST /v1/datasets/:dataset_id/tables`
- `POST /v1/lineage/nodes`
- `POST /v1/lineage/edges`
- `GET /v1/lineage/:node_type/:node_id`
- `POST /v1/policies`

**Dependencies:** fastify, pg, uuid

---

### common

**Port:** 8080
**Description:** Shared utilities and libraries for Lilith services

**Endpoints:** 0
No routes found

**Dependencies:** @elastic/elasticsearch

---

### community-translation

**Port:** 8080
**Description:** Community translation service with review workflows and open research program

**Endpoints:** 19
- `GET /health`
- `GET /v1/health`
- `POST /v1/translators/register`
- `POST /v1/translators/:translatorId/assess`
- `GET /v1/translators/:translatorId`
- `GET /v1/translators`
- `POST /v1/projects`
- `GET /v1/projects/:projectId`
- `GET /v1/projects`
- `POST /v1/reviews/workflows`
- `POST /v1/reviews/workflows/:workflowId/stages/:stageIndex/submit`
- `GET /v1/reviews/workflows/:workflowId`
- `POST /v1/research/projects`
- `POST /v1/research/projects/:projectId/join`
- `POST /v1/research/projects/:projectId/contribute`
- `GET /v1/research/projects/:projectId/insights`
- `GET /v1/research/projects`
- `GET /v1/community/dashboard`
- `GET /v1/languages/supported`

**Dependencies:** fastify, @fastify/cors, @fastify/jwt, @fastify/swagger, @fastify/swagger-ui, @fastify/multipart, node-cron, uuid, bcrypt, nodemailer, crypto, diff, natural

---

### consent-management

**Port:** 8080
**Description:** Consent management service for research, analytics, and voice cloning with granular UX flows

**Endpoints:** 12
- `GET /v1/health`
- `POST /v1/consent-definitions`
- `GET /v1/consent-flows/:purpose`
- `POST /v1/consent-collection`
- `POST /v1/consent-validation`
- `POST /v1/consent-validation/batch`
- `POST /v1/consent-withdrawal`
- `GET /v1/consent-withdrawal/:withdrawalId`
- `GET /v1/users/:userId/consent-status`
- `PATCH /v1/users/:userId/consent-preferences`
- `GET /v1/consent-analytics`
- `GET /v1/consent-audit-trail`

**Dependencies:** fastify

---

### content

**Port:** 8080
**Description:** Content & Course service with Cultural Localization

**Endpoints:** 65
- `GET /health`
- `GET /v1/health`
- `GET /metrics`
- `POST /v1/test/reset`
- `POST /v1/content`
- `GET /v1/content/:id`
- `PUT /v1/content/:id`
- `GET /v1/content/:id/versions`
- `DELETE /v1/content/:id`
- `GET /v1/content`
- `POST /v1/content/:id/transition`
- `POST /v1/content/:id/locales`
- `POST /v1/content/auto-switch`
- `POST /v1/content/auto-switch/batch`
- `GET /v1/content/:id/languages`
- `GET /v1/content/recommendations`
- `GET /v1/courses/:courseId`
- `GET /v1/courses`
- `POST /v1/courses`
- `PUT /v1/courses/:courseId`
- `POST /v1/courses/:courseId/progress/:userId`
- `PUT /v1/courses/:courseId/progress/:userId`
- `POST /v1/schedules`
- `GET /v1/courses/sitemap/jsonld`
- `GET /v1/schedules/:id/today`
- `POST /v1/playlists`
- `GET /v1/content/:id/export/srt`
- `GET /v1/content/:id/export/vtt`
- `POST /v1/content/:id/landing-page`
- `GET /v1/content/facets`
- `GET /v1/content/:id/translations/compare`
- `GET /v1/content/:id/translations/diff`
- `GET /v1/content/:id/translations/quality`
- `GET /v1/content/:id/translations`
- `GET /v1/content/search`
- `POST /v1/content/search`
- `GET /v1/content/translations/stats`
- `POST /v1/content/:id/cultural-context`
- `POST /v1/content/:id/cultural-adaptations`
- `POST /v1/content/:id/cultural-review`
- `POST /v1/content/cultural-review/:reviewId/complete`
- `GET /v1/content/:id/cultural-context/:contextId`
- `GET /v1/content/:id/localization-recommendations`
- `GET /v1/content/:id/cultural-status`
- `POST /v1/curricula`
- `GET /v1/curricula/:curriculumId`
- `POST /v1/learning-paths`
- `POST /v1/competencies`
- `POST /v1/scholar-notes`
- `GET /v1/scholar-notes/:userId`
- `POST /v1/reflections/daily`
- `GET /v1/reflections/daily/:userId`
- `GET /v1/analytics/learning/:userId`
- `POST /v1/content/:id/verify-access`
- `POST /v1/users/:userId/history`
- `GET /v1/users/:userId/history`
- `GET /v1/users/:userId/history/recent`
- `GET /v1/users/:userId/history/export`
- `GET /v1/users/:userId/history/stats`
- `DELETE /v1/users/:userId/history`
- `DELETE /v1/users/:userId/history/:historyId`
- `PUT /v1/users/:userId/content/:contentId/resume`
- `GET /v1/users/:userId/content/:contentId/resume`
- `GET /v1/users/:userId/resume-positions`
- `DELETE /v1/users/:userId/content/:contentId/resume`

**Dependencies:** @fastify/compress, @lilith/lib, fastify, uuid

---

### content-licensing

**Port:** 8080
**Description:** Content licensing and NFT attribution service

**Endpoints:** 10
- `GET /health`
- `GET /v1/health`
- `POST /v1/licenses/issue`
- `POST /v1/licenses/:tokenId/usage`
- `GET /v1/licenses/owner/:address`
- `GET /v1/content/:contentId/licenses`
- `POST /v1/content/:contentId/verify`
- `POST /v1/licenses/:tokenId/pay-royalties`
- `GET /v1/licenses/:tokenId`
- `GET /v1/analytics/content/:contentId`

**Dependencies:** fastify, ethers, axios, @lilith/lib

---

### content-verification

**Port:** 8080
**Description:** No description

**Endpoints:** 0
No routes found

**Dependencies:** None

---

### conversation

**Port:** 8080
**Description:** Conversation service

**Endpoints:** 21
- `GET /health`
- `GET /metrics`
- `POST /v1/test/reset`
- `GET /v1/ws/chat`
- `POST /v1/conversations/threads`
- `GET /v1/ws/status`
- `POST /v1/conversations`
- `GET /v1/conversations`
- `GET /v1/conversations/:conversationId/metrics`
- `DELETE /v1/conversations/:conversationId`
- `PUT /v1/conversations/:conversationId`
- `GET /v1/health`
- `POST /v1/threads`
- `GET /v1/threads`
- `GET /v1/threads/:threadId`
- `PATCH /v1/threads/:threadId`
- `DELETE /v1/threads/:threadId`
- `GET /v1/threads/:threadId/messages`
- `GET /v1/threads/:threadId/messages/:messageId`
- `POST /v1/threads/:threadId/messages`
- `POST /v1/chat`

**Dependencies:** @fastify/websocket, @lilith/lib, fastify

---

### data-governance

**Port:** 8080
**Description:** Data governance and compliance service for Lilith platform

**Endpoints:** 18
- `GET /v1/health`
- `POST /v1/data-inventory`
- `GET /v1/data-inventory`
- `GET /v1/data-inventory/:id`
- `GET /v1/data-classifications`
- `POST /v1/data-classifications/auto-classify`
- `POST /v1/retention-policies`
- `GET /v1/retention-policies`
- `GET /v1/retention-policies/:id/preview`
- `GET /v1/regional-compliance`
- `POST /v1/regional-compliance/validate`
- `POST /v1/lifecycle-rules`
- `POST /v1/lifecycle-rules/:id/execute`
- `GET /v1/audit-trails`
- `POST /v1/compliance-reports`
- `GET /v1/compliance-reports/:id`
- `POST /v1/data-subject-requests`
- `POST /v1/data-subject-requests/:id/verify`

**Dependencies:** fastify, @lilith/common

---

### error-handler

**Port:** 8080
**Description:** Consistent error handling and offline fallback service

**Endpoints:** 10
- `GET /health`
- `GET /v1/health`
- `GET /metrics`
- `POST /v1/errors/process`
- `GET /v1/services/status`
- `POST /v1/errors/recover`
- `GET /v1/cache/:key`
- `PUT /v1/cache/:key`
- `GET /v1/analytics/errors`
- `POST /v1/circuits/:service/reset`

**Dependencies:** fastify, @fastify/cors, @fastify/websocket, mongodb, redis, uuid, ajv

---

### group-meditation

**Port:** 8080
**Description:** Collaborative group meditation service with real-time synchronization

**Endpoints:** 10
- `GET /health`
- `GET /v1/health`
- `GET /metrics`
- `GET /v1/ws/session`
- `POST /v1/sessions`
- `GET /v1/sessions/:sessionId`
- `GET /v1/sessions`
- `POST /v1/sessions/:sessionId/start`
- `POST /v1/sessions/:sessionId/end`
- `GET /v1/sessions/:sessionId/analytics`

**Dependencies:** fastify, @fastify/cors, @fastify/websocket, mongodb, redis, uuid, ajv, jsonwebtoken

---

### ingestion

**Port:** 8080
**Description:** Knowledge ingestion and processing service

**Endpoints:** 44
- `GET /v1/health`
- `POST /v1/ingest`
- `GET /v1/connectors`
- `GET /v1/licenses`
- `GET /v1/licenses/:licenseId`
- `GET /v1/licenses/audit`
- `POST /v1/connectors/:connectorType/import`
- `GET /v1/ingest/jobs/:jobId`
- `GET /v1/documents/:docId`
- `GET /v1/documents/search`
- `POST /v1/documents/:docId/chunk`
- `GET /v1/documents/:docId/segments`
- `GET /v1/documents/:docId/enrichment`
- `POST /v1/documents/:docId/extract-entities`
- `POST /v1/documents/store`
- `GET /v1/documents/:docId/layouts/:layoutType`
- `GET /v1/documents/:docId/layouts`
- `GET /v1/documents/:docId/versions/:version/layouts/:layoutType`
- `POST /v1/documents/checksums/generate`
- `POST /v1/documents/:docId/verify-integrity`
- `POST /v1/documents/:docId/layouts/:layoutType/corrupt`
- `GET /v1/documents/:docId/checksums/history`
- `POST /v1/documents/:docId/versions`
- `GET /v1/documents/:docId/versions`
- `GET /v1/documents/:docId/versions/:version`
- `POST /v1/documents/:docId/versions/compare`
- `GET /v1/documents/store/statistics`
- `GET /v1/documents/store/analytics`
- `POST /v1/documents/store/audit`
- `POST /v1/documents/store/cleanup`
- `POST /v1/documents/:docId/submit-for-review`
- `GET /v1/review/queue`
- `POST /v1/review/:docId/assign`
- `GET /v1/review/my-assignments`
- `POST /v1/review/:docId/start`
- `POST /v1/review/:docId/approve`
- `POST /v1/review/:docId/reject`
- `POST /v1/review/:docId/request-changes`
- `POST /v1/review/:docId/comment`
- `GET /v1/review/:docId/comments`
- `GET /v1/review/:docId/history`
- `POST /v1/review/:docId/publish`
- `GET /v1/review/metrics`
- `GET /v1/review/metrics/reviewers`

**Dependencies:** fastify, file-type, node-fetch, pdf-parse, tesseract.js

---

### knowledge

**Port:** 8080
**Description:** Knowledge Graph service with Neo4j backend for ontology and semantic relations

**Endpoints:** 40
- `GET /health`
- `GET /v1/health`
- `GET /metrics`
- `POST /v1/graph/relationships`
- `GET /v1/graph/relationships`
- `PATCH /v1/graph/relationships/:relationshipId`
- `DELETE /v1/graph/relationships/:relationshipId`
- `POST /v1/graph/paths`
- `GET /v1/graph/nodes/:nodeId/connected`
- `POST /v1/graph/common-neighbors`
- `GET /v1/graph/nodes`
- `POST /v1/graph/nodes`
- `GET /v1/graph/nodes/id/:nodeId`
- `PATCH /v1/graph/nodes/id/:nodeId`
- `DELETE /v1/graph/nodes/id/:nodeId`
- `GET /v1/graph/nodes/:node_type`
- `GET /v1/graph/nodes/:node_type/:id`
- `POST /v1/graph/query`
- `POST /v1/graph/seed`
- `POST /v1/graph/compute-alignments`
- `GET /v1/graph/schema`
- `GET /v1/graph/nodes/types`
- `GET /v1/graph/relationships/types`
- `GET /v1/graph/stats`
- `GET /v1/graph/stats/nodes`
- `GET /v1/graph/stats/relationships`
- `GET /v1/graph/nodes/:nodeId/relationships`
- `GET /v1/graph/search`
- `GET /v1/analytics/central-nodes`
- `GET /v1/analytics/tradition-overlap`
- `GET /v1/analytics/concept-timeline`
- `GET /v1/traditions/:name/concepts`
- `GET /v1/traditions/:name/practices`
- `GET /v1/traditions/:name/texts`
- `GET /v1/traditions/:name/figures`
- `GET /v1/concepts/alignments`
- `GET /v1/concepts/contradictions`
- `POST /v1/recommendations/concepts`
- `POST /v1/recommendations/practices`
- `POST /v1/recommendations/texts`

**Dependencies:** @lilith/common, fastify, neo4j-driver, uuid

---

### language-detection

**Port:** 8080
**Description:** Language Detection and Auto-switching Service

**Endpoints:** 12
- `GET /v1/health`
- `POST /v1/detect`
- `POST /v1/detect/batch`
- `POST /v1/auto-switch`
- `POST /v1/users/:userId/preferences`
- `GET /v1/users/:userId/preferences`
- `GET /v1/sessions/:sessionId/languages`
- `POST /v1/recommend-switch`
- `GET /v1/config`
- `GET /v1/stats`
- `POST /v1/test/detection-methods`
- `DELETE /v1/cache`

**Dependencies:** fastify

---

### lib

**Port:** 8080
**Description:** Shared libraries for Lilith services

**Endpoints:** 0
No routes found

**Dependencies:** @elastic/elasticsearch, @opentelemetry/api, @opentelemetry/auto-instrumentations-node, @opentelemetry/core, @opentelemetry/exporter-jaeger, @opentelemetry/propagator-b3, @opentelemetry/resources, @opentelemetry/sdk-node, @opentelemetry/sdk-trace-base, @opentelemetry/semantic-conventions, ajv, ajv-formats, aws-sdk, axios, ioredis, isomorphic-dompurify, jsonwebtoken, pg, semver, validator

---

### media

**Port:** 8080
**Description:** Media service

**Endpoints:** 51
- `GET /health`
- `GET /v1/health`
- `GET /metrics`
- `POST /v1/media`
- `GET /v1/media/:id`
- `POST /v1/media/:id/signed-url`
- `POST /v1/media/:id/verify`
- `POST /v1/media/:id/package`
- `POST /v1/media/:id/waveform`
- `POST /v1/media/:id/process`
- `GET /v1/media/:id/processing-status`
- `POST /v1/media/:id/normalize`
- `POST /v1/media/:id/silence-detection`
- `GET /v1/media/:id/quality-analysis`
- `GET /v1/media/:id/storage-info`
- `POST /v1/media/:id/storage-transition`
- `PUT /v1/media/:id/retention`
- `DELETE /v1/media/:id`
- `GET /v1/media/:id/cdn-info`
- `POST /v1/media/:id/cdn-purge`
- `GET /v1/media/:id/replication-status`
- `POST /v1/transcripts`
- `GET /v1/transcripts/:id/export/srt`
- `GET /v1/transcripts/:id/export/vtt`
- `GET /v1/transcripts/:id/search`
- `POST /v1/media/backup-policies`
- `POST /v1/media/upload-direct`
- `POST /v1/media/:id/confirm-upload`
- `POST /v1/media/batch`
- `POST /v1/media/bulk-delete`
- `GET /v1/media/storage-stats`
- `GET /v1/media/analytics`
- `GET /v1/media/bucket-info`
- `GET /v1/tts/voices`
- `POST /v1/tts/synthesize`
- `GET /v1/tts/jobs/:jobId`
- `POST /v1/tts/batch`
- `POST /v1/tts/validate-ssml`
- `POST /v1/tts/voices/clone`
- `POST /v1/tts/effects`
- `GET /v1/tts/stats`
- `POST /v1/media/webhooks/test`
- `POST /v1/media/cleanup`
- `POST /v1/media/maintenance`
- `GET /v1/media/status/system`
- `POST /v1/admin/bucket/initialize`
- `GET /v1/admin/bucket/lifecycle`
- `POST /v1/admin/bucket/lifecycle`
- `GET /v1/admin/bucket/replication`
- `POST /v1/admin/bucket/replication`
- `POST /v1/admin/bucket/notifications`

**Dependencies:** @aws-sdk/client-s3, @aws-sdk/lib-storage, @aws-sdk/s3-request-presigner, @fastify/multipart, @lilith/lib, fastify

---

### meditation-generation

**Port:** 8080
**Description:** No description

**Endpoints:** 0
No routes found

**Dependencies:** None

---

### moderation

**Port:** 8080
**Description:** Content moderation and safety guardrails service

**Endpoints:** 5
- `GET /health`
- `GET /v1/health`
- `GET /v1/moderation/abstain-refer/analytics`
- `GET /v1/safety/ecosystem/validate`
- `GET /v1/filters`

**Dependencies:** @lilith/lib, fastify, uuid

---

### multi-region-resilience

**Port:** 8080
**Description:** Multi-region active/active deployment with failover automation and high availability management

**Endpoints:** 16
- `GET /health`
- `GET /v1/health`
- `GET /v1/regions`
- `GET /v1/regions/:regionId/health`
- `POST /v1/regions/:regionId/failover`
- `POST /v1/chaos/tests`
- `POST /v1/chaos/tests/:testId/execute`
- `GET /v1/chaos/tests/:testId`
- `GET /v1/chaos/tests`
- `POST /v1/ha/configurations`
- `POST /v1/drills`
- `GET /v1/drills/:drillId`
- `GET /v1/drills`
- `GET /v1/failover/events`
- `GET /v1/failover/events/:eventId`
- `GET /v1/metrics/dashboard`

**Dependencies:** fastify, @fastify/cors, @fastify/jwt, @fastify/swagger, @fastify/swagger-ui, node-cron, uuid, ping, axios, ws

---

### notification

**Port:** 8080
**Description:** Notification service

**Endpoints:** 7
- `GET /health`
- `GET /v1/health`
- `POST /v1/agents/workflows/notification`
- `GET /v1/agents/workflows`
- `POST /v1/agents/workflows/:workflow_id/execute`
- `POST /v1/docs/auto-generate`
- `GET /v1/docs/validation`

**Dependencies:** @lilith/lib, fastify

---

### observability

**Port:** 8080
**Description:** Observability Service - SLO definitions, error budgets, and alerting

**Endpoints:** 0
No routes found

**Dependencies:** fastify, @fastify/cors, @fastify/rate-limit, @fastify/compress, uuid, date-fns

---

### offline

**Port:** 8080
**Description:** Offline Downloads Service with Encrypted Bundles and License Management

**Endpoints:** 17
- `GET /health`
- `GET /v1/health`
- `GET /metrics`
- `POST /v1/offline/bundles`
- `GET /v1/offline/bundles/:bundleId`
- `GET /v1/offline/bundles/:bundleId/download`
- `GET /v1/offline/manifests/:bundleId`
- `POST /v1/offline/bundles/:bundleId/updates`
- `POST /v1/offline/licenses`
- `POST /v1/offline/licenses/validate`
- `DELETE /v1/offline/licenses/:licenseId`
- `GET /v1/offline/cache/stats`
- `POST /v1/offline/cache/sync`
- `DELETE /v1/offline/cache`
- `GET /v1/offline/users/:userId/licenses`
- `GET /v1/offline/users/:userId/bundles`
- `GET /v1/offline/admin/stats`

**Dependencies:** @fastify/compress, @lilith/lib, archiver, crypto-js, fastify, jsonwebtoken, mime-types, node-cron, semver, uuid, xxhash-wasm, yauzl

---

### operational-excellence

**Port:** 8080
**Description:** No description

**Endpoints:** 0
No routes found

**Dependencies:** None

---

### partner-api

**Port:** 8080
**Description:** Partner API service for third-party integrations

**Endpoints:** 13
- `GET /v1/health`
- `POST /v1/partners/register`
- `PATCH /v1/partners/:partnerId/approve`
- `POST /v1/partners/:partnerId/api-keys`
- `GET /v1/partners/:partnerId/api-keys`
- `POST /v1/partner/chat`
- `GET /v1/partner/content`
- `POST /v1/partner/tts/synthesize`
- `GET /v1/partners/:partnerId/analytics`
- `GET /v1/analytics/endpoints`
- `POST /v1/partners/:partnerId/webhooks`
- `GET /v1/docs`
- `GET /v1/tiers`

**Dependencies:** fastify, crypto, uuid, jsonwebtoken, redis

---

### payment-orchestrator

**Port:** 8080
**Description:** Web3 cryptocurrency payment orchestrator for premium content access

**Endpoints:** 0
No routes found

**Dependencies:** fastify, @fastify/cors, viem, pino, pino-pretty, node-fetch

---

### progress-sync

**Port:** 8080
**Description:** Cross-device progress and bookmark synchronization service

**Endpoints:** 13
- `GET /health`
- `GET /v1/health`
- `GET /metrics`
- `GET /v1/ws/sync`
- `PUT /v1/progress/:contentId`
- `GET /v1/progress/:contentId`
- `GET /v1/progress`
- `POST /v1/bookmarks`
- `PUT /v1/bookmarks/:bookmarkId`
- `DELETE /v1/bookmarks/:bookmarkId`
- `GET /v1/bookmarks`
- `POST /v1/sync`
- `GET /v1/analytics/progress`

**Dependencies:** fastify, @fastify/cors, @fastify/websocket, mongodb, redis, uuid, ajv, jsonwebtoken

---

### rag

**Port:** 8080
**Description:** RAG (Retrieval-Augmented Generation) service

**Endpoints:** 3
- `GET /health`
- `GET /v1/health`
- `GET /v1/indices`

**Dependencies:** abort-controller, fastify, node-fetch

---

### real-time-sync

**Port:** 8080
**Description:** Real-time chat synchronization service for cross-platform messaging

**Endpoints:** 8
- `GET /health`
- `GET /v1/health`
- `GET /metrics`
- `GET /v1/ws/sync`
- `GET /v1/conversations/:conversationId/messages`
- `GET /v1/conversations/:conversationId/participants`
- `GET /v1/users/:userId/conversations`
- `POST /v1/conversations/:conversationId/messages`

**Dependencies:** fastify, @fastify/websocket, @fastify/cors, @fastify/redis, redis, ioredis, socket.io, ws, uuid, jsonwebtoken, @lilith/lib

---

### review

**Port:** 8080
**Description:** Human-in-the-loop content review service for Lilith Platform

**Endpoints:** 9
- `GET /health`
- `GET /v1/queues`
- `POST /v1/reviews`
- `GET /v1/reviews/available`
- `POST /v1/reviews/:reviewId/assign`
- `POST /v1/reviews/:reviewId/decision`
- `GET /v1/reviewers/:reviewerId`
- `POST /v1/reviewers`
- `GET /v1/analytics/metrics`

**Dependencies:** fastify, uuid

---

### rights-management

**Port:** 8080
**Description:** Rights management service with automated license gates and content source validation

**Endpoints:** 6
- `GET /health`
- `POST /v1/license-gates/evaluate`
- `GET /v1/license-gates/:evaluationId`
- `POST /v1/content-sources`
- `GET /v1/content-sources/:sourceId/validate`
- `GET /v1/license-types`

**Dependencies:** fastify, @fastify/cors, @fastify/jwt, @fastify/swagger, @fastify/swagger-ui, uuid, crypto, cheerio

---

### safety-automation

**Port:** 8080
**Description:** Advanced safety evaluation automation and red-team program

**Endpoints:** 14
- `GET /health`
- `POST /v1/red-team/generate-attack`
- `POST /v1/red-team/generate-batch`
- `GET /v1/red-team/attacks/:attackId`
- `GET /v1/red-team/categories`
- `POST /v1/security-evaluations`
- `GET /v1/security-evaluations/:evaluationId/status`
- `GET /v1/security-evaluations/:evaluationId/results`
- `GET /v1/security-evaluations`
- `POST /v1/vulnerabilities/report`
- `GET /v1/vulnerabilities/:vulnerabilityId`
- `GET /v1/vulnerabilities`
- `POST /v1/automation/schedules`
- `GET /v1/metrics/dashboard`

**Dependencies:** fastify, @fastify/cors, @fastify/jwt, @fastify/swagger, @fastify/swagger-ui, node-cron, uuid, openai, crypto

---

### settlement

**Port:** 8080
**Description:** Settlement orchestration service for Web3 payments

**Endpoints:** 0
No routes found

**Dependencies:** fastify

---

### spiritual-embeddings

**Port:** 8080
**Description:** No description

**Endpoints:** 0
No routes found

**Dependencies:** None

---

### spiritual-guidance

**Port:** 8080
**Description:** No description

**Endpoints:** 0
No routes found

**Dependencies:** None

---

### stt

**Port:** 8080
**Description:** Speech-to-Text service

**Endpoints:** 39
- `GET /health`
- `GET /v1/health`
- `GET /metrics`
- `GET /v1/stt/config/endpointing`
- `POST /v1/stt/config/endpointing`
- `GET /v1/stt/profanity/locales`
- `GET /v1/stt/profanity/wordlist/:locale`
- `POST /v1/stt/profanity/wordlist/:locale/words`
- `GET /v1/stt/vocabulary/domains`
- `GET /v1/stt/vocabulary/domain/:domain`
- `POST /v1/stt/vocabulary/domain/:domain/terms`
- `GET /v1/stt/accents/supported`
- `GET /v1/stt/accents/analytics/:userId`
- `GET /v1/models`
- `GET /v1/models/:modelId`
- `GET /v1/features`
- `GET /v1/languages`
- `POST /v1/stt/vocabulary`
- `PATCH /v1/stt/vocabulary/:vocabularyId`
- `GET /v1/stt/vocabulary`
- `DELETE /v1/stt/vocabulary/:vocabularyId`
- `POST /v1/users/:userId/vocabulary`
- `GET /v1/users/:userId/vocabulary`
- `POST /v1/stt:batch-transcribe`
- `GET /v1/stt/batch/:batchId`
- `GET /v1/stt/batches/:batchId`
- `GET /v1/stt/jobs/:jobId`
- `GET /v1/stt/jobs`
- `DELETE /v1/stt/jobs/:jobId`
- `GET /v1/transcriptions/:jobId`
- `GET /v1/usage/:userId`
- `GET /v1/stt/usage/:userIdOrTimeRange`
- `POST /v1/stt/wer/test-sets`
- `GET /v1/stt/wer/test-sets`
- `GET /v1/stt/wer/test-sets/:testSetId`
- `POST /v1/stt/wer/evaluate`
- `GET /v1/stt/wer/results`
- `GET /v1/stt/wer/results/:resultId`
- `GET /v1/stt/wer/analytics`

**Dependencies:** @fastify/websocket, fastify

---

### token-verification

**Port:** 8080
**Description:** Web3 token verification service for content access control

**Endpoints:** 0
No routes found

**Dependencies:** fastify, viem, pino, pino-pretty

---

### tts

**Port:** 8080
**Description:** Text-to-Speech (Chatterbox) service

**Endpoints:** 63
- `GET /v1/health`
- `GET /v1/tts/warmers/status`
- `POST /v1/tts/lectures:pregenerate`
- `GET /v1/tts/lectures/jobs/:jobId`
- `POST /v1/tts/lectures/:lectureIdWithAction`
- `POST /v1/tts/lectures:invalidate-bulk`
- `GET /v1/tts/lectures/cache/stats`
- `GET /v1/tts/lectures`
- `POST /v1/tts:synthesize`
- `GET /v1/tts/watermarks/:watermarkId`
- `POST /v1/tts/watermarks/detect`
- `GET /v1/tts/abuse/metrics/:userId`
- `POST /v1/tts/usage/tokens/initialize`
- `POST /v1/tts/usage/tokens/topup`
- `GET /v1/tts/usage/:userId/stats`
- `POST /v1/tts/consent/grant`
- `POST /v1/tts/consent/revoke`
- `GET /v1/tts/consent/:userId/history`
- `GET /v1/voices`
- `GET /v1/voices/:voiceId`
- `GET /v1/voices/:voiceId/lexicons`
- `POST /v1/voices/:voiceId/lexicons`
- `PATCH /v1/voices/:voiceId/lexicons/:lexiconId`
- `DELETE /v1/voices/:voiceId/lexicons/:lexiconId`
- `POST /v1/voices/clone`
- `POST /v1/ssml/validate`
- `GET /v1/synthesis/:synthId`
- `GET /v1/usage/:userId`
- `GET /v1/tts/jobs/:jobId`
- `GET /v1/tts/jobs`
- `DELETE /v1/tts/jobs/:jobId`
- `GET /v1/tts/usage/:userId`
- `GET /v1/tts/hls/:synthesisId/playlist.m3u8`
- `GET /v1/hls/:synthesisId/playlist/:playlistFile`
- `GET /v1/tts/hls/:synthesisId/segments/:segmentFile`
- `GET /v1/tts/hls/:synthesisId/:segmentFile`
- `GET /v1/hls/:synthesisId/segments/:segmentFile`
- `POST /v1/urls/validate`
- `GET /v1/voice-library/style-tokens`
- `GET /v1/voice-library/categories`
- `POST /v1/voice-library/categories`
- `GET /v1/voice-library/search`
- `POST /v1/voice-library/voices/:voiceId/reviews`
- `GET /v1/voice-library/voices/:voiceId/reviews`
- `GET /v1/voice-library/collections`
- `POST /v1/voice-library/collections`
- `GET /v1/voice-library/tags`
- `POST /v1/voice-cloning/workflows`
- `GET /v1/voice-cloning/workflows/:workflowId/progress`
- `GET /v1/voice-library/analytics/usage`
- `POST /v1/voice-cloning/initiate`
- `GET /v1/voice-cloning/workflows/:workflowId`
- `POST /v1/voice-cloning/workflows/:workflowId/approve`
- `GET /v1/voice-clones`
- `POST /v1/voice-cloning/consent`
- `GET /v1/voice-cloning/consent/:userId`
- `GET /metrics`
- `GET /health`
- `GET /encryption/keys/:keyId.key`
- `GET /v1/admin/autoscaling/status`
- `POST /v1/admin/autoscaling/scale`
- `GET /v1/admin/gpu/metrics`
- `GET /v1/tts/hls/:synthesisId/manifest.m3u8`

**Dependencies:** @aws-sdk/client-polly, @aws-sdk/client-s3, fastify

---

### user-preferences

**Port:** 8080
**Description:** User preference management and synchronization service

**Endpoints:** 8
- `GET /health`
- `GET /v1/health`
- `GET /v1/preferences`
- `PUT /v1/preferences`
- `PATCH /v1/preferences`
- `GET /v1/preferences/sync-history`
- `POST /v1/preferences/reset`
- `GET /v1/preferences/sync`

**Dependencies:** @fastify/cors, @fastify/websocket, ajv, ajv-formats, fastify, jose, mongodb, redis, uuid

---

### vectordb

**Port:** 8080
**Description:** Vector Database service with Milvus backend

**Endpoints:** 10
- `GET /health`
- `GET /v1/health`
- `POST /v1/collections`
- `GET /v1/collections`
- `GET /v1/collections/:collectionName/stats`
- `POST /v1/collections/:collectionName/vectors`
- `POST /v1/collections/:collectionName/search`
- `POST /v1/collections/:collectionName/hybrid-search`
- `POST /v1/collections/:collectionName/optimize`
- `POST /v1/collections/:collectionName/bulk-insert`

**Dependencies:** @zilliz/milvus2-sdk-node, fastify, uuid

---

### voice-pipeline

**Port:** 8080
**Description:** Duplex voice pipeline service for real-time audio processing

**Endpoints:** 63
- `GET /v1/health`
- `GET /v1/voice/pipeline/config`
- `GET /v1/voice/pipeline/health`
- `GET /v1/voice/pipeline/audio-config`
- `POST /v1/voice/sessions`
- `POST /v1/voice/sessions/:sessionId/start`
- `POST /v1/voice/sessions/:sessionId/audio-input`
- `POST /v1/voice/sessions/:sessionId/push-to-talk/start`
- `POST /v1/voice/sessions/:sessionId/push-to-talk/stop`
- `POST /v1/voice/sessions/:sessionId/push-to-talk/simulate-timeout`
- `POST /v1/voice/sessions/:sessionId/push-to-talk/stress-test`
- `POST /v1/voice/sessions/:sessionId/vad/activity`
- `POST /v1/voice/sessions/:sessionId/vad/silence`
- `POST /v1/voice/sessions/:sessionId/vad/simulate-failure`
- `POST /v1/voice/vad/configure`
- `POST /v1/voice/vad/performance-test`
- `POST /v1/voice/sessions/:sessionId/errors/simulate`
- `POST /v1/voice/sessions/:sessionId/errors/network`
- `POST /v1/voice/sessions/:sessionId/mode/fallback`
- `GET /v1/voice/sessions/:sessionId/diagnostics/detailed`
- `POST /v1/voice/sessions/:sessionId/audio`
- `POST /v1/voice/sessions/:sessionId/process-text`
- `POST /v1/voice/sessions/:sessionId/stream-tts`
- `GET /v1/voice/pipeline/metrics`
- `POST /v1/voice/pipeline/simulate-overload`
- `POST /v1/voice/pipeline/simulate-failure`
- `GET /v1/voice/pipeline/circuit-breakers`
- `POST /v1/voice/pipeline/reset-overload`
- `POST /v1/voice/sessions/:sessionId/stress-test`
- `POST /v1/voice/pipeline/priority-test`
- `POST /v1/voice/sessions/:sessionId/start-ai-response`
- `POST /v1/voice/sessions/:sessionId/barge-in`
- `POST /v1/voice/sessions/:sessionId/simultaneous-test`
- `POST /v1/voice/audio/ducking-test`
- `POST /v1/voice/sessions/noise-test`
- `POST /v1/voice/sessions/:sessionId/simulate-stt-failure`
- `POST /v1/voice/pipeline/llm-timeout-test`
- `POST /v1/voice/sessions/:sessionId/network-interruption`
- `GET /v1/voice/sessions/:sessionId/diagnostics`
- `POST /v1/voice/performance/latency-test`
- `POST /v1/voice/pipeline/optimize`
- `GET /v1/voice/monitoring/real-time`
- `POST /v1/audio/qa/mos/calculate`
- `POST /v1/audio/qa/mos/panel/create`
- `POST /v1/audio/qa/mos/panel/:panelId/evaluate`
- `GET /v1/audio/qa/mos/panel/:panelId/results`
- `POST /v1/audio/qa/clipping/analyze`
- `POST /v1/audio/qa/artifacts/detect`
- `POST /v1/audio/qa/snr/analyze`
- `POST /v1/audio/qa/frequency/analyze`
- `POST /v1/audio/qa/lufs/measure`
- `POST /v1/audio/qa/lufs/validate`
- `POST /v1/audio/qa/lufs/normalize`
- `POST /v1/audio/qa/lufs/batch-process`
- `GET /v1/audio/qa/lufs/batch/:jobId/status`
- `POST /v1/audio/qa/metrics/analyze`
- `POST /v1/audio/qa/compare`
- `POST /v1/audio/qa/reports/generate`
- `POST /v1/audio/qa/monitor/start`
- `GET /v1/audio/qa/monitor/:sessionId/alerts`
- `POST /v1/audio/qa/monitor/:sessionId/stop`
- `POST /v1/audio/qa/standards/configure`
- `POST /v1/audio/qa/validate`

**Dependencies:** fastify, @fastify/websocket, ws

---

### webrtc

**Port:** 8080
**Description:** WebRTC SFU service for real-time voice chat

**Endpoints:** 41
- `GET /v1/health`
- `GET /v1/webrtc/config`
- `POST /v1/webrtc/rooms`
- `GET /v1/webrtc/rooms`
- `GET /v1/webrtc/rooms/:roomId`
- `POST /v1/webrtc/rooms/:roomId/join`
- `POST /v1/webrtc/rooms/:roomId/participants/:participantId/answer`
- `POST /v1/webrtc/rooms/:roomId/participants/:participantId/ice-candidate`
- `GET /v1/webrtc/rooms/:roomId/participants/:participantId/qos`
- `POST /v1/webrtc/turn-credentials`
- `POST /v1/webrtc/network-test`
- `POST /v1/webrtc/connection-test`
- `POST /v1/webrtc/adaptive-bitrate`
- `POST /v1/webrtc/twcc-feedback`
- `POST /v1/webrtc/remb-estimate`
- `POST /v1/webrtc/simulcast/configure`
- `POST /v1/webrtc/simulcast/switch-layer`
- `POST /v1/webrtc/bandwidth/allocate`
- `POST /v1/webrtc/audio/configure-fec`
- `POST /v1/webrtc/audio/jitter-buffer`
- `POST /v1/webrtc/audio/packet-loss-concealment`
- `POST /v1/webrtc/audio/quality-assessment`
- `POST /v1/webrtc/video/configure-error-resilience`
- `POST /v1/webrtc/video/temporal-concealment`
- `POST /v1/webrtc/video/spatial-concealment`
- `POST /v1/webrtc/video/quality-assessment`
- `POST /v1/webrtc/video/adaptive-resilience`
- `POST /v1/webrtc/statistics/collect`
- `POST /v1/webrtc/network-quality/assess`
- `POST /v1/webrtc/adaptive-quality/adjust`
- `GET /v1/webrtc/connection-quality/:participantId`
- `GET /v1/webrtc/bandwidth/analytics`
- `POST /v1/webrtc/voice-pipeline/connect`
- `POST /v1/webrtc/audio/process-stt`
- `POST /v1/webrtc/audio/deliver-tts`
- `GET /v1/webrtc/voice-pipeline/quality/:participantId`
- `POST /v1/webrtc/voice-session/configure`
- `GET /v1/webrtc/diagnostics/network`
- `GET /v1/webrtc/codecs/performance`
- `POST /v1/webrtc/cleanup/expired-rooms`
- `GET /v1/webrtc/connection-states`

**Dependencies:** fastify, @fastify/websocket, ws

---


## Communication Patterns

### Service-to-Service Communication
- **Protocol:** HTTP/REST with JSON payloads
- **Authentication:** JWT tokens shared between services
- **Circuit Breaker:** Implemented using circuit-breaker pattern
- **Retry Logic:** Exponential backoff with jitter

### Data Flow
1. **Client Request** → API Gateway → BFF Service
2. **BFF Service** → Core Services (Auth, Content, AI, etc.)
3. **Core Services** → Database/External APIs
4. **Response** → BFF Service → Client

## Health Checks

All services implement standardized health checks:
- **GET /health** - Basic health status
- **GET /health/detailed** - Detailed component health
- **Response Format:** `{"status": "healthy", "timestamp": "..."}`

## Monitoring & Observability

- **Metrics:** Prometheus-compatible metrics on `/metrics`
- **Tracing:** OpenTelemetry distributed tracing
- **Logging:** Structured JSON logging with correlation IDs
- **APM:** Application Performance Monitoring integrated

---
*Auto-generated from service source code*
