Files
dashboard-cpsp/backend
2026-08-26 13:46:05 +07:00
..
2026-08-26 13:46:05 +07:00
2026-08-26 13:46:05 +07:00
2026-08-26 13:46:05 +07:00
2026-08-26 13:46:05 +07:00
2026-08-26 13:46:05 +07:00
2026-08-26 13:46:05 +07:00
2026-08-26 13:46:05 +07:00
2026-08-26 13:46:05 +07:00
2026-08-26 13:46:05 +07:00
2026-08-26 13:46:05 +07:00
2026-08-26 13:46:05 +07:00
2026-08-26 13:46:05 +07:00

New Dashboard Backend

Greenfield Django 5 + Wagtail 6 + DRF API aligned to ERD_dashboard.png.

Services

Compose service Role
api Gunicorn on :8000
cron Same image, runs management commands on schedule
db Postgres 16 (--profile prod)

Quick start (local, no Docker)

From dashboard-new-v2/backend:

python -m venv .venv
# Windows: .venv\Scripts\activate
# macOS/Linux: source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env   # if needed
python manage.py migrate
python manage.py seed_demo
npm run dev
# or: python manage.py runserver 0.0.0.0:8000

Seed creates user admin / admin123, then seeds the default Sukawarna demo data — Kandang 4 and Kandang 5 closed cycles (49 days each, 22 May – 9 Jul 2026) with full daily records and IoT panels. A manager login skw_manager / skw_manager123 is created too. It also prints a one-time API key.

Docker Compose

cp dashboard-new-v2/backend/.env.example dashboard-new-v2/backend/.env
# edit KARUNG_WEB_ADMIN_BASE_URL as needed
docker compose up --build

Production Postgres:

# set DB_ENGINE=django.db.backends.postgresql and DB_* in dashboard-new-v2/backend/.env
docker compose --profile prod up --build

Auth

  • Session: POST /api/v1/auth/login/ then send session cookie + X-CSRFToken on writes
  • API key: header X-API-Key: <raw> (hashed at rest)
  • Public: GET /api/v1/health/

External integrations

  • karung-web-admin → POST /api/v1/karungs/request/ (KARUNG_WEB_ADMIN_BASE_URL)

Docs