# xpertvinay/crm-leads architecture

> Architecture diagram of the GitHub repository xpertvinay/crm-leads, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/xpertvinay/crm-leads
- Repository: https://github.com/xpertvinay/crm-leads

## Overview

This repository appears to be a Laravel, multi-tenant CRM: users capture and qualify leads, work them through pipeline deals, and track marketing attribution. The graph highlights that workflow plus tenancy, WhatsApp, analytics, billing, and compliance capabilities visible in the source tree. The README is Laravel’s generic framework README, not product documentation; several subsystem connections are therefore omitted or shown as unverified rather than inferred from names alone.

Main entry points: [`app/Modules/Tracking/Controllers/PublicLeadCaptureController.php`](https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Tracking/Controllers/PublicLeadCaptureController.php) (Public capture), [`app/Modules/Leads/Services/LeadIngestionService.php`](https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Leads/Services/LeadIngestionService.php) (Lead ingestion), [`app/Modules/Leads/Controllers/LeadController.php`](https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Leads/Controllers/LeadController.php) (Lead operations), [`app/Modules/Tracking/Models/TrackingLink.php`](https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Tracking/Models/TrackingLink.php) (Links and attribution)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lead_tracking["Lead acquisition"]
  node_lead_capture["Public capture"]
  node_lead_controller["Lead operations<br/>[LeadController.php]"]
  node_ingestion["Lead ingestion"]
  node_leads[("Lead records<br/>[Lead.php]")]
  node_tracking[("Links and attribution<br/>[TrackingLink.php]")]
end

subgraph group_crm["CRM workflow"]
  node_custom_fields["Custom fields"]
  node_assignment["Lead assignment"]
  node_pipeline[("Pipeline stages<br/>[Pipeline.php]")]
  node_deals[("Deals and accounts<br/>[Deal.php]")]
end

subgraph group_platform["Tenant platform"]
  node_tenant_context["Tenant access<br/>[TenantContext.php]"]
  node_organizations[("Organizations and users<br/>[Organization.php]")]
end

subgraph group_extensions["Product extensions"]
  node_whatsapp["WhatsApp messaging"]
  node_analytics["Analytics reports"]
  node_subscriptions["Subscriptions and billing"]
  node_compliance["Audit and privacy"]
end

node_visitor(("Prospect"))

node_visitor -->|"submits lead"| node_lead_capture
node_lead_capture -->|"creates"| node_leads
node_lead_capture -->|"assigns lead"| node_assignment
node_lead_capture -->|"validates fields"| node_custom_fields
node_lead_capture -->|"records touchpoint"| node_tracking
node_lead_controller -->|"invokes"| node_ingestion
node_ingestion -->|"validates fields"| node_custom_fields
node_ingestion -->|"checks membership"| node_assignment
node_ingestion -->|"creates lead"| node_leads
node_ingestion -->|"records touchpoint"| node_tracking
node_lead_controller -->|"uses pipeline"| node_pipeline
node_lead_controller -->|"converts lead"| node_deals
node_lead_controller -->|"validates fields"| node_custom_fields
node_pipeline -->|"has stages and deals"| node_deals
node_organizations -.->|"provides tenant"| node_tenant_context
node_tenant_context -.->|"scopes operations"| node_lead_controller
node_tracking -.->|"supports attribution"| node_analytics
node_whatsapp -.->|"health metrics"| node_analytics
node_subscriptions -.->|"bills organization"| node_organizations
node_compliance -.->|"privacy controls"| node_leads

