A fully static, GitHub Pages–compatible wildfire reporting web app for Kouga Municipality. It lets residents send reports via WhatsApp or email, and logs a best‑effort copy to Firebase Firestore for cross‑referencing.
- Users fill in visible signs, severity, size, spread, and optional notes.
- GPS is optional; if unavailable, the nearest town/area is required.
- Reports can be sent via WhatsApp or email, or copied to the clipboard.
- A best‑effort Firestore log is created on WhatsApp/Email clicks.
- Active static PWA: everything is served from the repo root (no build step).
- Entry points:
index.html(main UI),privacy.html,terms.html,disclaimer.html. - Runtime behavior: best‑effort logging to Firestore, optional geolocation, and offline caching via
service-worker.js. - Dependencies: browser APIs + Firebase web SDK (loaded at runtime), with all config captured in
app.js.
- Push the repo to GitHub.
- Go to Settings → Pages.
- Under Build and deployment, select Deploy from a branch.
- Choose Branch: main and Folder: / (root), then Save.
- Wait for Pages to publish, then open:
https://lunatechza.github.io/kouga-fire-report/.
GitHub Pages serves over HTTPS, which is required for geolocation and Firebase.
Use the snippets below or open embed.html to generate copy‑paste snippets with live previews.
Quick start (copy/paste)
<script
src="https://lunatechza.github.io/kouga-fire-report/widget.js"
data-label="🔥 Report Fire"
data-ref="station-23"
data-source="embed"
data-position="bottom-right"
></script>The widget resolves its base URL from the script
srcso it stays GitHub Pages subpath‑safe.
<a
href="https://lunatechza.github.io/kouga-fire-report/?source=partner-site&ref=station-23&area=Humansdorp"
target="_blank"
rel="noopener noreferrer"
>
🔥 Report Fire
</a><a
href="https://lunatechza.github.io/kouga-fire-report/?source=partner-site&ref=station-23&area=Humansdorp"
target="_blank"
rel="noopener noreferrer"
style="
position: fixed;
right: 16px;
bottom: 16px;
z-index: 9999;
background: #d7263d;
color: #fff;
padding: 12px 16px;
border-radius: 999px;
text-decoration: none;
font-weight: 600;
font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
"
>
🔥 Report Fire
</a>Include widget.js from the same host as the PWA. The script injects a floating button automatically.
<script
src="https://lunatechza.github.io/kouga-fire-report/widget.js"
data-label="🔥 Report Fire"
data-ref="station-23"
data-source="embed"
data-position="bottom-right"
data-version="1.1.0"
></script>Widget configuration reference
| Attribute | Description | Default |
|---|---|---|
data-label |
Button text (use 🔥 if you want the fire emoji). | 🔥 Report Fire |
data-ref |
Partner or campaign reference (max 80 chars). | (none) |
data-source |
Source label (max 80 chars). | embed |
data-position |
bottom-right, bottom-left, top-right, or top-left. |
bottom-right |
data-url |
Optional override of the base URL for the PWA. | (auto) |
data-version |
Optional widget version tag for logging. | (none) |
Position examples
<script src="https://lunatechza.github.io/kouga-fire-report/widget.js" data-position="bottom-right"></script>
<script src="https://lunatechza.github.io/kouga-fire-report/widget.js" data-position="bottom-left"></script>
<script src="https://lunatechza.github.io/kouga-fire-report/widget.js" data-position="top-right"></script>
<script src="https://lunatechza.github.io/kouga-fire-report/widget.js" data-position="top-left"></script>Base URL notes
- GitHub Pages hosts at
https://<org>.github.io/<repo>/so always include the repo path. - The widget uses its own
srcURL to stay subpath‑safe. - If you must override, set
data-urlto the full base URL ending in/.
import 'package:url_launcher/url_launcher.dart';
Future<void> openKougaReport() async {
final url = Uri.parse(
'https://lunatechza.github.io/kouga-fire-report/?source=flutter&ref=my-app&area=Humansdorp',
);
if (!await launchUrl(url, mode: LaunchMode.externalApplication)) {
throw 'Could not launch $url';
}
}- Added partner widget v1.1.0 with idempotent injection and version tagging.
- Added
embed.htmllive demo generator with copy buttons. - Added client-side throttling + sanitized input handling in the PWA.
- Added extra Firestore logging fields (session ID, widget version, submit channel).
- Create a Firebase project in the Firebase Console.
- Create a Firestore database (start in production or test mode as needed).
- Add a Web app in Firebase and copy the config values.
- Paste the config into
app.js:const firebaseConfig = { apiKey: "...", authDomain: "...", projectId: "...", appId: "..." };
- Publish Firestore rules (see snippet below).
Anonymous Auth is not required right now. Enable it later only if you want authenticated reads from the app.
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /fire_reports/{docId} {
allow create: if true;
allow read: if request.auth != null;
}
}
}The app includes static pages at:
privacy.htmlterms.htmldisclaimer.html
Link to these from the main footer and header. Keep them in the repo root for GitHub Pages subpath compatibility.
- All links are relative (e.g.
./privacy.html) so the app works under/<repo>/. - Replace the “Hosted at” placeholder in the footer once hosting is confirmed.
- If you need to contact Lunatech about this app, open a GitHub issue at
https://github.com/lunatechza/kouga-fire-report/issues. - Keep static assets in the repo root to preserve GitHub Pages compatibility.
- If the app looks stale, do a hard refresh (Ctrl/Cmd+Shift+R).
- Clear site data if the service worker or cache feels stuck (DevTools → Application → Clear storage).
- After updates, unregister the old service worker or wait for it to refresh on the next load.
- Open the site in Safari.
- Tap Share.
- Tap Add to Home Screen.