Demo Credentials
| Admin Email | admin@nerap.cloud |
| Admin Password | nerap2026 |
| WhatsApp Number | +254738162126 |
Testing as Admin
- Login: Click "Moderator Login" in the top navbar (or visit
auth_login.php). Enter the admin credentials above.
- Dashboard: After login you'll see the admin dashboard with live counters and charts mirroring the public homepage.
- Facilities CRUD: Go to Facilities in the sidebar. Add a new facility (e.g. "Kenyatta National Hospital" with coordinates latitude
-1.301, longitude 36.807). Edit or delete existing facilities. Changes appear instantly on the public map.
- Resource Types CRUD: Go to Resource Types. Add a new resource (e.g. category "Oxygen", subtype "Cylinders", synonyms "oxygen,cylinders,oksijeni"). These resources appear in the public filter dropdown and WhatsApp menu.
- Link Resources to Facilities: In Facilities, click a facility and assign resources with a stock status (Confirmed / Low / Out / Unverified). This populates the map markers and WhatsApp search results.
- Moderation Queue: Go to Moderation Queue. Any stock reports submitted via WhatsApp or the web form appear here as pending. Approve or reject them. Approving a report updates the facility's stock status and triggers instant alert notifications to subscribers.
- Subscribers: Go to Subscribers to view all users who subscribed to alerts (via WhatsApp or the web form). You can filter by channel, region, or resource.
- Broadcast Alert: Go to Broadcast Alert. Compose a message, select a region and/or resource scope, and send it to all matching subscribers via WhatsApp and/or email.
- Admin Users: Go to Admin Users (super_admin only). Add new moderators or admins. Assign roles and regions.
Testing as a Public User (Web)
- Live Map: On the homepage, use the filter bar to filter by resource type, region, or stock status. Click map markers for facility details, phone numbers, and directions.
- Facility List: The right sidebar shows facility cards. Click a card to pan/zoom the map to that facility.
- Real-Time Analytics: Scroll down to see Chart.js dashboards — stock trends, status breakdown doughnut, regional comparison, and alert activity. These update every 30 seconds via AJAX polling.
- Report Stock: Click "Report Stock" in the navbar. Select a facility (or type a new name), choose a resource, and set the stock status. Your report goes to the moderation queue for admin approval.
- Subscribe to Alerts: Click "Get Alerts" in the navbar. Choose WhatsApp, email, or both. Optionally filter by region and resource. You'll be notified when stock status changes.
Testing via WhatsApp
Send a WhatsApp message to +254738162126 and follow the numbered menu:
- Main Menu: Send
MENU or HI. You'll receive:
👋 Welcome to NERAP Cloud!
0️⃣ Search Resources
1️⃣ Report Stock Update
2️⃣ Subscribe to Alerts
Reply with a number:
- Search Resources: Reply
0. You'll get a numbered list of all resource types. Reply with a number (e.g. 1) to see which facilities stock that resource, with status, phone, and Google Maps links.
- Report Stock: Reply
1. Select a facility from the numbered list (or press 0 to type a custom name). Then select a resource from the numbered list. Then choose stock status: 1 = Confirmed, 2 = Low, 3 = Out. Your report enters the moderation queue.
- Subscribe to Alerts: Reply
2. Select a resource from the numbered list. You're now subscribed — you'll receive a WhatsApp message when that resource's stock status changes at any facility.
- Reset Anytime: Send
MENU or RESET at any point to return to the main menu.
Tech Stack
- Backend: Vanilla PHP (no framework), MySQL, flat file structure
- Frontend: Bootstrap 5, jQuery, Font Awesome, Chart.js, Google Maps API
- Messaging: WhatsApp Cloud API-compatible provider, Brevo transactional email (REST API)
- Geospatial: Bounding-box pre-filter + Haversine distance formula for facility search
- State Machine: MySQL row-locked sessions (
wa_sessions) for multi-step WhatsApp conversations
- PWA: Manifest + theme color for mobile-native app feel