# abdulla662/smarttracker architecture

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

- Interactive diagram: https://gitdiagram.com/abdulla662/smarttracker
- Repository: https://github.com/abdulla662/smarttracker

## Overview

DealTrack is a multi-tenant CRM for sales and collection teams. Its primary user workflow is to manage clients, schedule follow-ups, record payments, and review client financial activity; teams also use chat and notifications to coordinate. The backend is organized around an ASP.NET API, application services, domain entities, and EF-backed persistence. The README documents additional subscription, OCR, team, HR, payroll, reporting, and administration capabilities. Source excerpts are selective, so links between most controllers and their service implementations are not asserted.

Main entry points: [`DealTrack.API/Program.cs`](https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Program.cs) (ASP.NET API), [`DealTrack.API/Controllers/ClientsController.cs`](https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/ClientsController.cs) (Client management), [`DealTrack.API/Controllers/FollowUpsController.cs`](https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/FollowUpsController.cs) (Follow-up tracking), [`DealTrack.Infrastructure/Services/OcrService.cs`](https://github.com/abdulla662/smarttracker/blob/master/DealTrack.Infrastructure/Services/OcrService.cs) (Invoice OCR)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and access"]
  node_api["ASP.NET API<br/>[Program.cs]"]
  node_auth["Authentication<br/>[AuthController.cs]"]
end

subgraph group_crm["CRM workflow"]
  node_clients["Client management"]
  node_followups["Follow-up tracking"]
  node_payments["Client payments"]
  node_dashboard["Dashboard reporting"]
  node_activity["Activity audit"]
end

subgraph group_collaboration["Teams and communication"]
  node_chat["Real-time chat<br/>[ChatController.cs]"]
  node_notifications["Notifications"]
  node_teams["Team management<br/>[TeamsController.cs]"]
  node_invites["Invites and requests"]
end

subgraph group_operations["Business operations"]
  node_targets["Targets and feedback"]
  node_payroll["Salary and HR"]
  node_tenantadmin["Tenant administration"]
  node_superadmin["Platform administration"]
  node_subscription["Subscription payments"]
  node_ocr["Invoice OCR<br/>[OcrService.cs]"]
end

subgraph group_platform["Persistence and integrations"]
  node_appservices["Application services<br/>[Services]"]
  node_database[("Tenant-scoped database<br/>[AppDbContext.cs]")]
end

node_user(("CRM user"))
node_paymob["Paymob gateway"]
node_ocrservice["Python OCR service<br/>[main.py]"]

node_user -->|"uses"| node_api
node_api -->|"serves auth"| node_auth
node_api -->|"serves clients"| node_clients
node_api -->|"serves follow-ups"| node_followups
node_api -->|"serves payments"| node_payments
node_api -->|"serves chat"| node_chat
node_api -->|"serves notifications"| node_notifications
node_api -->|"serves teams"| node_teams
node_user -->|"views summary"| node_dashboard
node_user -->|"reviews history"| node_activity
node_user -->|"joins organization"| node_invites
node_user -->|"tracks performance"| node_targets
node_user -->|"manages payroll"| node_payroll
node_user -->|"manages tenant"| node_tenantadmin
node_user -->|"administers platform"| node_superadmin
node_user -->|"upgrades plan"| node_subscription
node_paymob -.->|"confirms payment"| node_subscription
node_user -->|"scans invoice"| node_ocr
node_ocr -.->|"extracts data"| node_ocrservice
node_api -->|"uses persistence"| node_database
node_clients -.->|"service layer"| node_appservices
node_followups -.->|"service layer"| node_appservices

click node_api "https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Program.cs"
click node_auth "https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/AuthController.cs"
click node_clients "https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/ClientsController.cs"
click node_followups "https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/FollowUpsController.cs"
click node_payments "https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/PaymentsController.cs"
click node_dashboard "https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/DashboardController.cs"
click node_activity "https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/ActivityLogsController.cs"
click node_chat "https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/ChatController.cs"
click node_notifications "https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/NotificationsController.cs"
click node_teams "https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/TeamsController.cs"
click node_invites "https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/InvitesController.cs"
click node_targets "https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/TargetController.cs"
click node_payroll "https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/SalaryController.cs"
click node_tenantadmin "https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/TenantController.cs"
click node_superadmin "https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/SuperAdminController.cs"
click node_subscription "https://github.com/abdulla662/smarttracker/blob/master/DealTrack.Infrastructure/Services/SubscriptionService.cs"
click node_ocr "https://github.com/abdulla662/smarttracker/blob/master/DealTrack.Infrastructure/Services/OcrService.cs"
click node_appservices "https://github.com/abdulla662/smarttracker/tree/master/DealTrack.Application/Services"
click node_database "https://github.com/abdulla662/smarttracker/blob/master/DealTrack.Infrastructure/Persistence/AppDbContext.cs"
click node_ocrservice "https://github.com/abdulla662/smarttracker/blob/master/ocr-service/main.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_api,node_auth,node_user toneBlue
class node_clients,node_followups,node_payments,node_dashboard,node_activity toneAmber
class node_chat,node_notifications,node_teams,node_invites toneMint
class node_targets,node_payroll,node_tenantadmin,node_superadmin,node_subscription,node_ocr toneRose
class node_appservices,node_database,node_paymob toneIndigo
class node_ocrservice toneTeal
```

## Components

### API and access

- [ASP.NET API](https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Program.cs): `DealTrack.API/Program.cs`
- [Authentication](https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/AuthController.cs): `DealTrack.API/Controllers/AuthController.cs`

### CRM workflow

- [Client management](https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/ClientsController.cs): `DealTrack.API/Controllers/ClientsController.cs`
- [Follow-up tracking](https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/FollowUpsController.cs): `DealTrack.API/Controllers/FollowUpsController.cs`
- [Client payments](https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/PaymentsController.cs): `DealTrack.API/Controllers/PaymentsController.cs`
- [Dashboard reporting](https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/DashboardController.cs): `DealTrack.API/Controllers/DashboardController.cs`
- [Activity audit](https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/ActivityLogsController.cs): `DealTrack.API/Controllers/ActivityLogsController.cs`

### Teams and communication

- [Real-time chat](https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/ChatController.cs): `DealTrack.API/Controllers/ChatController.cs`
- [Notifications](https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/NotificationsController.cs): `DealTrack.API/Controllers/NotificationsController.cs`
- [Team management](https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/TeamsController.cs): `DealTrack.API/Controllers/TeamsController.cs`
- [Invites and requests](https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/InvitesController.cs): `DealTrack.API/Controllers/InvitesController.cs`

### Business operations

- [Targets and feedback](https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/TargetController.cs): `DealTrack.API/Controllers/TargetController.cs`
- [Salary and HR](https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/SalaryController.cs): `DealTrack.API/Controllers/SalaryController.cs`
- [Tenant administration](https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/TenantController.cs): `DealTrack.API/Controllers/TenantController.cs`
- [Platform administration](https://github.com/abdulla662/smarttracker/blob/master/DealTrack.API/Controllers/SuperAdminController.cs): `DealTrack.API/Controllers/SuperAdminController.cs`
- [Subscription payments](https://github.com/abdulla662/smarttracker/blob/master/DealTrack.Infrastructure/Services/SubscriptionService.cs): `DealTrack.Infrastructure/Services/SubscriptionService.cs`
- [Invoice OCR](https://github.com/abdulla662/smarttracker/blob/master/DealTrack.Infrastructure/Services/OcrService.cs): `DealTrack.Infrastructure/Services/OcrService.cs`

### Persistence and integrations

- [Application services](https://github.com/abdulla662/smarttracker/tree/master/DealTrack.Application/Services): `DealTrack.Application/Services`
- [Tenant-scoped database](https://github.com/abdulla662/smarttracker/blob/master/DealTrack.Infrastructure/Persistence/AppDbContext.cs): `DealTrack.Infrastructure/Persistence/AppDbContext.cs`

### Other components

- **CRM user**
- **Paymob gateway**
- [Python OCR service](https://github.com/abdulla662/smarttracker/blob/master/ocr-service/main.py): `ocr-service/main.py`

## Connections

- CRM user → ASP.NET API: uses (evidence: `README.md`)
- ASP.NET API → Authentication: serves auth (evidence: `README.md`)
- ASP.NET API → Client management: serves clients (evidence: `README.md`)
- ASP.NET API → Follow-up tracking: serves follow-ups (evidence: `README.md`)
- ASP.NET API → Client payments: serves payments (evidence: `README.md`)
- ASP.NET API → Real-time chat: serves chat (evidence: `README.md`)
- ASP.NET API → Notifications: serves notifications (evidence: `README.md`)
- ASP.NET API → Team management: serves teams (evidence: `README.md`)
- CRM user → Dashboard reporting: views summary (evidence: `README.md`)
- CRM user → Activity audit: reviews history (evidence: `README.md`)
- CRM user → Invites and requests: joins organization (evidence: `README.md`)
- CRM user → Targets and feedback: tracks performance (evidence: `README.md`)
- CRM user → Salary and HR: manages payroll (evidence: `README.md`)
- CRM user → Tenant administration: manages tenant (evidence: `README.md`)
- CRM user → Platform administration: administers platform (evidence: `README.md`)
- CRM user → Subscription payments: upgrades plan (evidence: `README.md`)
- Paymob gateway → Subscription payments: confirms payment (evidence: `README.md`)
- CRM user → Invoice OCR: scans invoice (evidence: `README.md`)
- Invoice OCR → Python OCR service: extracts data (evidence: `README.md`)
- ASP.NET API → Tenant-scoped database: uses persistence (evidence: `README.md`)
- Client management → Application services: service layer
- Follow-up tracking → Application services: service layer
