Wave-to-Meet Quick Start Guide โ
Get the Wave-to-Meet feature running locally in 5 minutes.
Prerequisites โ
- Node.js 16+ installed
- Code editor (VS Code recommended)
- Terminal access
Setup โ
1. Install Dependencies โ
bash
cd /home/mechelle/repos/lantern_app
npm install2. Start Development Server โ
bash
npm run devServer starts at http://localhost:5173
Testing the Feature โ
Option A: Interactive Demo (Recommended) โ
Open the app in your browser
Simulate a wave:
- Look for the purple "Simulate Wave" button in the top-right corner
- Click it to trigger an incoming wave notification
Accept the wave:
- Wave notification appears at bottom of screen
- Click "Accept" button
- Connection is created
Open chat:
- Click "Open Chat" button on the accepted wave
- Full-screen chat interface opens
- Type a message and press Send
Activate beacon:
- Click "Hold Up Lantern to Meet" button
- Full-screen color beacon activates
- Color pulses and glows
Test different colors:
- Close beacon (X button)
- Decline the wave
- Simulate another wave
- Accept it (gets random color)
- Repeat to see all 5 colors
Option B: Storybook โ
bash
npm run storybookBrowse components:
- Components > WaveManager: Wave notification states
- Components > Chat: Chat interface with messages
- Components > LanternBeacon: All 5 color variants
File Structure โ
src/
โโโ components/
โ โโโ WaveManager.jsx # Wave notifications
โ โโโ WaveManager.stories.jsx
โ โโโ Chat.jsx # Anonymous chat
โ โโโ Chat.stories.jsx
โ โโโ LanternBeacon.jsx # Color beacon
โ โโโ LanternBeacon.stories.jsx
โ
โโโ dashboard/
โ โโโ Dashboard.jsx # Main app (integrates wave flow)
โ
โโโ App.jsx # Root component
docs/
โโโ features/
โ โโโ wave/
โ โโโ WAVE_TO_MEET.md # Complete feature docs
โ โโโ FEATURE_SUMMARY.md # Implementation summary
โ โโโ BEACON_COLORS.md # Color reference
โ โโโ WAVE_QUICK_START.md # This guide
โโโ engineering/
โโโ API.md # Backend endpoints (updated)Key Functions to Know โ
In Dashboard.jsx โ
Send a wave:
js
handleSendWave(lanternId)
// TODO: POST to /api/wavesAccept a wave:
js
handleAcceptWave(waveId)
// Generates random color
// Creates connection
// TODO: POST to /api/waves/:id/acceptOpen chat:
js
handleOpenChat(connectionId)
// Sets activeChat state
// Renders Chat componentActivate beacon:
js
handleHoldUpLantern()
// Sets showBeacon to true
// Renders LanternBeacon componentSimulating Backend Responses โ
The feature is currently frontend-only with stubbed data. To connect to a real backend:
1. Update Wave Sending โ
In Dashboard.jsx, replace:
js
console.log('Wave sent to lantern:', lanternId)With:
js
await fetch('/api/waves', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ targetLanternId: lanternId, senderLanternId: myLantern.id })
})2. Add WebSocket for Real-time Waves โ
js
useEffect(() => {
const ws = new WebSocket('ws://localhost:3000/ws/waves')
ws.onmessage = (event) => {
const data = JSON.parse(event.data)
if (data.type === 'wave_received') {
setIncomingWaves([...incomingWaves, data.wave])
}
}
return () => ws.close()
}, [])3. Update Chat Messages โ
In Chat.jsx, replace the TODO with:
js
await fetch('/api/messages', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ connectionId: connection.id, text: message, timestamp: new Date() })
})Troubleshooting โ
Wave button doesn't work โ
- Check browser console for errors
- Verify
onWaveprop is passed toVenueViewcomponent - Ensure
handleSendWaveis defined in Dashboard
Chat doesn't open after accepting wave โ
- Verify
activeChatstate is set correctly - Check that
Chatcomponent is rendered conditionally - Inspect React DevTools for state changes
Beacon doesn't show matching color โ
- Verify
matchColoris in the connection object - Check that
showBeaconstate is true - Try different colors in Storybook to isolate issue
"Simulate Wave" button not appearing โ
- Only shows in development mode (
NODE_ENV === 'development') - Check that dev server is running (not production build)
Next Steps โ
Review Documentation:
- WAVE_TO_MEET.md - Full feature specs
- API.md - Backend endpoint requirements
- BEACON_COLORS.md - Color reference
Backend Integration:
- Implement WebSocket server for real-time notifications
- Create REST endpoints for waves, connections, messages
- Add geofencing validation
Testing:
- Write unit tests for wave acceptance logic
- Test color synchronization across devices
- Validate rate limiting
Deploy:
- Remove "Simulate Wave" button
- Build production bundle:
npm run build - Deploy with your hosting provider
Questions? โ
- GitHub Issues: Open an issue
- Documentation: DOCS_INDEX.md
- Contributing: docs/CONTRIBUTING.md
Happy coding! ๐ฎ