- This repo is a single Django backend, not a monorepo. Main code lives in
api/; Django project wiring lives incore/; Celery app/tasks live intasks/. core/urls.pymountsapi.urlsat the root path and exposeshealthcheck/viadjango-health-check.manage.pyswitches settings fromcore.settingstocore.productiononly whenPRODUCTION=true.
- The intended local setup is Docker Compose, not ad hoc host commands:
cp .env.sample .env && docker compose up --build. - Compose starts four services:
django,celery,postgres, andredis. - The
djangocontainer runs migrations on startup viadocker/web/start_server.sh;celerywaits for the Django health check before starting. - For one-off Django commands, run them inside the web container:
docker compose exec django python manage.py <command>.
- There is no repo-owned lint, formatter, typecheck, or CI config to rely on.
- The only checked-in test module is
api/tests.py, and it is currently just the default stub.python manage.py testexists but has little coverage value right now. - The most reliable lightweight verification is
docker compose exec django python manage.py check.
- Session generation is asynchronous. Creating/updating a
Collection, cloning a shared collection, or adding schedules enqueues Celery work fromapi/serializers.pyandapi/views.py. - If the
celeryworker is not running, those writes can succeed whileSessionrows never get backfilled. - The Celery app module is
tasks, so the worker command iscelery -A tasks worker -l info, notcelery -A core.
- Attendance math lives on
api.models.Course; session generation logic lives intasks/celery.py. - Working-day filtering is hardcoded in
api/dateutils.py, including the holiday list. Changes to session generation often require updating that file, not just model/view code.
- Exclude local artifacts from searches and reviews:
.venv/,htmlcov/, and**/__pycache__/are present in this workspace and add a lot of noise. bruno/contains the checked-in Bruno API collection for manual endpoint testing.