# pmadhuri97/exporter-crm architecture

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

- Interactive diagram: https://gitdiagram.com/pmadhuri97/exporter-crm
- Repository: https://github.com/pmadhuri97/exporter-crm

## Overview

Exporter CRM is an internal exporter sales and verification record for ANER. Staff identify or import exporters, qualify them, record background checks, open deals, collect documents, and hand deals to lending. Its principal UI is the onboarding pipeline; the backend onboarding module owns the CRM workflow, with compliance, KYB, cases, and customer modules providing related capabilities. The README describes document scanning and storage as prototype-level (pass-through scanning and local disk). Some backend connections are documented only at product level, so those links are marked unverified.

Main entry points: [`backend/app/modules/onboarding/application`](https://github.com/pmadhuri97/exporter-crm/tree/main/backend/app/modules/onboarding/application) (Onboarding workflow), [`backend/app/main.py`](https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/main.py) (Backend application), [`frontend/src/modules/onboarding/pages/PipelinePage.tsx`](https://github.com/pmadhuri97/exporter-crm/blob/main/frontend/src/modules/onboarding/pages/PipelinePage.tsx) (Pipeline screen), [`backend/app/modules/onboarding/api`](https://github.com/pmadhuri97/exporter-crm/tree/main/backend/app/modules/onboarding/api) (Onboarding API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Product entry"]
  node_pipeline["Pipeline screen<br/>[PipelinePage.tsx]"]
  node_app_routes["Frontend routes<br/>[AppRouter.tsx]"]
  node_backend_app["Backend application<br/>[main.py]"]
end

subgraph group_crm["Exporter CRM"]
  node_onboarding_api["Onboarding API"]
  node_onboarding_workflow["Onboarding workflow"]
  node_exporter_profile[("Exporter profile")]
  node_documents["Deal documents"]
  node_storage["Document storage<br/>[storage_service.py]"]
  node_deals["Deals<br/>[deal_service.py]"]
end

subgraph group_verification["Verification"]
  node_background_checks["Background checks"]
  node_screening_review["Screening review log"]
  node_compliance["Compliance rules"]
  node_kyb["Business verification"]
  node_cases["Compliance cases"]
end

subgraph group_platform["Shared platform"]
  node_auth["Authentication and roles<br/>[services.py]"]
  node_database[("Database sessions<br/>[services.py]")]
  node_audit["Audit services<br/>[services.py]"]
end

node_staff(("CRM staff"))
node_lending(("Lending team"))
node_rxil(("RXIL marketplace"))

node_staff -->|"uses"| node_pipeline
node_app_routes -->|"routes to"| node_pipeline
node_pipeline -.->|"requests data"| node_backend_app
node_backend_app -->|"mounts routes"| node_onboarding_api
node_onboarding_api -.->|"handles requests"| node_onboarding_workflow
node_onboarding_workflow -.->|"maintains profile"| node_exporter_profile
node_onboarding_workflow -->|"records checks"| node_background_checks
node_onboarding_workflow -.->|"records screening"| node_screening_review
node_onboarding_workflow -.->|"uses compliance"| node_compliance
node_onboarding_workflow -.->|"uses verification"| node_kyb
node_onboarding_workflow -.->|"opens cases"| node_cases
node_onboarding_workflow -->|"opens deals"| node_deals
node_onboarding_workflow -->|"gathers paperwork"| node_documents
node_documents -.->|"stores documents"| node_storage
node_deals -->|"hands off"| node_lending
node_staff -->|"imports exporters"| node_onboarding_workflow
node_rxil -->|"supplies exporters"| node_onboarding_workflow
node_backend_app -.->|"configures access"| node_auth
node_onboarding_workflow -.->|"persists records"| node_database
node_onboarding_workflow -.->|"records audit"| node_audit

click node_pipeline "https://github.com/pmadhuri97/exporter-crm/blob/main/frontend/src/modules/onboarding/pages/PipelinePage.tsx"
click node_app_routes "https://github.com/pmadhuri97/exporter-crm/blob/main/frontend/src/routes/AppRouter.tsx"
click node_backend_app "https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/main.py"
click node_onboarding_api "https://github.com/pmadhuri97/exporter-crm/tree/main/backend/app/modules/onboarding/api"
click node_onboarding_workflow "https://github.com/pmadhuri97/exporter-crm/tree/main/backend/app/modules/onboarding/application"
click node_exporter_profile "https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/modules/onboarding/domain/entities/exporter_profile.py"
click node_background_checks "https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/modules/onboarding/application/background_check_service.py"
click node_screening_review "https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/modules/onboarding/application/screening_review_service.py"
click node_compliance "https://github.com/pmadhuri97/exporter-crm/tree/main/backend/app/modules/compliance/application"
click node_kyb "https://github.com/pmadhuri97/exporter-crm/tree/main/backend/app/modules/kyb/infrastructure/adapters"
click node_cases "https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/modules/cases/application/case_query_service.py"
click node_documents "https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/modules/onboarding/application/document_service.py"
click node_storage "https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/modules/onboarding/application/storage_service.py"
click node_deals "https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/modules/onboarding/application/deal_service.py"
click node_auth "https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/platform/authentication/services.py"
click node_database "https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/platform/database/services.py"
click node_audit "https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/platform/audit_framework/services.py"

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_pipeline,node_app_routes,node_backend_app toneBlue
class node_onboarding_api,node_onboarding_workflow,node_exporter_profile,node_documents,node_storage,node_deals toneAmber
class node_background_checks,node_screening_review,node_compliance,node_kyb,node_cases toneMint
class node_auth,node_database,node_audit toneRose
class node_staff,node_lending,node_rxil toneIndigo
```

## Components

### Product entry

- [Pipeline screen](https://github.com/pmadhuri97/exporter-crm/blob/main/frontend/src/modules/onboarding/pages/PipelinePage.tsx): `frontend/src/modules/onboarding/pages/PipelinePage.tsx`
- [Frontend routes](https://github.com/pmadhuri97/exporter-crm/blob/main/frontend/src/routes/AppRouter.tsx): `frontend/src/routes/AppRouter.tsx`
- [Backend application](https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/main.py): `backend/app/main.py`

### Exporter CRM

- [Onboarding API](https://github.com/pmadhuri97/exporter-crm/tree/main/backend/app/modules/onboarding/api): `backend/app/modules/onboarding/api`
- [Onboarding workflow](https://github.com/pmadhuri97/exporter-crm/tree/main/backend/app/modules/onboarding/application): `backend/app/modules/onboarding/application`
- [Exporter profile](https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/modules/onboarding/domain/entities/exporter_profile.py): `backend/app/modules/onboarding/domain/entities/exporter_profile.py`
- [Deal documents](https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/modules/onboarding/application/document_service.py): `backend/app/modules/onboarding/application/document_service.py`
- [Document storage](https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/modules/onboarding/application/storage_service.py): `backend/app/modules/onboarding/application/storage_service.py`
- [Deals](https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/modules/onboarding/application/deal_service.py): `backend/app/modules/onboarding/application/deal_service.py`

### Verification

- [Background checks](https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/modules/onboarding/application/background_check_service.py): `backend/app/modules/onboarding/application/background_check_service.py`
- [Screening review log](https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/modules/onboarding/application/screening_review_service.py): `backend/app/modules/onboarding/application/screening_review_service.py`
- [Compliance rules](https://github.com/pmadhuri97/exporter-crm/tree/main/backend/app/modules/compliance/application): `backend/app/modules/compliance/application`
- [Business verification](https://github.com/pmadhuri97/exporter-crm/tree/main/backend/app/modules/kyb/infrastructure/adapters): `backend/app/modules/kyb/infrastructure/adapters`
- [Compliance cases](https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/modules/cases/application/case_query_service.py): `backend/app/modules/cases/application/case_query_service.py`

### Shared platform

- [Authentication and roles](https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/platform/authentication/services.py): `backend/app/platform/authentication/services.py`
- [Database sessions](https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/platform/database/services.py): `backend/app/platform/database/services.py`
- [Audit services](https://github.com/pmadhuri97/exporter-crm/blob/main/backend/app/platform/audit_framework/services.py): `backend/app/platform/audit_framework/services.py`

### Other components

- **CRM staff**
- **Lending team**
- **RXIL marketplace**

## Connections

- CRM staff → Pipeline screen: uses (evidence: `README.md`)
- Frontend routes → Pipeline screen: routes to (evidence: `frontend/src/routes/AppRouter.tsx`)
- Pipeline screen → Backend application: requests data
- Backend application → Onboarding API: mounts routes (evidence: `backend/app/main.py`)
- Onboarding API → Onboarding workflow: handles requests (evidence: `backend/app/modules/onboarding/api/background_check_router.py`)
- Onboarding workflow → Exporter profile: maintains profile (evidence: `backend/app/modules/onboarding/application/screening_review_service.py`)
- Onboarding workflow → Background checks: records checks (evidence: `README.md`)
- Onboarding workflow → Screening review log: records screening (evidence: `backend/app/modules/onboarding/application/screening_review_service.py`)
- Onboarding workflow → Compliance rules: uses compliance
- Onboarding workflow → Business verification: uses verification
- Onboarding workflow → Compliance cases: opens cases
- Onboarding workflow → Deals: opens deals (evidence: `README.md`)
- Onboarding workflow → Deal documents: gathers paperwork (evidence: `README.md`)
- Deal documents → Document storage: stores documents
- Deals → Lending team: hands off (evidence: `README.md`)
- CRM staff → Onboarding workflow: imports exporters (evidence: `README.md`)
- RXIL marketplace → Onboarding workflow: supplies exporters (evidence: `README.md`)
- Backend application → Authentication and roles: configures access
- Onboarding workflow → Database sessions: persists records
- Onboarding workflow → Audit services: records audit
