PROXOCORIS International Competition 2026 Category: Web Development | Subtema: AI for Climate Justice and Social Resilience Team: Ngawi Empire
π Live Demo: https://demo.xlabscloud.com/climavoice/ π¦ Repository: https://github.com/yon3zu/climavoice
ClimaVoice is a community-driven web platform that empowers Indonesian citizens to report, monitor, and address environmental issues using the power of Artificial Intelligence. Every report submitted is automatically analyzed by Google Gemini AI to assess severity, provide impact assessments, and recommend follow-up actions β bridging the gap between community voices and real-world environmental solutions.
- Submit reports with title, description, category, photo evidence, and GPS location pinned on an interactive Leaflet.js map
- 9 categories: Water Pollution, Air Pollution, Deforestation, Flood, Wildfire, Industrial Waste, Illegal Dumping, Soil Erosion, and Others
- Real-time view count and community upvote support system
- Comment and discussion on each report
- Auto-Analysis on Submit β Every new report is instantly analyzed by AI upon submission
- AI assesses: environmental impact, severity level (Critical / High / Medium / Low), recommended actions, and risk factors
- AI Climate Assistant β Conversational AI chatbot trained on ClimaVoice context, Indonesian environmental law (UU PPLH), and climate knowledge. Knows how to guide users to report through the platform
- Chat history stored per session, supports markdown-formatted responses
- Live Air Quality Index (AQI) widget on each report detail page
- Powered by AQICN API β shows AQI value, health level, dominant pollutant, and nearest monitoring station
- Automatically fetched based on report's GPS coordinates
- 3 ranking tabs: Most Reports, Most Community Support (Upvotes), Most Resolved Issues
- Visual podium for Top 3 with π₯π₯π₯ medals
- Automatic badge system: π° Pemula β π± Pelapor Aktif β πΏ Aktivis Hijau β β‘ Pejuang Iklim β π Legenda Iklim
- "Your Rank" highlight for logged-in users
- Generate a clean, print-optimized PDF for any report
- Includes: photo evidence, AI analysis, GPS coordinates, Google Maps link, and ClimaVoice branding
- Useful for forwarding reports to government agencies (DLHK, BKSDA, KLHK)
- Full report management: view all reports, change status (Pending β Verified β In Progress β Resolved)
- Delete reports with cascade (removes upvotes, comments, and photo files)
- Stats overview: total, pending, critical reports
- Real-time inline status update via AJAX β no page reload
- Secure registration & login with bcrypt password hashing
- Profile settings: name, email, bio
- Password change with strength indicator
- Personal dashboard with report stats and action buttons (view, edit, delete)
- Installable on mobile homescreen (Android & iOS)
- Service worker for asset caching and offline fallback page
- App shortcuts: Report, AI Chat, Leaderboard
| Layer | Technology |
|---|---|
| Frontend | HTML5, Tailwind CSS (CDN), Vanilla JavaScript |
| Backend | PHP 8.x (no framework, custom router) |
| Database | MySQL 8 with PDO |
| AI | Google Gemini 2.0 Flash via OpenRouter API |
| Maps | Leaflet.js + OpenStreetMap |
| Air Quality | AQICN API (World Air Quality Index) |
| PDF Export | Browser Print API with print-optimized CSS |
| PWA | Web App Manifest + Service Worker |
| Routing | Apache mod_rewrite (.htaccess) β clean URLs |
climavoice/
βββ index.php # Main router
βββ manifest.json # PWA manifest
βββ database.sql # Full DB schema + seed data
βββ .htaccess # Clean URL routing
β
βββ config/
β βββ config.php # App constants, API keys
β βββ database.php # PDO singleton connection
β
βββ includes/
β βββ functions.php # Helpers: upload, AI call, auth, etc.
β βββ header.php # Navbar, PWA tags, flash messages
β βββ footer.php # Footer, Leaflet JS, service worker reg
β
βββ pages/
β βββ home.php # Landing page with map & stats
β βββ reports.php # Report listing with filters
β βββ report-detail.php # Report detail, AI analysis, AQI widget
β βββ report-edit.php # Edit report (owner/admin)
β βββ report-print.php # Print/PDF export page
β βββ submit.php # Submit new report
β βββ dashboard.php # User dashboard
β βββ profile.php # Profile & password settings
β βββ admin.php # Admin panel
β βββ leaderboard.php # Community leaderboard
β βββ chat.php # AI Climate Assistant chat
β βββ login.php # Login
β βββ register.php # Registration
β βββ about.php # About ClimaVoice
β βββ terms.php # Terms & Conditions
β βββ privacy.php # Privacy Policy
β βββ 404.php # Not found page
β
βββ api/
β βββ ai-analyze.php # AI report analysis endpoint
β βββ ai-chat.php # AI chat endpoint
β βββ air-quality.php # AQICN proxy endpoint
β βββ auth.php # Register/login API
β βββ comment.php # Comment submit
β βββ delete-report.php # Delete report (owner/admin)
β βββ reports.php # Reports API
β βββ update-status.php # Admin status update
β βββ upvote.php # Upvote toggle
β
βββ assets/
βββ css/style.css # Custom CSS (no @apply β plain CSS)
βββ js/
β βββ main.js # Scroll animations, char counters
β βββ sw.js # Service worker
βββ icons/ # PWA icons (192px, 512px)
βββ uploads/ # User-uploaded report photos
- PHP 8.0+
- MySQL 8.0+
- Apache with
mod_rewriteenabled AllowOverride Allin Apache config
1. Clone the repository
git clone https://github.com/YOUR_USERNAME/climavoice.git2. Place in web server root
/htdocs/climavoice/ (XAMPP)
/var/www/html/climavoice/ (Linux Apache)
3. Import database
mysql -u root -p < database.sqlOr import via phpMyAdmin β creates database climavoice with all tables and demo data.
4. Configure the app
Edit config/config.php:
define('APP_URL', 'http://localhost/climavoice');
define('BASE_PATH', '/climavoice');
define('OPENROUTER_API_KEY', 'your-openrouter-api-key');
define('AQICN_TOKEN', 'your-aqicn-token');Get API keys:
- OpenRouter: https://openrouter.ai (free tier available)
- AQICN: https://aqicn.org/api/id/ (free token)
5. Set upload permissions
chmod 777 assets/uploads/6. Enable Apache mod_rewrite (Linux)
sudo a2enmod rewrite
sudo systemctl restart apache27. Access the app
http://localhost/climavoice
Email : admin@climavoice.id
Password : password
| Config | Value |
|---|---|
| AI Model | google/gemini-2.0-flash-001 |
| Max Upload Size | 5 MB (JPG, PNG, WebP) |
| File Validation | Magic bytes (cross-platform, no finfo dependency) |
| Password Hashing | bcrypt via password_hash() |
| CSRF Protection | Token on all POST forms |
| Session | PHP native sessions |
| Table | Description |
|---|---|
users |
id, name, email, password (bcrypt), role, bio, created_at |
reports |
id, user_id, title, description, category, location_name, location_lat, location_lng, photo, status, ai_analysis, ai_severity, upvote_count, view_count, created_at, updated_at |
report_upvotes |
id, report_id, user_id β unique per user per report |
comments |
id, report_id, user_id, content, created_at |
chat_messages |
id, session_key, user_id, role, content, created_at |
All foreign keys use ON DELETE CASCADE.
- CSRF tokens on all forms
- Prepared statements (PDO) β no SQL injection
- bcrypt password hashing
- Magic bytes file validation (not relying on finfo/MIME)
- Role-based access control (admin vs user)
- XSS prevention via
htmlspecialchars()on all output - File upload restricted to JPG/PNG/WebP with size limit
Tested and verified to work on:
- β macOS (XAMPP)
- β Windows (XAMPP)
- β Linux (Apache2)
Key cross-platform decisions:
- Magic bytes instead of
finfofor file validation dirname(__DIR__)for path resolution (no hardcoded separators)utf8mb4MySQL charset- No OS-specific PHP extensions required
ClimaVoice is installable as a Progressive Web App:
- Add to homescreen on Android (Chrome) and iOS (Safari)
- Offline fallback page when no internet connection
- App shortcuts for quick access to key features
- Theme color
#16a34a(ClimaVoice green)
- Heatmap layer on main map (Leaflet.heat)
- Public analytics dashboard with Chart.js
- Dark mode toggle
- Email notifications on report status change
- AI report similarity detection (prevent duplicates)
- Multi-language support (ID/EN)
- Open API for third-party access
- Tailwind CSS β MIT License (CDN)
- Leaflet.js β BSD 2-Clause License
- OpenStreetMap β ODbL License
- Google Gemini β via OpenRouter API (Google Terms of Service)
- AQICN β World Air Quality Index API
All code in this repository is original work by Team Ngawi Empire.
Ngawi Empire PROXOCORIS International Competition 2026 Category: Web Development Subtema: AI for Climate Justice and Social Resilience
"Suara Komunitas untuk Keadilan Iklim" ClimaVoice β Bridging Gaps: Code for Earth, Intelligence for Justice, and Sustainability for Shaping Tomorrow