Formosa ESG 2026 — User Flow Diagram
LINE-Related
Main Flow
Data / Server
Level / Achievement
Carbon Footprint
1
Open Page
User enters Tracker via QR Code or LINE Rich Menu
📱 QR Code Scan
Physical posters / social sharing links
💬 LINE Rich Menu
LINE Bot @539fkwjd bottom buttons
2
LINE Login LIFF SDK
LIFF auto-triggers LINE Login, no password/registration needed
LIFF init → check login status → auto-fetch LINE avatar & name
First login auto-creates user in D1 (formosa_users upsert)
Locally store formosa_user_id + formosa_access_token
First login auto-creates user in D1 (formosa_users upsert)
Locally store formosa_user_id + formosa_access_token
Already logged in?
✅ Yes
Auto-display avatar + name, enter directly ❌ No
Redirect to LINE auth page → return to Tracker after auth 3
Privacy Consent + AuthGate
Explain data collection, get user consent before unlocking features
Collection items: LINE personal data, GPS trajectory, survey responses, daily carbon reports
Photos only read EXIF GPS (not uploaded to server)
User can anytime tap "Complete Pilgrimage" to stop tracking
Photos only read EXIF GPS (not uploaded to server)
User can anytime tap "Complete Pilgrimage" to stop tracking
4
Survey (14 Questions)One question per card
Linear progress bar + saveable mid-fill (auto-save to localStorage)
Q1-Q3
Goodwill & inspiration moments, charitable understanding level
Q4-Q6
Post-activity life changes intent
Q7-Q8
Transportation mode + distance (walk/drive/scooter/bus/MRT/train/HSR)
Q9-Q14
Plastic bottles / recycling / lodging / phone / carbon estimate
⚡ Carbon estimate real-time calculated (SBTi Eco-Footprint / Ecoinvent 3.10)
📞 Phone field is one of three conditions to unlock achievement card
📞 Phone field is one of three conditions to unlock achievement card
5
Submit Survey Server Sync
Survey answers bound to LINE userId, written to Cloudflare D1
Rate limit: max 2 submissions per 10 minutes
After submit, enter check-in mode (main page)
After submit, enter check-in mode (main page)
6
Check-in Mode (Check-in Mode)
Main interaction screen during pilgrimage, continuous GPS tracking
📍 Auto GPS Tracking
Background continuous route recording, KV buffer → batch write to D1
✋ Manual Check-in
Button trigger + location, accumulate distance & check-in count
📷 Photo Check-in
Select photo → read EXIF GPS → photo not uploaded (text indication only)
⏸️ Pause / Complete
Pause tracking without ending session; "Complete Pilgrimage" settles achievement card
Rate limit: 5 check-ins / 60 seconds (KV sliding window counter)
GPS points first write KV (TTL 24hr), nightly batch flush to D1
GPS points first write KV (TTL 24hr), nightly batch flush to D1
Continuous loop (repeat daily during activity)
6.5
Daily Carbon Footprint Report 🌱
Auto GPS-speed detection + manual supplement, real-time carbon conversion
🚶 Zero-Emission Movement (Auto)
Speed <15 km/h → determine walk/bike → CO₂ = 0
🚗 Transport Carbon (Manual)
Car 0.21 / scooter 0.10 / bus 0.05 / MRT 0.03 kg CO₂e/km
🧴 Daily Carbon
Plastic bottles 0.3 kg/bottle, lodging 2.5 kg/night
📊 Real-Time Estimate
Carbon footprint + carbon saved (vs. all-vehicle journey)
Data source: SBTi Eco-Footprint / Ecoinvent 3.10
Can resubmit daily (overwrites previous)
Can resubmit daily (overwrites previous)
7
Level System + AI Mascot
Dual-condition upgrade (kilometers + check-ins), 9-level evolution
| Level | Name | KM | Check-in | Approx |
|---|---|---|---|---|
| Lv.1 | 🔥 Novice Pilgrim | 0 | 1 | Start |
| Lv.2 | 🧱 Steadfast Walker | 15 | 3 | ≈ Day 1 |
| Lv.3 | 💛 Trail Blazer | 45 | 5 | ≈ Day 2 |
| Lv.4 | 👶 Road Warrior | 90 | 6 | ≈ Day 3 |
| Lv.5 | ✨ Sacred Wanderer | 135 | 8 | ≈ Day 4 |
| Lv.6 | 🌀 Spirit Walker | 180 | 10 | ≈ Day 5 |
| Lv.7 | 🤝 Path Guardian | 225 | 12 | ≈ Day 6 |
| Lv.8 | 🏆 Enlightened Pilgrim | 270 | 14 | ≈ Day 7 |
| Lv.9 | 🚀 The Ascended | 300 | 14+ | Full Journey |
Each level has an AI-generated pink-headscarf mascot (1200px WebP)
Dual-condition logic: both distance AND check-in targets must be met to level up
Dual-condition logic: both distance AND check-in targets must be met to level up
8
Achievement Card Unlock 🏅
All three conditions must be met to unlock
✓
Check-ins ≥ 3 ✓
Completed survey ✓
Provided phone 🎴 Card Content
Mascot + level + distance + check-in count + carbon footprint + carbon saved + route map
📎 QR Code
Links to personal verification page /my/[userId], merchants can scan to verify
9
Share 📤 Web Share API
One-click share with auto-generated OG preview
📤 Native Share
Button triggers Web Share API → system menu (LINE / FB / copy link)
🖼️ OG Preview Image
html2canvas screenshot → upload to R2 → dynamic OG meta tag
🔗 Personal Page
Friends click link to see real-time data (distance / check-ins / carbon)
🤖 Crawler Detection
Pages Function intercepts LINE/FB crawler, rewrites OG meta
10
Complete Pilgrimage 🎉
User manually ends or auto-settles when activity ends (4/20)
Stop GPS tracking → settle final level → lock achievement card
Personal page permanently saved (QR code remains valid)
Personal page permanently saved (QR code remains valid)