Backend for building and running SleekReply chatbots from company documentation. It is a Django 5 / DRF service with Celery for async work, PostgreSQL for persistence, Weaviate as the vector store, and OpenAI-powered embeddings and responses.
- Python 3.11, Django 5, Django REST Framework, SimpleJWT
- Celery + Redis (worker queue) and Flower (monitoring)
- PostgreSQL database
- Weaviate vector database for document embeddings
- Optional AWS S3 storage (production), Whitenoise for local static files
- Google OAuth support and Pusher websocket notifications
- Sentry hooks for production observability
apps/bots: Bot, flow, step, and vector DB logic plus Celery tasksapps/accounts: Profiles, API keys, JWT + Google OAuth endpointsapps/services: Weaviate and websocket service helpersconfig: Django settings, URLs, ASGI/WSGI, Celery appdocker-compose.yml: API, Postgres, Weaviate, Redis, Celery worker, Flowerrequirements/*.txt: Base, dev, test, and production dependencies
- Docker and docker-compose
- Make sure ports 8000 (API), 5432 (Postgres), 8080/50051 (Weaviate), 5555 (Flower) are free
- Copy environment defaults:
cp env.local .env- Build and start the stack:
docker-compose build
docker-compose up- Run migrations once the API container is up:
docker-compose exec api python manage.py migrate- (Optional) Create an admin user:
docker-compose exec api python manage.py createsuperuser- Services:
- API: http://localhost:8000
- Flower dashboard: http://localhost:5555
- Weaviate: http://localhost:8080
- Run tests:
docker-compose exec api pytest- Lint/format via pre-commit:
docker-compose exec api pre-commit install
docker-compose exec api pre-commit run --all-files- Migrations:
docker-compose exec api python manage.py makemigrations
docker-compose exec api python manage.py migrate- Django shell (with django-extensions):
docker-compose exec api python manage.py shell_plusUse env.local as a template (cp env.local .env). Key entries:
ENVIRONMENT,DJANGO_SETTINGS_MODULE(e.g.,config.settings.dev)DATABASE_URL,REDIS_URLOPENAI_API_KEY- Weaviate:
WEAVIATE_LOCAL,WEAVIATE_LOCAL_URL,WEAVIATE_LOCAL_HTTP_PORT,WEAVIATE_LOCAL_GRPC_PORT - Auth:
ACCESS_TOKEN_LIFETIME,REFRESH_TOKEN_LIFETIME,ROTATE_REFRESH_TOKENS,BLACKLIST_AFTER_ROTATION - Storage:
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_STORAGE_BUCKET_NAME,AWS_DEFAULT_REGION - Google OAuth:
GOOGLE_CLIENT_ID,GOOGLE_PROJECT_ID,GOOGLE_CLIENT_SECRET - Pusher:
PUSHER_APP_ID,PUSHER_APP_KEY,PUSHER_APP_SECRET,PUSHER_APP_CLUSTER
- JWT endpoints:
/api/auth/login,/api/auth/login/refresh/,/api/auth/logout/ - Core resources are namespaced under
/api/v1/(bots, flows, vector DB, schema/vectorial operations, profiles, API keys).
- Fly.io deploy helper:
make deploy(builds, scales app and Celery, then runs migrations).
- If migrations fail on first boot, rerun
docker-compose exec api python manage.py migrate. - Ensure
OPENAI_API_KEYis set before using embedding/chat features. - Weaviate must be up before ingestion tasks; restart the worker if it cannot reach the vector store.