TorbatYar/docs/module-registry.md
Mortezakoohjani 064d67f099 Ship CRM Core Platform (phases 6.0–6.3) with docs and prod deploy.
Add the Sales CRM service through collaboration, sync architecture/registry docs, expose crm.torbatyar.ir, and include a production deploy script.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-24 20:32:00 +03:30

542 lines
18 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Module Registry
Canonical inventory of modules. Template: [module-template.md](templates/module-template.md).
Architecture boundaries: [module-boundaries.md](architecture/module-boundaries.md).
Status legend: **Active** · **Scaffolded** (code placeholder) · **Planned**
---
## core-platform
| Field | Value |
| --- | --- |
| Name | Core Platform |
| Description | Tenants, domains, plans, entitlements, registries, onboarding, audit, outbox |
| Owner | Platform |
| Status | Active |
| Dependencies | Postgres, Redis, Celery |
| Internal Dependencies | shared-lib |
| External Dependencies | Payamak (OTP), Keycloak (JWT validate), SSL provision host |
| Database Ownership | Sole owner |
| Database | `core_platform_db` |
| API Prefix | `/api/v1` |
| Permission Prefix | `core.*` / platform admin deps |
| Events | `tenant.*`, `domain.*`, `subscription.*`, `feature_access.*` |
| Event Producers | Core services/workers |
| Event Consumers | Future business services |
| Provider Dependencies | Payamak, Let's Encrypt (via ops/SSL task) |
| AI Dependencies | None |
| Documentation | [architecture/](architecture/), [reference/](reference/) |
| Current Phase | Phase 4 complete; white-label polish in progress |
| Version | 0.4.x |
| Version Compatibility | Identity ≥ phase 2 |
| Migration Version | Alembic head (incl. `0005_tenant_onboarding`) |
| Tenant Aware | Yes |
| Permission Tree | platform_admin + membership roles |
| Future Plans | Payment gateway, DNS verify, advanced permissions |
---
## identity-access
| Field | Value |
| --- | --- |
| Name | Identity & Access |
| Description | OIDC BFF, profiles, mobile OTP handoff, Keycloak sync |
| Owner | Platform |
| Status | Active |
| Dependencies | Keycloak, Core OTP API |
| Internal Dependencies | shared-lib |
| External Dependencies | Keycloak, Core |
| Database Ownership | Sole owner |
| Database | `identity_access_db` |
| API Prefix | `/api/v1/auth`, `/api/v1/users`, `/api/v1/tenants/{id}/members` |
| Permission Prefix | Identity admin roles |
| Events | `user.registered`, `tenant_member.added`, `tenant_member.removed` |
| Event Producers | Identity service |
| Event Consumers | Core (future sync) |
| Provider Dependencies | Keycloak |
| AI Dependencies | None |
| Documentation | [identity-architecture.md](architecture/identity-architecture.md), service README |
| Current Phase | Phase 2+ delivered |
| Version | 0.2.x |
| Version Compatibility | Core with JWT + mobile |
| Migration Version | Identity Alembic head |
| Tenant Aware | Partial (membership listing) |
| Permission Tree | platform_admin for user/member admin APIs |
| Future Plans | Richer sync with Core memberships |
---
## frontend
| Field | Value |
| --- | --- |
| Name | Frontend |
| Description | Next.js UI: SSO, onboarding, dashboard, tenant site |
| Owner | Platform |
| Status | Active |
| Dependencies | Core API, Identity API, Keycloak |
| Internal Dependencies | None (no backend imports) |
| External Dependencies | Browser |
| Database Ownership | None |
| Database | — |
| API Prefix | Consumes `/api/v1` |
| Permission Prefix | UI gated by roles from `/me` |
| Events | N/A (consumer only via API) |
| Event Producers | None |
| Event Consumers | None |
| Provider Dependencies | None directly |
| AI Dependencies | None |
| Documentation | [frontend/README.md](../frontend/README.md) |
| Current Phase | White-label runtime partial |
| Version | Next 15.5.x |
| Version Compatibility | Core/Identity current |
| Migration Version | N/A |
| Tenant Aware | Yes (host + context) |
| Permission Tree | Mirrors Core roles in UI |
| Future Plans | Module UIs per business phase |
---
## accounting
| Field | Value |
| --- | --- |
| Name | Accounting |
| Description | 4-level COA, double-entry, posting engine, GL, treasury, AR/AP, sales integration |
| Owner | Platform |
| Status | Active (Phases 5.15.11) |
| Dependencies | Core entitlement |
| Internal Dependencies | Posting Engine (owned here) |
| External Dependencies | Tax/e-invoice providers (future) |
| Database Ownership | Sole owner |
| Database | `accounting_db` |
| API Prefix | `/api/v1` (service on port 8002) |
| Permission Prefix | `accounting.*`, `treasury.*`, `receivable.*`, `payable.*`, `sales_accounting.*` |
| Events | `voucher.posted`, `ledger.updated`, `cash.received`, `settlement.completed`, `sales_invoice.posted` |
| Event Producers | Accounting |
| Event Consumers | Reporting, compliance (planned) |
| Provider Dependencies | Payment/tax (planned) |
| AI Dependencies | Optional assistants only (Phase 5.12) |
| Documentation | [phases/Accounting](phases/Accounting/README.md), service README |
| Current Phase | 5.11 complete; 5.12 (AI) next |
| Version | 0.5.11.0 |
| Version Compatibility | Requires Core entitlement |
| Migration Version | `0002_phases_57_511` |
| Tenant Aware | Yes (required) |
| Permission Tree | `accounting.*`, `treasury.*`, `receivable.*`, `payable.*`, `sales_accounting.*` |
| Future Plans | Phases 5.75.12 (purchase/inventory, assets, payroll, reporting, compliance, AI) |
---
## crm
| Field | Value |
| --- | --- |
| Name | CRM |
| Description | Sales CRM: leads, contacts, organizations, opportunities, pipelines, playbooks, forecasts, goals, targets, win/loss, activities, tasks, meetings, calls, timeline, comments, mentions, team collaboration, quotes, tags, addresses, custom fields, notes, attachments, audit |
| Owner | Platform |
| Status | Active (Phase 6.3 collaboration — CRM Core Platform complete) |
| Dependencies | Core entitlement; File Storage + Product Service + Notification (reference/contracts only) |
| Internal Dependencies | None — Sales CRM only |
| External Dependencies | Platform providers via contracts only (Automation, Customer360, Notification, Analytics, AI, Communication, Helpdesk, FileStorage, ProductService) |
| Database Ownership | Sole owner |
| Database | `crm_db` |
| API Prefix | `/api/v1` (service on port 8003) |
| Permission Prefix | `crm.*`, `crm.opportunities.*`, `crm.pipelines.*`, `crm.playbooks.*`, `crm.forecasts.*`, `crm.goals.*`, `crm.targets.*`, `crm.activities.*`, `crm.tasks.*`, `crm.meetings.*`, `crm.calls.*`, `crm.timeline.*`, `crm.comments.*`, `crm.mentions.*`, `crm.team.*`, `crm.leads.*`, `crm.contacts.*`, `crm.organizations.*`, `crm.notes.*`, `crm.attachments.*`, `crm.customfields.*` |
| Events | `crm.opportunity.*`, `crm.pipeline.changed`, `crm.stage.changed`, `crm.playbook.*`, `crm.forecast.updated`, `crm.activity.*`, `crm.task.completed`, `crm.meeting.finished`, `crm.call.logged`, `crm.timeline.updated`, `crm.comment.created`, `crm.mention.created`, `crm.lead.*`, `crm.contact.created`, `crm.organization.created`, `crm.note.created`, `crm.attachment.added`, `crm.quote.created` |
| Event Producers | CRM |
| Event Consumers | Future platforms (not consumed in 6.3) |
| Provider Dependencies | Contracts only — no implementations |
| AI Dependencies | Optional via `AIProvider` contract only |
| Documentation | [crm-phase-6-0.md](crm-phase-6-0.md), [crm-phase-6-1.md](crm-phase-6-1.md), [crm-phase-6-2.md](crm-phase-6-2.md), [crm-phase-6-3.md](crm-phase-6-3.md), [phases/CRM](phases/CRM/README.md), service README |
| Current Phase | 6.3 complete (CRM Core Platform) |
| Version | 0.6.3.0 |
| Version Compatibility | Requires Core entitlement |
| Migration Version | `0004_phase_63_collaboration` |
| Tenant Aware | Yes (required) |
| Permission Tree | `crm.*` |
| Future Plans | Explicitly scoped Sales CRM slices only; no platform ownership |
---
## restaurant
| Field | Value |
| --- | --- |
| Name | Restaurant / Cafe |
| Description | Digital menu, tables, orders, kitchen, loyalty |
| Owner | TBD |
| Status | Scaffolded |
| Dependencies | Core entitlement, white-label host |
| Internal Dependencies | Optional accounting postings via events |
| External Dependencies | Payment provider (future) |
| Database Ownership | Sole owner |
| Database | `restaurant_db` |
| API Prefix | `/api/v1` |
| Permission Prefix | `restaurant.*` |
| Events | `order.*` (planned) |
| Event Producers | Restaurant |
| Event Consumers | Accounting, notification |
| Provider Dependencies | Payment (planned) |
| AI Dependencies | Optional |
| Documentation | [phases/Restaurant](phases/Restaurant/README.md) |
| Current Phase | Candidate first business module after white-label |
| Version | 0.0.0 |
| Version Compatibility | Core + public tenant site |
| Migration Version | None |
| Tenant Aware | Yes |
| Permission Tree | `restaurant.*` |
| Future Plans | Guest ordering on tenant domain |
---
## ecommerce
| Field | Value |
| --- | --- |
| Name | Ecommerce |
| Description | Store builder, catalog, cart, orders, shipments |
| Owner | TBD |
| Status | Scaffolded |
| Dependencies | Core, file_storage (future) |
| Internal Dependencies | — |
| External Dependencies | Payment, shipping (future) |
| Database Ownership | Sole owner |
| Database | `ecommerce_db` |
| API Prefix | `/api/v1` |
| Permission Prefix | `ecommerce.*` |
| Events | `order.*`, `product.*` (planned) |
| Event Producers | Ecommerce |
| Event Consumers | Accounting, notification |
| Provider Dependencies | Payment, S3 |
| AI Dependencies | Optional |
| Documentation | service README |
| Current Phase | Not started |
| Version | 0.0.0 |
| Version Compatibility | Core |
| Migration Version | None |
| Tenant Aware | Yes |
| Permission Tree | `ecommerce.*` |
| Future Plans | Marketplace handoff |
---
## marketplace
| Field | Value |
| --- | --- |
| Name | Marketplace |
| Description | Multi-vendor market capabilities |
| Owner | TBD |
| Status | Planned |
| Dependencies | ecommerce, identity, accounting |
| Internal Dependencies | ecommerce |
| External Dependencies | Payment |
| Database Ownership | TBD (likely dedicated DB) |
| Database | TBD |
| API Prefix | TBD |
| Permission Prefix | `marketplace.*` |
| Events | TBD |
| Event Producers | TBD |
| Event Consumers | TBD |
| Provider Dependencies | Payment |
| AI Dependencies | Optional |
| Documentation | [phases/Marketplace](phases/Marketplace/README.md) |
| Current Phase | Future |
| Version | 0.0.0 |
| Version Compatibility | TBD |
| Migration Version | None |
| Tenant Aware | Yes |
| Permission Tree | `marketplace.*` |
| Future Plans | After ecommerce foundation |
---
## website_builder
| Field | Value |
| --- | --- |
| Name | Website Builder |
| Description | Sites, pages, blocks, forms, menus, media |
| Owner | TBD |
| Status | Scaffolded |
| Dependencies | file_storage |
| Internal Dependencies | — |
| External Dependencies | S3 |
| Database Ownership | Sole owner |
| Database | `website_builder_db` |
| API Prefix | `/api/v1` |
| Permission Prefix | `website_builder.*` |
| Events | TBD |
| Event Producers | Website Builder |
| Event Consumers | — |
| Provider Dependencies | S3 |
| AI Dependencies | Optional copy assist |
| Documentation | service README |
| Current Phase | Not started |
| Version | 0.0.0 |
| Version Compatibility | Core |
| Migration Version | None |
| Tenant Aware | Yes |
| Permission Tree | `website_builder.*` |
| Future Plans | Tie into white-label public sites |
---
## live_chat
| Field | Value |
| --- | --- |
| Name | Live Chat |
| Description | Embeddable widget, conversations, agent routing |
| Owner | TBD |
| Status | Scaffolded |
| Dependencies | Core, optional CRM/AI |
| Internal Dependencies | — |
| External Dependencies | — |
| Database Ownership | Sole owner |
| Database | `live_chat_db` |
| API Prefix | `/api/v1` |
| Permission Prefix | `live_chat.*` |
| Events | `conversation.*` (planned) |
| Event Producers | Live Chat |
| Event Consumers | CRM, AI |
| Provider Dependencies | — |
| AI Dependencies | Optional handoff |
| Documentation | service README |
| Current Phase | Not started |
| Version | 0.0.0 |
| Version Compatibility | Core |
| Migration Version | None |
| Tenant Aware | Yes |
| Permission Tree | `live_chat.*` |
| Future Plans | Widget on tenant sites |
---
## ai_assistant
| Field | Value |
| --- | --- |
| Name | AI Assistant |
| Description | Intelligent chat, KB, handoff to humans |
| Owner | TBD |
| Status | Scaffolded |
| Dependencies | Core entitlement, model provider |
| Internal Dependencies | Independent — must not own money/compliance |
| External Dependencies | AI model provider |
| Database Ownership | Sole owner |
| Database | `ai_assistant_db` |
| API Prefix | `/api/v1` |
| Permission Prefix | `ai_assistant.*` |
| Events | `assistant.*` (planned) |
| Event Producers | AI Assistant |
| Event Consumers | Live Chat, CRM |
| Provider Dependencies | AI model provider |
| AI Dependencies | Self |
| Documentation | [ai-architecture.md](architecture/ai-architecture.md), [phases/AI](phases/AI/README.md) |
| Current Phase | Not started |
| Version | 0.0.0 |
| Version Compatibility | Core |
| Migration Version | None |
| Tenant Aware | Yes |
| Permission Tree | `ai_assistant.*` |
| Future Plans | Provider-agnostic adapters |
---
## smart_messenger
| Field | Value |
| --- | --- |
| Name | Smart Messenger |
| Description | Social channels, unified inbox, automations |
| Owner | TBD |
| Status | Scaffolded |
| Dependencies | Core |
| Internal Dependencies | Optional CRM |
| External Dependencies | Social network APIs |
| Database Ownership | Sole owner |
| Database | `smart_messenger_db` |
| API Prefix | `/api/v1` |
| Permission Prefix | `smart_messenger.*` |
| Events | TBD |
| Event Producers | Smart Messenger |
| Event Consumers | CRM |
| Provider Dependencies | Channel providers |
| AI Dependencies | Optional |
| Documentation | service README |
| Current Phase | Not started |
| Version | 0.0.0 |
| Version Compatibility | Core |
| Migration Version | None |
| Tenant Aware | Yes |
| Permission Tree | `smart_messenger.*` |
| Future Plans | Channel provider registry entries |
---
## sms_panel
| Field | Value |
| --- | --- |
| Name | SMS Panel |
| Description | Campaign SMS, templates, queues, multi-provider |
| Owner | TBD |
| Status | Scaffolded |
| Dependencies | Core |
| Internal Dependencies | — |
| External Dependencies | SMS providers |
| Database Ownership | Sole owner |
| Database | `sms_panel_db` |
| API Prefix | `/api/v1` |
| Permission Prefix | `sms_panel.*` |
| Events | TBD |
| Event Producers | SMS Panel |
| Event Consumers | — |
| Provider Dependencies | Payamak and others |
| AI Dependencies | None |
| Documentation | service README |
| Current Phase | Not started |
| Version | 0.0.0 |
| Version Compatibility | Core |
| Migration Version | None |
| Tenant Aware | Yes |
| Permission Tree | `sms_panel.*` |
| Future Plans | Separate from Core OTP path |
---
## link_shortener
| Field | Value |
| --- | --- |
| Name | Link Shortener |
| Description | Short links, custom domains, click analytics |
| Owner | TBD |
| Status | Scaffolded |
| Dependencies | Core |
| Internal Dependencies | — |
| External Dependencies | — |
| Database Ownership | Sole owner |
| Database | `link_shortener_db` |
| API Prefix | `/api/v1` |
| Permission Prefix | `link_shortener.*` |
| Events | TBD |
| Event Producers | Link Shortener |
| Event Consumers | Campaign analytics |
| Provider Dependencies | — |
| AI Dependencies | None |
| Documentation | service README |
| Current Phase | Not started |
| Version | 0.0.0 |
| Version Compatibility | Core |
| Migration Version | None |
| Tenant Aware | Yes |
| Permission Tree | `link_shortener.*` |
| Future Plans | Custom domain SSL via edge |
---
## notification
| Field | Value |
| --- | --- |
| Name | Notification |
| Description | Email, SMS, push, webhook, in-app fanout |
| Owner | TBD |
| Status | Scaffolded |
| Dependencies | Core |
| Internal Dependencies | — |
| External Dependencies | Email/SMS/push providers |
| Database Ownership | Sole owner |
| Database | `notification_db` |
| API Prefix | `/api/v1` |
| Permission Prefix | `notification.*` |
| Events | Consumes many domain events |
| Event Producers | Notification (delivery logs) |
| Event Consumers | Notification |
| Provider Dependencies | SMS/email providers |
| AI Dependencies | None |
| Documentation | service README |
| Current Phase | Not started |
| Version | 0.0.0 |
| Version Compatibility | Core |
| Migration Version | None |
| Tenant Aware | Yes |
| Permission Tree | `notification.*` |
| Future Plans | Central delivery for all modules |
---
## file_storage
| Field | Value |
| --- | --- |
| Name | File Storage |
| Description | Tenant-aware uploads, assets, S3 gateway |
| Owner | TBD |
| Status | Scaffolded |
| Dependencies | S3-compatible provider |
| Internal Dependencies | — |
| External Dependencies | S3 |
| Database Ownership | Sole owner |
| Database | `file_storage_db` |
| API Prefix | `/api/v1` |
| Permission Prefix | `file_storage.*` |
| Events | TBD |
| Event Producers | File Storage |
| Event Consumers | website_builder, ecommerce |
| Provider Dependencies | S3-compatible |
| AI Dependencies | None |
| Documentation | service README |
| Current Phase | Not started |
| Version | 0.0.0 |
| Version Compatibility | Core |
| Migration Version | None |
| Tenant Aware | Yes |
| Permission Tree | `file_storage.*` |
| Future Plans | Signed URL pattern |
---
## automation (platform capability)
| Field | Value |
| --- | --- |
| Name | Automation |
| Description | Cross-module workflow automation |
| Owner | TBD |
| Status | Planned |
| Dependencies | Event bus maturity |
| Internal Dependencies | Multiple modules |
| External Dependencies | — |
| Database Ownership | TBD |
| Database | TBD |
| API Prefix | TBD |
| Permission Prefix | `automation.*` |
| Events | Trigger/action events |
| Event Producers | Automation engine |
| Event Consumers | Modules |
| Provider Dependencies | — |
| AI Dependencies | Optional |
| Documentation | [phases/Automation](phases/Automation/README.md) |
| Current Phase | Future |
| Version | 0.0.0 |
| Version Compatibility | Requires real message bus |
| Migration Version | None |
| Tenant Aware | Yes |
| Permission Tree | `automation.*` |
| Future Plans | After event bus |
---
## Related Documents
- [Provider Registry](provider-registry.md)
- [Roadmap](roadmap.md)
- [Architecture Overview](architecture/architecture.md)