Aarini is a cross-platform mobile application built to provide health insights, cycle tracking, and ML-powered predictions. The system is split between a React Native (Expo) frontend and a Python-based backend handling the predictive logic, all bound together by Firebase for real-time data synchronization.
The architecture is divided into three primary tiers:
- Client / Frontend (
frontend/): An Expo React Native application providing the user interface, state management, and device integration. - Backend API (
backend/): A Python-based service responsible for machine learning algorithms, cycle predictions, and data analysis. - Database & Auth (Firebase): Firestore provides real-time NoSQL data storage (governed by
firestore.rules), while Firebase Authentication secures user sessions.
graph TD
User[End User (Mobile)]
subgraph Frontend Application
Expo[React Native / Expo App]
Context[React Context / State]
Screens[UI Screens & Components]
Services[API Services / Hooks]
end
subgraph Backend Services
Python[Python API]
ML[Cycle Prediction Engine]
end
subgraph Firebase Infrastructure
Auth[Firebase Authentication]
Firestore[Cloud Firestore DB]
end
User -->|Interacts| Screens
Screens -->|Dispatches| Context
Context -->|Uses| Services
Services -->|Authenticates| Auth
Services -->|Reads/Writes| Firestore
Services -->|Fetches Predictions| Python
Python -->|Queries History| Firestore
Python -->|Runs Models| ML
assets/: Static images and fonts.components/: Reusable UI components.screens/: Full-page views for navigation.context/: Global state management (Auth, Theme).services/: API wrappers and Firebase interactions.utils/: Helper functions and parsers.navigation/: React Navigation configurations.
app.py: Main application entry point for the REST API.cycle_prediction.py: Core algorithm for predicting cycles.tests/: Unit tests for backend logic.
- User Input: A user logs a new symptom on the mobile app.
- Frontend Service: The
frontend/serviceslayer packages this data and sends it securely to Firebase Firestore. - Backend Trigger: When the user requests a new prediction, the Python backend queries the recent data from Firestore.
- Processing:
cycle_prediction.pyprocesses the historical data. - Response: The backend returns the predicted dates to the frontend, which updates the React Context and re-renders the UI.
- Frontend: Distributed via Expo Application Services (EAS).
- Backend: Containerized/Deployed via standard PaaS providers (e.g. Render, Vercel, Heroku) as defined by
render.yaml. - Database: Serverless deployment on Google Cloud via Firebase.