Live DAOPS suppression & groundcheck edge API route (/api/daops) #62

Closed
opened 2026-10-14 22:28:40 +00:00 by yuris · 0 comments
Owner

What to build

Build the Next.js edge route /api/daops to sync active firefighting operations and field groundcheck missions from KLHK SiPongi+ endpoints (/daops/pemadaman and /daops/groundcheck) with Stale-While-Revalidate caching.

Technical specifications

  1. Target files:
    • src/app/api/daops/route.ts: Edge route handler with error handling and fallback cache.
    • src/lib/services/daops.ts: Upstream fetching and status classification service.
    • src/types/daops.ts: Schema for DAOPS field reports.
  2. Field status normalization:
    • DILAPORKAN_PADAM (Extinguished/Controlled)
    • SEDANG_PEMADAMAN (Active suppression in progress)
    • GROUNDCHECK_LAPANGAN (Ground verification underway)

Acceptance criteria

  • Route returns normalized GeoJSON FeatureCollection of active field missions.
  • Edge caching responds under 30ms on repeated requests (s-maxage=600, stale-while-revalidate=120).
  • Upstream API timeout falls back safely to cached data without crashing.

Authoritative Specifications & Reference Documentation

  • Titik Gambut Architecture & Subsystem Contract: docs/ARCHITECTURE.md
  • KLHK SiPongi+ Hotspot & Karhutla Command: sipongi.menlhk.go.id — Official active fire detection, Manggala Agni DAOPS operational stations, and field suppression records.
  • Manggala Agni Daops Directory: Ditjen PPI KLHK — Directory of 37 operational regions across Sumatra and Kalimantan.
  • Cloudflare R2 Object Storage: developers.cloudflare.com/r2 — Zero-egress HTTP 206 byte-range object storage.
  • Cloudflare CDN Cache-Control: developers.cloudflare.com/cache — Edge caching and Range header behavior.
### What to build Build the Next.js edge route `/api/daops` to sync active firefighting operations and field groundcheck missions from KLHK SiPongi+ endpoints (`/daops/pemadaman` and `/daops/groundcheck`) with Stale-While-Revalidate caching. ### Technical specifications 1. **Target files**: - `src/app/api/daops/route.ts`: Edge route handler with error handling and fallback cache. - `src/lib/services/daops.ts`: Upstream fetching and status classification service. - `src/types/daops.ts`: Schema for DAOPS field reports. 2. **Field status normalization**: - `DILAPORKAN_PADAM` (Extinguished/Controlled) - `SEDANG_PEMADAMAN` (Active suppression in progress) - `GROUNDCHECK_LAPANGAN` (Ground verification underway) ### Acceptance criteria - [x] Route returns normalized GeoJSON FeatureCollection of active field missions. - [x] Edge caching responds under 30ms on repeated requests (`s-maxage=600, stale-while-revalidate=120`). - [x] Upstream API timeout falls back safely to cached data without crashing. --- ### Authoritative Specifications & Reference Documentation - **Titik Gambut Architecture & Subsystem Contract**: [`docs/ARCHITECTURE.md`](https://git.nokopia.com/yuris/titik-gambut-next/src/branch/main/docs/ARCHITECTURE.md) - **KLHK SiPongi+ Hotspot & Karhutla Command**: [sipongi.menlhk.go.id](https://sipongi.menlhk.go.id/) — Official active fire detection, Manggala Agni DAOPS operational stations, and field suppression records. - **Manggala Agni Daops Directory**: [Ditjen PPI KLHK](http://ditjenppi.menlhk.go.id/) — Directory of 37 operational regions across Sumatra and Kalimantan. - **Cloudflare R2 Object Storage**: [developers.cloudflare.com/r2](https://developers.cloudflare.com/r2/) — Zero-egress HTTP 206 byte-range object storage. - **Cloudflare CDN Cache-Control**: [developers.cloudflare.com/cache](https://developers.cloudflare.com/cache/) — Edge caching and Range header behavior.
yuris changed title from Issue 49: [Backend] Live DAOPS suppression & groundcheck edge API route (/api/daops) to [Backend] Live DAOPS suppression & groundcheck edge API route (/api/daops) 2026-10-14 22:31:26 +00:00
yuris changed title from [Backend] Live DAOPS suppression & groundcheck edge API route (/api/daops) to Live DAOPS suppression & groundcheck edge API route (/api/daops) 2026-10-14 22:38:31 +00:00
yuris closed this issue 2026-10-15 02:59:50 +00:00
Sign in to join this conversation.
No labels
backend
frontend
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
yuris/titik-gambut-next#62
No description provided.