BackendDeployment
Overview
Deployment architecture and environment configuration.
HyperSaaS uses Docker Compose for both local development and production deployment, with Traefik as the reverse proxy, Celery for async tasks, and S3 for file storage.
Service Architecture
Local Development
| Service | Image | Port | Purpose |
|---|---|---|---|
| Django | Custom (Python 3.12) | 8000 | API server (runserver_plus) |
| PostgreSQL | pgvector/pgvector:pg17 | 5432 | Database with vector search |
| Redis | redis:6 | 6379 | Cache + Celery broker |
| Celery Worker | Same as Django | — | Async task processing |
| Celery Beat | Same as Django | — | Scheduled tasks |
| Flower | Same as Django | 5555 | Celery monitoring |
| Mailpit | axllent/mailpit | 8025 | Email testing UI |
Production
| Service | Image | Port | Purpose |
|---|---|---|---|
| Django | Custom (Python 3.12) | 5000 | API server (Gunicorn) |
| PostgreSQL | pgvector/pgvector:pg17 | 5432 | Database with vector search |
| Redis | redis:6 | 6379 | Cache + Celery broker |
| Traefik | traefik:3.3.5 | 80, 443 | Reverse proxy + SSL |
| Celery Worker | Same as Django | — | Async task processing |
| Celery Beat | Same as Django | — | Scheduled tasks |
| Flower | Same as Django | 5555 | Celery monitoring |
| AWS CLI | amazon/aws-cli:2.25.0 | — | S3 backup operations |
Settings Architecture
config/settings/
├── base.py # Shared settings (apps, middleware, DRF, JWT, Celery)
├── local.py # DEBUG=True, Mailpit, LocMemCache, eager Celery
├── production.py # Gunicorn, S3 storage, Sentry, secure cookies
└── test.py # Fast password hashing, in-memory emailSelect the settings module via DJANGO_SETTINGS_MODULE:
# Local
DJANGO_SETTINGS_MODULE=config.settings.local
# Production
DJANGO_SETTINGS_MODULE=config.settings.production
# Tests
DJANGO_SETTINGS_MODULE=config.settings.testKey Dependencies
| Category | Package | Version |
|---|---|---|
| Framework | Django | 5.1 |
| API | djangorestframework | 3.16 |
| Auth | django-allauth, djoser, SimpleJWT | Latest |
| Database | psycopg[c], pgvector | 3.2, 0.3 |
| Tasks | celery, django-celery-beat | 5.5, 2.7 |
| AI/LLM | langchain, langgraph, pydantic-ai | Latest |
| Payments | stripe | 12.0 |
| Storage | django-storages[s3] | 1.14 |
| Monitoring | sentry-sdk | 2.25 |
| Server | gunicorn | 23.0 |
Python Version
Python 3.12 is required. Python 3.13 is not supported due to Docling/PyTorch compatibility constraints.