Skip to main content

πŸ“± 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​

  1. Install Dependencies:

    cd apps/mobile
    npm install
  2. Start Dev Server:

    npx expo start

    Scan the QR code with your phone (Expo Go app).

  3. 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).