How chalindu19/novalith works
Project type and purpose
• This is a full-stack IoT healthcare application (“Smart Pregnancy Belly Wrap”) combining:
• Hardware firmware (Arduino/INO sketches for various sensors)
• Machine-learning model development and inference
• A cloud/mobile application (Flutter + Firebase)
• A marketing website (React/Vite/Tailwind)
• Purpose: capture maternal/fetal vital signs, transmit them, store and analyze data, and present insights to caregivers.
Top-level architecture components
a. Hardware layer (“Device”)
• Multiple Arduino sketches under Hardware/… (.ino files for blood-pressure, ECG, temperature, fetal movement, heart rate)
• Each sensor board packages raw signals into digital data.
• Connectivity: Bluetooth Low Energy (BLE) and/or Wi-Fi modules relay data to gateway.
b. Mobile/Gateway layer
• Flutter app (Software/novalith/lib + pubspec.yaml, android/ios directories)
• Firebase integration (firebase_options.dart, JSON admin SDK in ML directory)
• Responsibilities:
• Device pairing (BLE API)
• Data ingestion into Firestore/Realtime Database
• User authentication (AuthController.dart)
• Real-time charts (custom_ecg_chart, graph_view)
• Chat interface for caregiver-patient communication
c. Cloud backend
• Firebase services:
• Authentication
• Firestore (Chat, LoggedUser, MessageRequest collections)
• Storage (optionally for raw data, audio recordings in chat)
• Functions (not shown but implied by models/infrastructure)
• ML inference service
• Offline training notebooks (Machine Learning/ML/*.ipynb, Updated_ML/*.ipynb)
• Trained models (best_fetal_model.pkl, best_fetal_model_updated.pkl)
• Inference pipeline (inference_updated.ipynb or deploy as cloud function or local service)
d. Machine-learning training pipeline (offline)
• Jupyter notebooks process fetal_data.csv → train fetal model → export .pkl
• Optionally hosted on a server or Google Colab
e. Public marketing website
• React + TypeScript + Vite project under Marketing Website/
• Static hosting on Netlify/Vercel or Firebase Hosting
Data flows & interactions
1. Sensor boards collect biometric signals → MCU packages measurements.
2. MCU → BLE/Wi-Fi → Flutter app on mother’s phone.
3. Flutter app → Firebase Auth → Firestore writes sensor readings.
4. Cloud triggers ML inference (could be Firebase Function or app-embedded interpreter)
→ inference results (risk alerts, patterns) → store back in Firestore.
5. Flutter app → listens for updates via Firestore listeners → UI charts/alerts.
6. Optional: Chat requests → Firestore → caregiver app.
Architectural patterns & design principles
• Layered architecture: Device → Gateway → Cloud → Client UI
• Pub/Sub for real-time updates (Firestore listeners)
• MVC/MVVM style in Flutter (Controllers under lib/Controllers, Views under lib/views)
• Microservices / Functions for ML inference (decoupled training vs. inference)
• Componentized frontend on marketing site (atomic UI elements under src/components/ui)
Final checklist
• Security/auth flows (Auth → token → Firestore)
• Key architectures (hardware, mobile, cloud, ML, web) are represented