A React Native mobile application for peer discovery via Bluetooth Low Energy (BLE).
BeaconAI enables peer discovery through Bluetooth Low Energy (BLE) technology, allowing users to discover nearby devices and exchange profile information in a battery-efficient manner, with or without internet connectivity.
- Cross-Platform: Works on both iOS and Android
- Battery-Optimized: Smart interval scanning to preserve battery life
- Privacy-First: User controls for visibility and data sharing
- Offline-First: All functionality works without internet connectivity
- Type-Safe: Built with TypeScript for reliability and maintainability
The Bluetooth Low Energy implementation follows the BeaconAI project ruleset and Semantic Seed Coding Standards:
- BleService: Singleton service managing BLE operations
- DiscoveryContext: Context provider for BLE state management
- ProfileContext: Context provider for user profile management
- Test Screen: Interactive testing interface for BLE functionality
-
Battery Optimization:
- Interval scanning (5s every 30s) rather than continuous
- Platform-specific scan modes (LOW_POWER on Android, BALANCED on iOS)
- Pauses scanning and advertising when app is in background
-
Privacy Controls:
- Permission management for BLE operations
- User toggle for enabling/disabling discovery
- Peer data expiration (5-minute timeout)
-
Encoded Profiles:
- Compact encoding for BLE advertisements (max 31 bytes)
- Efficient profile data transmission
-
Graceful Degradation:
- Mock mode for testing without BLE hardware
- Clear user feedback when Bluetooth is unavailable
- Node.js (18+)
- npm or yarn
- iOS: XCode & CocoaPods
- Android: Android Studio & SDK
-
Clone the repository:
git clone https://github.com/relycapital/beaconAI.git cd beaconAI/mobile-frontend -
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Run on iOS:
npm run ios
-
Run on Android:
npm run android
Run unit and integration tests:
npm testRun tests with coverage:
npm run test:coveragemobile-frontend/
├── app/ # Expo Router screens
│ └── test-ble.tsx # BLE testing screen
├── components/ # Reusable UI components
├── context/ # React Context providers
│ ├── DiscoveryContext.tsx # BLE discovery state management
│ └── ProfileContext.tsx # User profile management
├── services/ # Service layer
│ └── BleService.ts # BLE functionality
├── types/ # TypeScript type definitions
│ ├── ble.ts # BLE-related types
│ └── profile.ts # User profile types
├── __tests__/ # Tests
│ ├── BleService.test.ts # Unit tests
│ └── BleDiscovery.integration.test.ts # Integration tests
└── [configuration files]
Following the Semantic Seed Coding Standards:
-
Branch Naming:
feature/{id}for new featuresbug/{id}for bug fixeschore/{id}for maintenance tasks
-
TDD Workflow:
- Write failing tests
- Implement to make tests pass
- Refactor and commit
-
Commit Messages:
- Format:
[Type] #{id} - Brief description - Example:
[Feature] #6 - Add BLE advertising functionality
- Format:
Issues and tasks are managed in GitHub Issues following a structured workflow:
-
Issues are classified as:
- Features (new functionality)
- Bugs (problems in existing functionality)
- Chores (maintenance tasks)
-
Point-based estimation:
- 0 points: Quick fixes
- 1-2 points: Straightforward tasks
- 3-5 points: More complex tasks
- 8+ points: Large tasks that should be broken down
Contributions are welcome! Please follow the established coding standards and workflow.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m '[Feature] #id - Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request