Inspiration Malaysia faces devastating wildfire and haze crises every year — peat fires, open burning, and forest fires cause billions in losses and severe air quality emergencies. Emergency response is often delayed because there's no fast, visual way to detect fires and route Bomba units automatically. We built Api-Api to change that.

What it does Api-Api is an AI-powered wildfire early warning system for Malaysia. Users upload drone, CCTV, or satellite imagery and the system instantly:

Detects fire and smoke using Google Gemini's Vision Language Model Classifies haze severity (Clear / Moderate / Unhealthy / Hazardous) Identifies the nearest Bomba (fire department) station Calculates real driving distance and ETA using live road network data Displays an interactive map showing the route from station to incident site Generates bilingual dispatch alerts in English and Bahasa Melayu

How we built it Frontend: React + TypeScript + Vite + Tailwind CSS AI: Google Gemini 2.0 Flash (Vision Language Model) via @google/genai Routing: OSRM open-source routing engine for real driving distance and ETA Maps: Leaflet.js with OpenStreetMap tiles Deployment: Google Cloud Run with Docker + nginx

Challenges we ran into Passing build-time environment variables through Docker into Vite's static bundle during Cloud Run deployment Getting Gemini to return structured JSON consistently without markdown artifacts Rendering Leaflet maps correctly inside React with SSR-safe lifecycle management Sourcing real Bomba station coordinates and matching them to AI-predicted regions Accomplishments that we're proud of End-to-end fire detection pipeline in under 5 seconds from image upload to dispatch plan Fully bilingual output (EN/BM) making it accessible to local first responders Real road routing (not estimates) with live map visualization — no Google Maps API key needed Deployed and publicly accessible on Cloud Run in a single day

What we learned How to structure Vision Language Model prompts to return reliable structured data The nuances of Vite's static build pipeline and how environment variables are baked in at compile time Integrating OSRM's free public routing API as a zero-cost alternative to Google Maps Distance Matrix Cloud Run's --source deployment flow with Docker multi-stage builds

What's next for Api-Api Wildfire Early Warning Live drone/CCTV feed integration via WebRTC for real-time continuous monitoring Expanding Bomba station coverage to all Malaysian states SMS/WhatsApp automated alerts to registered fire stations via Twilio Historical incident heatmap dashboard for JBPM (Fire and Rescue Department Malaysia) Integration with Malaysia's MetMalaysia weather API for wind-driven fire spread prediction

Built With

Share this project:

Updates