Django + Django REST Framework API and admin panel for HERA. Runs locally with Docker Compose (PostgreSQL + the web service). The HERA mobile app talks to this API.
- Docker Desktop (with the WSL2 backend on Windows). Verify with
docker run hello-world.
The secrets file is not in the repo (gitignored). Django imports it at startup (from .secrets import ...), so without it the server won't boot. Create web/hera/secrets.py:
GOOGLE_MAPS_KEY = ""
SENTRY_SDK_DSN = ""
STATIC_TOKEN = ""
GLOBAL_OTP_AUTH = "000000" # local OTP bypass — see "Sign in locally" below
CLOUDFLARE_TURNSTILE_SECRET = ""
CLOUDFLARE_BYPASS_TOKEN = ""
TWILIO_ACCOUNT_SID = "AC00000000000000000000000000000000" # format-valid dummy
TWILIO_AUTH_TOKEN = "00000000000000000000000000000000"
TWILIO_MESSAGING_SERVICE_SID = ""
ONESIGNAL_ID = "00000000-0000-0000-0000-000000000000"
ONESIGNAL_KEY = ""
MESSAGEBIRD_API_KEY = ""
OPENAI_API_KEY = ""
DO_BYPASS = ""Empty / dummy values let the server boot and serve the core API locally. The third-party integrations (SMS via Twilio/MessageBird, Cloudflare captcha, OneSignal push, OpenAI, Google Maps/Translate, Sentry) stay inert until you add real keys. (Twilio's client needs a non-empty AC…-prefixed SID or its constructor fails — hence the dummy above.)
web/hera/settings.py lists "hotline_ai_chatbot" in INSTALLED_APPS and web/hera/urls.py includes hotline_ai_chatbot.urls, but that app's source was never committed to the public repo. Django fails to boot with ModuleNotFoundError: No module named 'hotline_ai_chatbot'. Until it is open-sourced, remove both references:
web/hera/settings.py→ delete"hotline_ai_chatbot",fromINSTALLED_APPS.web/hera/urls.py→ delete the linepath('', include('hotline_ai_chatbot.urls')),.
docker compose up --buildBuilds the web image (Python 3.10 + dependencies) and starts PostgreSQL 13 (db) and the web service on http://127.0.0.1:8000. The first build pulls images and installs dependencies (~5 min).
docker compose run --rm web python manage.py migrateOpen http://127.0.0.1:8000/api_docs/redoc/ — the browsable API docs (HERA v2). Endpoints such as http://127.0.0.1:8000/user_profiles/ return 401 without authentication (expected).
The database connection is injected by docker-compose.yml via HERA_DB_SECRET + HERA_DJANGO_SECRET_KEY (Postgres DB hr, user us, password pwd, host db inside the compose network).
The mobile app signs in via Auth0 passwordless SMS by default, which cannot deliver codes locally. For local testing, set GLOBAL_OTP_AUTH in web/hera/secrets.py to a fixed code (e.g. "000000"); the /otp_auth/attempt_challenge/ endpoint accepts it as a universal master OTP for any valid phone number. After changing secrets.py, restart the web service:
docker compose restart webdocker compose logs -f web # live web logs
docker compose down # stop everything
docker compose up -d # start (no rebuild)
docker compose run --rm web python manage.py <command> # any Django command
docker compose run --rm web python manage.py createsuperuserdocker compose run --rm web python manage.py test
docker compose run --rm web python manage.py flush # wipe all dataThe Postgres container exposes port 5432 (DB hr, user us, password pwd):
postgresql://us:pwd@127.0.0.1:5432/hr
After migrating, create a superuser (docker compose run --rm web python manage.py createsuperuser), then visit account/login/ → enable 2FA → admin/.
- Install Docker Desktop (required for AWS Copilot builds).
- Install the AWS Copilot CLI.
- Run
copilot deploy(choose test vs production-turkey). Make sure you are on the right git branch with the correctsettings.py/secrets.pyvalues.