My App

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

ComponentTechnology
FrameworkDjango 5.0 + DRF
DatabasePostgreSQL + pgvector
CacheRedis
Task QueueCelery
WebSocketDjango Channels + Daphne
AuthJWT (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
└── Settings

Services

ServicePortDescription
Frontend80 (Nginx)React SPA
API9100Django REST API + WebSocket
Worker-Celery background tasks
Redis6379Cache + message broker
PostgreSQL5432Primary database

On this page