Sensor onboarding screens:
- add-sensor.tsx: BLE scanning + device selection
- setup-wifi.tsx: WiFi credentials + ESP32 provisioning
Flow:
1. Scan for nearby sensors via BLE
2. Select device from list
3. Enter WiFi credentials (SSID + password)
4. Send config over BLE using ESP IDF provisioning protocol
5. Verify connection and activate in backend
ESP Provisioning:
- services/espProvisioning.ts: ESP32 BLE provisioning implementation
- Protocol: custom-data exchange via BLE characteristics
- Security: WiFi password encrypted over BLE
- Timeout handling: 30s for provisioning, 60s for activation
User experience:
- Clear step-by-step wizard UI
- Loading states for BLE operations
- Success/error feedback
- Navigation to equipment screen on success
Core BLE system:
- BLEManager: Real BLE device scanning and connection (iOS/Android)
- MockBLEManager: Simulator-safe mock for development
- BLEContext: React context for BLE state management
- BLEProvider: Added to app/_layout.tsx
Bluetooth permissions:
- iOS: NSBluetoothAlwaysUsageDescription, NSBluetoothPeripheralUsageDescription
- Android: BLUETOOTH, BLUETOOTH_ADMIN, BLUETOOTH_CONNECT, BLUETOOTH_SCAN, ACCESS_FINE_LOCATION
Dependencies:
- react-native-ble-plx@3.5.0
- expo-device@8.0.10
- react-native-base64@0.2.2
Simulator support:
- Auto-detects iOS simulator via expo-device
- Falls back to MockBLEManager with fake devices
- No crashes or permission errors in development
Implemented three-tier sensor status (online/warning/offline) with visual indicators and BLE scanning for nearby devices.
Features:
- WPSensor type with status field (online/warning/offline)
- Automatic status calculation based on lastSeen time:
• Online: < 5 minutes (fresh data)
• Warning: 5 min - 1 hour (potential issue)
• Offline: > 1 hour (definitely problem)
- Dual sensor display: Connected (API) + Available Nearby (BLE)
- BLE scanning button for discovering nearby WP sensors
- Action Sheet for offline sensors with Reconnect/Remove options
- Updated summary card: Total/Online/Warning/Offline counts
- Visual status indicators: colored dots and labels
- Graceful error handling for API unavailability
Files changed:
- types/index.ts: Added WPSensor interface with status and source fields
- services/api.ts: Updated getDevicesForBeneficiary with status calculation
- equipment.tsx: Complete UI overhaul with BLE scanning and two-tier sensor list
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- BeneficiaryMenu: Navigate with ?edit=true param to open edit modal
- Beneficiary index: Auto-open edit modal when edit=true in URL
- Add loading indicator on Save button during edit save
- Add "Uploading..." overlay on avatar during image upload
- babel.config.js: changed jsxRuntime from 'classic' to 'automatic' (React 19 requirement)
- AuthContext.tsx: reordered useEffect/useCallback to fix "Cannot access 'checkAuth' before initialization" error on web
- CLAUDE.md: added Quick Start, Git Workflow, Credentials sections
Web version now builds and runs correctly with npm run web
The main Beneficiaries tab is actually "index" not "beneficiaries".
/(tabs) routes to index which shows the beneficiaries list.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added isNavigatingAway state to block auto-redirects when user clicks back
- Both header back button and main button now set this flag before navigating
- Prevents loadBeneficiary from triggering competing redirects
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Monitoring badge: equipment active + subscription active
- Get kit badge: user hasn't ordered equipment yet
- Equipment status badges: ordered, shipped, delivered
- No subscription warning when equipment works but no sub
- Stripe subscription caching in backend (hourly sync)
- BeneficiaryMenu with edit/share/archive/delete actions
TouchableOpacity inside ScrollView sometimes doesn't respond.
Pressable is more reliable.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Changed router.replace to router.push for better navigation
- Both header back button and main button now go to beneficiaries list
- Added console.log for debugging
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Make "Back to My Loved Ones" the primary action (blue button)
- Make "I received my kit" secondary/subtle (gray, smaller)
- Prevents accidental confirmation of kit receipt
- Users can easily return to beneficiary list
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add splashHidden flag to prevent double-hiding splash screen
- Add .catch() to preventAutoHideAsync to handle edge cases
- Fixes "No native splash screen registered" warning
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added role field to Beneficiary type
- Display role (Custodian/Guardian/Caretaker) in small gray text under name
- Role comes from user_access table via API
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Redirects should only happen on the main beneficiary page (index.tsx).
Other pages (subscription, equipment, share) just show their content
without redirecting - user navigated there intentionally via menu.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- BeneficiaryMenu: dropdownItem now has width: 100%
- Increased minWidth to 180 and added overflow: hidden
- Users can now tap anywhere on the menu row, not just the text
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add legacy dashboard API methods (eluxnetworks.net)
- Implement JWT token validation before using cached credentials
- Clear invalid tokens (non-JWT strings like "0") and force re-login
- Use correct credentials (anandk/anandk_8)
- Add 30-minute token refresh interval when WebView is active
- Fix avatar upload using expo-file-system instead of FileReader
- Handle address field as both string and object
- Created reusable BeneficiaryMenu component with Modal backdrop
- Menu closes on outside tap (proper Modal + Pressable implementation)
- Removed debug panel from subscription and beneficiary detail pages
- Fixed subscription creation and equipment status handling
- Backend improvements for Stripe integration
- Remove expires_at from SELECT queries
- Remove expiresAt from API responses
- DB change: dropped expires_at column, fixed FK to beneficiaries table
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Database:
- Simplified beneficiary schema: single `name` field instead of first_name/last_name
- Single `address` field instead of 5 separate address columns
- Added migration 008_update_notification_settings.sql
Backend:
- Updated all beneficiaries routes for new schema
- Fixed admin routes for simplified fields
- Updated notification settings routes
- Improved stripe and webhook handlers
Frontend:
- Updated all forms to use single name/address fields
- Added new equipment-status and purchase screens
- Added BeneficiaryDetailController service
- Added subscription service
- Improved navigation and auth flow
- Various UI improvements
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- GET /me/profile → GET /auth/me
- PATCH /me/profile → PATCH /auth/profile
These endpoints now correctly match the backend implementation
in backend/src/routes/auth.js
- Move role selector (Caretaker/Guardian) above email input in Access screen
- Remove "(view only)" suffix from Caretaker role in email templates
- Remove "expires in 7 days" text from invitation emails
- Remove expires_at field from invitation creation (invitations never expire)
- Fix deletion of accepted invitations (now also removes user_access record)
- Add favicon to accept-invite.html page
- Add GET /api/invitations/info/:code endpoint to fetch role before accepting
- Show role and permissions on accept page BEFORE clicking Accept
- Simplify success page: remove permissions list, add link to wellnuo.com
- Minimalist design: light header background, logo only
- BeneficiaryCard now shows equipment status badges (ordered/shipped/delivered)
- Added AwaitingEquipmentScreen with progress tracker
- "I received my kit" button to mark as delivered
- "Activate" button when equipment is delivered
- Fixed address field height in add-loved-one form
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Changed voiceList style from flex: 1 to minHeight: 300
- Added backgroundColor and borderRadius for better visibility
- Now all 35+ voices are visible and scrollable in the DEV modal
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Convert login from username/password to email input
- Add OTP verification screen with auto-login for dev email
- Add dev email bypass (serter2069@gmail.com) using legacy anandk credentials
- Add saveEmail/getStoredEmail methods to API service
- Add email field to User type
- Clean up logout to also clear stored email
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
ScrollView now properly scrolls through all 35+ voices
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Voice assistant enhancements:
- DEV-only voice picker modal for testing TTS voices
- Support for 35+ languages: English variants, European, Asian, Middle Eastern
- Each voice can be tested with localized sample text
- Speech recognition enabled for voice input
- Continuous conversation mode with auto-listening
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>