PERISAI: Rapid Response & Social Portal of Temon
Public complaint platform powered by Google Gemini 2.0 Flash AI auto-triage (1-3s), instant email notifications, and 15-village interactive GIS map.
π 1. Problem
βοΈ Legal Designation & Official Status: This platform is officially designated under Decree of Panewu Temon No. 104 of 2025 as the official electronic system for public service and data management across Temon District, with Fatahilah Miftahul Rahman serving as the designated Technical Consultant.
Kapanewon Temon governs 15 villages (Kalurahan) and hosts Yogyakarta International Airport (YIA). Rapid infrastructure growth triggered an increasing surge of public grievances (damaged roads, lighting, drainage, public service requests).
Prior to the PERISAI platform, grievance management suffered from 4 critical bottlenecks:
- Fragmented Channels: Citizen reports were scattered across personal WhatsApp and social media without centralized tracking.
- Slow Manual Triage: Public Relations staff manually sorted dozens of reports and drafted bureaucratic responses over 24β72 hours.
- Zero Transparency: Citizens had no mechanism to track whether reports were received, in-progress, or resolved.
- Database Security Risks: Internal tables lacked Row Level Security (RLS), exposing admin accounts to accidental deletion or privilege tampering.
π€ 2. Target User
- Citizens of Kapanewon Temon: Demand a 24/7 public complaint portal with instant email tracking receipts.
- PR Team & Admin Operators: Need AI triage recommendations to accelerate official responses using polite bureaucratic etiquette (βSedulurβ).
- Super Admins: Manage user directories and database-level security policies.
π‘ 3. Solution
Built PERISAI (Portal Elektronik Respons Cepat & Integrasi Sosial Aman Inklusif), a full-stack digital ecosystem that slashes bureaucratic response times from days to seconds.
Core technical solutions:
- Google Gemini 2.0 Flash AI Triage: Automatically analyzes report sentiment, categorizes issues, and drafts official responses upon form submission.
- Instant Email & Tracking Receipt: Issues a unique 12-digit tracking code (
TKT-2026-XXXX) synchronized with automated email delivery via Nodemailer SMTP. - 15-Village Interactive GIS Map: MapLibre GL spatial visualization featuring gesture-lock toggles for smooth mobile UX.
- Hardened Architecture: Next.js 16 App Router, Supabase PostgreSQL, and database-level RLS security triggers.
β 4. Key Features
- π Public Form & Rate Limiter (
/lapor): Responsive submission form with 15-village validation and IP-based Rate Limiting (10 requests / 10 mins). - π€ Gemini AI Auto-Triage (
/api/ai/process-aduan): Automated sentiment analysis, 6-category tagging, and official draft generation within 1β3 seconds. - π§ Transactional Email Engine (Nodemailer SMTP): Dispatches automated receipts and status updates (In-Progress/Resolved) complying with RFC 5322 headers.
- π Real-Time Complaint Tracker (
/lacak): Public tracking page with 500ms debounced search for instant progress updates. - πΊοΈ Admin Dashboard & Locked Map (
/dashboard/reports): Admin triage dashboard featuring a Collapsible Map Panel preventing mobile touch interference. - π‘οΈ PostgreSQL RLS Hardening: PL/pgSQL trigger
protect_superadmin_integrity()locking Super Admin accounts against unauthorized mutations.
π§± 5. Challenges & Lessons Learned
- Challenge 1: Email Deliverability & Spam Filter Avoidance
- Issue: Confirmation emails sent from Vercel Serverless were flagged by Gmail as new external sender messages.
- Solution: Upgraded to explicit SSL Port 465
smtp.gmail.com, added RFC 5322 headers, andawaited SMTP promises before returning HTTP responses.
- Challenge 2: Mobile Screen Scrolling Map Touch Conflict
- Issue: The interactive GIS map canvas intercepted finger gestures when users scrolled down mobile screens.
- Solution: Designed a Collapsible Map Panel locked by default with
[ πΊοΈ Open Map ]and[ π Lock Map ]toggles.
- Challenge 3: Text Squeezing on Medium Viewports
- Issue: Banner text descriptions wrapped awkwardly on tablet viewports.
- Solution: Refactored CSS wrappers using
flex-1 w-fullandleading-relaxedfor proportional horizontal expansion.
- Challenge 4: Disaster Recovery Persistence on Trial VPS
- Issue: Developing on a 3-month trial Cloud VPS required full environment portability.
- Solution: Tagged Git Release
v1.0.0-stableand generated a comprehensive backup archiveperisai-media-sosial-FULL-BACKUP.zip(156 MB) containing all code,.env, andschema.sql.
π 6. Impact
- Before: Triage turnaround and official responses took 24β72 hours without tracking receipts.
- After:
- Instant AI Triage: Report classification and response drafting complete in 1β3 seconds.
- 100% Confirmation Delivery: Citizens receive instant tracking IDs and receipts in their email inbox.
- Integrated GIS & Audit Trail: All grievances mapped across 15 villages with immutable audit logs in Supabase.
π οΈ Tech Choices
- Next.js 16 (App Router): Superior hybrid rendering (SSR/Client) performance and clean Vercel Serverless integration.
- Supabase PostgreSQL & RLS: High-performance relational database with built-in Row Level Security.
- Google Gemini 2.0 Flash: Ultra-fast, cost-efficient generative AI model tailored for Indonesian text analysis and local context.
- Nodemailer & Gmail SMTP: Reliable transactional email delivery supporting 500β2,000 emails/day without recurring API subscription costs.
- Tailwind CSS & Material 3: Consistent visual design tokens and multi-device responsiveness.
πΌοΈ Screenshots & Visual Demo
Figure 1: Main public landing page interface of PERISAI Kapanewon Temon featuring 24/7 official announcements and primary action buttons.
Figure 2: Public complaint submission form at /lapor route with citizen identification fields, 15-village dropdowns, and submission guidelines.
Figure 3: Real-time public complaint tracking page supporting instant lookups via 12-digit unique Tracking Codes (TKT-2026-XXXX).
Figure 4: Education and public service page featuring interactive FAQ accordions and Kapanewon Temon information disclosure guidelines.
Figure 5: Main Command Center Temon admin dashboard presenting real-time Supabase metrics and recent citizen complaint tables.
Figure 6: Report management dashboard equipped with an interactive 15-village GIS spatial map around YIA Airport and canvas gesture lock controls.
Figure 7: User directory management page for controlling administrator roles (Super Admin, Public Relations Operator, Field Staff).
Figure 8: System activity log page recording real-time chronological audit events, authentication triggers, and CSV export tools.
Daftar Sumber & Referensi Dikutip (5)
- Decree of Panewu Temon No. 104/2025 (Legal Designation of PERISAI Web Application)
- Next.js 16 App Router Docs https://nextjs.org/docs β
- Supabase PostgreSQL & Row Level Security https://supabase.com/docs β
- Google Gemini 2.0 Flash API Reference https://ai.google.dev/docs β
- Nodemailer SMTP Architecture https://nodemailer.com β