My App

Development

Local development setup

Prerequisites

  • Python 3.10+
  • Node.js 18+
  • PostgreSQL 16 with pgvector extension
  • Redis 7

Backend Setup

cd backend

# Create virtual environment
python -m venv venv
source venv/bin/activate  # Linux/Mac
# or: venv\Scripts\activate  # Windows

# Install dependencies
pip install -r requirements.txt

# Copy environment file
cp ../.env.example ../.env
# Edit .env with your local values

# Run migrations
python manage.py migrate

# Install pgvector extension
python manage.py install_pgvector

# Create superuser
python manage.py safari

# Run development server
python manage.py runserver 8100

Frontend Setup

cd frontend

# Install dependencies
npm install

# Run development server
npm run dev

Frontend runs at http://localhost:3600 and proxies API requests to http://localhost:8100.

# Start all services
docker compose up -d

# View logs
docker compose logs -f

# Rebuild after changes
docker compose build --no-cache
docker compose up -d

Database Setup

PostgreSQL with pgvector is required:

CREATE DATABASE safaridesk;
CREATE EXTENSION vector;

Or use the provided Docker Compose which includes pgvector/pgvector:pg16.

Celery Workers

For background tasks (email processing, SLA monitoring):

# Start worker
celery -A RNSafarideskBack.celery worker --loglevel=info

# Start beat scheduler
celery -A RNSafarideskBack.celery beat --loglevel=info

WebSocket Server

For real-time notifications, run Daphne:

daphne -b 0.0.0.0 -p 8100 RNSafarideskBack.asgi:application

Environment Variables

Key variables for local development:

DEBUG=True
SECRET_KEY=your-dev-secret
DB_HOST=localhost
DB_PORT=5432
REDIS_HOST=localhost

See Configuration for full reference.

Project Structure

safaridesk-os/
├── backend/
│   ├── users/          # Auth, users, business
│   ├── tenant/         # Tickets, KB, departments
│   ├── shared/         # Base models, workers
│   └── util/           # Utilities
├── frontend/
│   └── src/
│       ├── components/
│       ├── pages/
│       └── utils/
├── docker-compose.yml
└── .env.example

On this page