Architecture
System architecture overview
Overview
SafariDesk is built with Django 5.0 and Django REST Framework. The system uses a multi-tenant architecture where each business is isolated by domain.
┌─────────────────────────────────────────────────────────────────────┐
│ APPLICATION LAYER (Django) │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Users │ │ Tenant │ │ Shared │ │
│ │ Module │ │ Module │ │ Module │ │
│ │ │ │ │ │ │ │
│ │ • Auth │ │ • Tickets │ │ • Base Models│ │
│ │ • Business │ │ • SLA │ │ • Workers │ │
│ │ • Customers │ │ • Departments│ │ • Tasks │ │
│ │ • Domains │ │ • KB │ │ • Services │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────────────┘Technology Stack
| Component | Technology |
|---|---|
| Framework | Django 5.0 + DRF |
| Database | PostgreSQL + pgvector |
| Cache | Redis |
| Task Queue | Celery |
| WebSocket | Django Channels + Daphne |
| Auth | JWT (simplejwt) |
Module Structure
Users Module (users/)
- Authentication (JWT, 2FA)
- User management
- Business management
- Custom domain handling
Tenant Module (tenant/)
- Ticket management
- SLA tracking
- Departments
- Knowledge Base
- Contacts
- Notifications
Shared Module (shared/)
- Base models
- Middleware
- Celery workers
- Management commands
Data Flow
Business (Multi-tenant root)
├── Users (agents, admins)
├── Customers
├── Departments
│ └── DepartmentEmails
├── Tickets
│ ├── TicketComments
│ ├── TicketAttachments
│ └── SLA tracking
├── KBCategory
│ └── KBArticle
├── Contacts
└── SettingsServices
| Service | Port | Description |
|---|---|---|
| Frontend | 80 (Nginx) | React SPA |
| API | 9100 | Django REST API + WebSocket |
| Worker | - | Celery background tasks |
| Redis | 6379 | Cache + message broker |
| PostgreSQL | 5432 | Primary database |