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 8100Frontend Setup
cd frontend
# Install dependencies
npm install
# Run development server
npm run devFrontend runs at http://localhost:3600 and proxies API requests to http://localhost:8100.
Running with Docker (Recommended)
# Start all services
docker compose up -d
# View logs
docker compose logs -f
# Rebuild after changes
docker compose build --no-cache
docker compose up -dDatabase 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=infoWebSocket Server
For real-time notifications, run Daphne:
daphne -b 0.0.0.0 -p 8100 RNSafarideskBack.asgi:applicationEnvironment Variables
Key variables for local development:
DEBUG=True
SECRET_KEY=your-dev-secret
DB_HOST=localhost
DB_PORT=5432
REDIS_HOST=localhostSee 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