Venue & Lantern Testing Guide โ
Overview โ
This guide walks you through testing the new venue and lantern lighting functionality across multiple devices.
Quick Setup โ
1. Seed Test Venues (One-Time Setup) โ
Make sure dev server is running first: npm run dev
Open your browser's developer console (F12) and run:
// The seed function is automatically available in dev mode
await window.seedVenues()You should see output like:
๐ฑ Seeding test venues...
โ
Created: Brew & Co Coffee
โ
Created: Sunset Yoga Studio
... (8 venues total)
๐ Seeding complete! Created 8/8 venues.Verify in Firestore Console:
- Go to Firebase Console โ Firestore Database
- You should see a
venuescollection with 8 documents - Each document has: name, address, lat, lng, category, activeLanternCount, etc.
If you don't see venues in Firestore:
- Check browser console for errors
- Verify you're logged in (auth required to create venues)
- Check Firebase project: Should be
lantern-app-dev - Deploy Firestore rules if needed:
firebase deploy --only firestore:rules
This will create 8 test venues in downtown San Diego.
2. Set Location Spoofing โ
In .env.local:
# San Diego coordinates (downtown Gaslamp Quarter)
VITE_DEV_TEST_LOCATION="32.7157,-117.1611"Restart dev server: npm run dev
Testing Workflow โ
Single Device Test โ
Login to the app with a test account
Open Dashboard (should be default view)
Click the Fire icon (bottom nav)
Lantern Hub opens โ Click "Light Lantern"
Select a venue from the nearby list (should show all 8 test venues)
Lantern lights โ You'll see:
- Active lantern in Lantern Hub
- Countdown timer (2 hours)
- Venue name and details
Extinguish โ Click "Extinguish Lantern" in Lantern Hub
Multi-Device Test (Waves) โ
Device A (User 1) โ
- Login with
user1@test.com - Set location spoof to San Diego (
32.7157,-117.1611) - Light lantern at Brew & Co Coffee
- Leave Lantern Hub open
Device B (User 2) โ
- Login with
user2@test.com - Set same location spoof
- Light lantern at Brew & Co Coffee (same venue)
- Both users now have active lanterns at the same venue
Test Wave Interaction (Coming Next) โ
- User 2 should see User 1's lantern in the venue
- User 2 can send a "Wave" to User 1
- User 1 receives wave notification
- Both can start a chat
Test Venues โ
All venues are clustered around downtown San Diego:
| Venue Name | Category | Merchant? |
|---|---|---|
| Brew & Co Coffee | Coffee Shop | No |
| Sunset Yoga Studio | Yoga Studio | No |
| The Gaslamp Tavern | Bar | No |
| Pacific Bites Restaurant | Restaurant | No |
| Zen Wellness Spa | Wellness | No |
| Harbor Fitness Gym | Gym | No |
| Pages & Prose Bookstore | Bookstore | No |
| Urban Bowls | Restaurant | Yes (demo merchant) |
Firestore Security Rules โ
Before testing, ensure these rules are deployed:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Venues - read-only for all authenticated users
match /venues/{venueId} {
allow read: if request.auth != null;
allow write: if false; // Admin only (manual seed)
}
// Lanterns - users can only manage their own
match /lanterns/{lanternId} {
allow read: if request.auth != null;
allow create: if request.auth != null
&& request.resource.data.userId == request.auth.uid;
allow update, delete: if request.auth != null
&& resource.data.userId == request.auth.uid;
}
}
}Deploy with:
firebase deploy --only firestore:rulesTroubleshooting โ
"No venues found nearby" โ
- Check
.env.localhasVITE_DEV_TEST_LOCATIONset - Restart dev server
- Open ProfileSettings โ Location Spoofing panel โ Verify coordinates
- Ensure venues were seeded successfully
"Unable to get your location" โ
- Browser location permission may be blocked
- Use the debug panel in ProfileSettings to manually set location
- Check console for geolocation errors
"Lantern not appearing in Hub" โ
- Check Firestore console โ
lanternscollection - Verify user is authenticated (check localStorage for auth token)
- Check browser console for errors
- Try refreshing the page
"Lantern expired immediately" โ
- Check system clock (ensure it's accurate)
- Lanterns expire after 2 hours by default
- Check
expiresAtfield in Firestore document
Next Steps โ
Once basic venue/lantern functionality works:
Build Wave System
- Query active lanterns at same venue
- Send/receive wave notifications
- Accept/reject wave UI
Add Real-time Sync
- Live lantern count updates
- Wave notifications via Firestore listeners
- Chat message sync
Add Merchant Offers
- Wire
Urban Bowls(demo merchant) to offer system - Show offers when checking in at merchant venues
- Redemption flow
- Wire
Clean Up Test Data โ
To remove all test venues:
// In browser console
import { db } from './src/firebase'
import { collection, getDocs, deleteDoc } from 'firebase/firestore'
const venuesRef = collection(db, 'venues')
const snapshot = await getDocs(venuesRef)
for (const doc of snapshot.docs) {
await deleteDoc(doc.ref)
console.log('Deleted:', doc.id)
}To remove all test lanterns:
const lanternsRef = collection(db, 'lanterns')
const snapshot = await getDocs(lanternsRef)
for (const doc of snapshot.docs) {
await deleteDoc(doc.ref)
console.log('Deleted:', doc.id)
}