π± Mobile Application
The FirstBreath mobile app is built with React Native and Expo. It allows trainers and stable managers to monitor horses in real-time, receive alerts, and manage the platform on the go.
π Technology Stackβ
- Framework: Expo (Managed Workflow)
- Language: TypeScript
- Networking: Custom API Client + React Query
- State Management: React Context Providers (10+ domains)
- Storage: AsyncStorage (Secure tokens)
π Architectureβ
The app mirrors the features of the Frontend but optimized for mobile.
API Clientβ
A strongly-typed API client handles all communication with the backend.
- Auto-Auth: Automatically injects JWT tokens.
- Context Awareness: Handles 401 redirects and session expiry.
- Offline Support: React Query caching.
Providers Systemβ
Business logic is encapsulated in Context Providers:
AuthProvider: Login/Logout session management.CamerasProvider: Real-time camera list and status.CompaniesProvider/SitesProvider: Multi-tenant hierarchy.AlertsProvider: Push notifications management.
π οΈ Developmentβ
Prerequisitesβ
- Node.js
- Expo Go (on your phone) or Android/iOS Simulator
Getting Startedβ
-
Install Dependencies:
cd apps/mobile
npm install -
Start Dev Server:
npx expo startScan the QR code with your phone (Expo Go app).
-
Reset Project (Clean Slate):
npm run reset-project
π± Featuresβ
- Real-time Monitoring: View RTSP streams (via HLS/WebRTC).
- Push Notifications: Immediate alerts for "STRESSED" horses.
- Dashboard: aggregated metrics (Activity/Rest cycles).