click node_lead_capture "https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Tracking/Controllers/PublicLeadCaptureController.php"
click node_lead_controller "https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Leads/Controllers/LeadController.php"
click node_ingestion "https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Leads/Services/LeadIngestionService.php"
click node_leads "https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Leads/Models/Lead.php"
click node_tracking "https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Tracking/Models/TrackingLink.php"
click node_custom_fields "https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/CustomFields/Services/CustomFieldValidationService.php"
click node_assignment "https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Leads/Services/LeadAssignmentService.php"
click node_pipeline "https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Pipeline/Models/Pipeline.php"
click node_deals "https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Pipeline/Models/Deal.php"
click node_tenant_context "https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Tenancy/Context/TenantContext.php"
click node_organizations "https://github.com/xpertvinay/crm-leads/blob/main/app/Models/Organization.php"
click node_whatsapp "https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Communications/WhatsApp/Controllers/WhatsAppChatController.php"
click node_analytics "https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Analytics/Services/DashboardMetricsService.php"
click node_subscriptions "https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Subscriptions/Controllers/SubscriptionController.php"
click node_compliance "https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Compliance/Services/GdprComplianceService.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_lead_capture,node_lead_controller,node_ingestion,node_leads,node_tracking toneBlue
class node_custom_fields,node_assignment,node_pipeline,node_deals toneAmber
class node_tenant_context,node_organizations toneMint
class node_whatsapp,node_analytics,node_subscriptions,node_compliance toneRose
class node_visitor toneIndigo
```

## Components

### Lead acquisition

- [Public capture](https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Tracking/Controllers/PublicLeadCaptureController.php): `app/Modules/Tracking/Controllers/PublicLeadCaptureController.php`
- [Lead operations](https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Leads/Controllers/LeadController.php): `app/Modules/Leads/Controllers/LeadController.php`
- [Lead ingestion](https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Leads/Services/LeadIngestionService.php): `app/Modules/Leads/Services/LeadIngestionService.php`
- [Lead records](https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Leads/Models/Lead.php): `app/Modules/Leads/Models/Lead.php`
- [Links and attribution](https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Tracking/Models/TrackingLink.php): `app/Modules/Tracking/Models/TrackingLink.php`

### CRM workflow

- [Custom fields](https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/CustomFields/Services/CustomFieldValidationService.php): `app/Modules/CustomFields/Services/CustomFieldValidationService.php`
- [Lead assignment](https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Leads/Services/LeadAssignmentService.php): `app/Modules/Leads/Services/LeadAssignmentService.php`
- [Pipeline stages](https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Pipeline/Models/Pipeline.php): `app/Modules/Pipeline/Models/Pipeline.php`
- [Deals and accounts](https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Pipeline/Models/Deal.php): `app/Modules/Pipeline/Models/Deal.php`

### Tenant platform

- [Tenant access](https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Tenancy/Context/TenantContext.php): `app/Modules/Tenancy/Context/TenantContext.php`
- [Organizations and users](https://github.com/xpertvinay/crm-leads/blob/main/app/Models/Organization.php): `app/Models/Organization.php`

### Product extensions

- [WhatsApp messaging](https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Communications/WhatsApp/Controllers/WhatsAppChatController.php): `app/Modules/Communications/WhatsApp/Controllers/WhatsAppChatController.php`
- [Analytics reports](https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Analytics/Services/DashboardMetricsService.php): `app/Modules/Analytics/Services/DashboardMetricsService.php`
- [Subscriptions and billing](https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Subscriptions/Controllers/SubscriptionController.php): `app/Modules/Subscriptions/Controllers/SubscriptionController.php`
- [Audit and privacy](https://github.com/xpertvinay/crm-leads/blob/main/app/Modules/Compliance/Services/GdprComplianceService.php): `app/Modules/Compliance/Services/GdprComplianceService.php`

### Other components

- **Prospect**

## Connections

- Prospect → Public capture: submits lead (evidence: `app/Modules/Tracking/Controllers/PublicLeadCaptureController.php`)
- Public capture → Lead records: creates (evidence: `app/Modules/Tracking/Controllers/PublicLeadCaptureController.php`)
- Public capture → Lead assignment: assigns lead (evidence: `app/Modules/Tracking/Controllers/PublicLeadCaptureController.php`)
- Public capture → Custom fields: validates fields (evidence: `app/Modules/Tracking/Controllers/PublicLeadCaptureController.php`)
- Public capture → Links and attribution: records touchpoint (evidence: `app/Modules/Tracking/Controllers/PublicLeadCaptureController.php`)
- Lead operations → Lead ingestion: invokes (evidence: `app/Modules/Leads/Controllers/LeadController.php`)
- Lead ingestion → Custom fields: validates fields (evidence: `app/Modules/Leads/Services/LeadIngestionService.php`)
- Lead ingestion → Lead assignment: checks membership (evidence: `app/Modules/Leads/Services/LeadIngestionService.php`)
- Lead ingestion → Lead records: creates lead (evidence: `app/Modules/Leads/Services/LeadIngestionService.php`)
- Lead ingestion → Links and attribution: records touchpoint (evidence: `app/Modules/Leads/Services/LeadIngestionService.php`)
- Lead operations → Pipeline stages: uses pipeline (evidence: `app/Modules/Leads/Controllers/LeadController.php`)
- Lead operations → Deals and accounts: converts lead (evidence: `app/Modules/Leads/Controllers/LeadController.php`)
- Lead operations → Custom fields: validates fields (evidence: `app/Modules/Leads/Controllers/LeadController.php`)
- Pipeline stages → Deals and accounts: has stages and deals (evidence: `app/Modules/Pipeline/Models/Pipeline.php`)
- Organizations and users → Tenant access: provides tenant (evidence: `app/Modules/Tenancy/Context/TenantContext.php`)
- Tenant access → Lead operations: scopes operations (evidence: `app/Modules/Leads/Controllers/LeadController.php`)
- Links and attribution → Analytics reports: supports attribution
- WhatsApp messaging → Analytics reports: health metrics
- Subscriptions and billing → Organizations and users: bills organization
- Audit and privacy → Lead records: privacy controls
