CareLoop is a cross-platform Flutter mobile application designed to improve the quality of care for elderly individuals by seamlessly connecting three stakeholders:
- π΄ Elders β Receive care, log feelings, track medications, and send emergency alerts.
- π¨βπ©βπ§ Family Members β Monitor their elder's health, hire caretakers, and receive real-time alerts.
- π§ββοΈ Caretakers β Onboard professionally, get assigned to elders, and manage daily care duties.
CareLoop brings together authentication, real-time data sync, encrypted personal data, and local notifications under a single, role-aware mobile application.
- Log daily mood / feelings
- View and acknowledge medication reminders
- Trigger emergency SOS alerts (notifies family + caretaker)
- View personal profile and linked caretaker details
- Real-time dashboard of their elder's health state
- Browse & hire available caretakers
- Receive and manage hire requests
- View health reports and activity history
- Professional onboarding with skill declaration
- Toggle availability for hire
- Accept / reject hire requests from families
- View assigned elders and manage care schedules
- Multi-language support (via
LocalizationService) - Dark / Light theme toggle
- Background health monitoring service
- AES-256 encrypted PII in Firestore (name, email, phone)
| Layer | Technology |
|---|---|
| Framework | Flutter 3.x (Dart) |
| Auth & Identity | AWS Amplify + Amazon Cognito (email + OTP flow) |
| Database | Firebase Firestore (real-time, NoSQL) |
| Notifications | Firebase Cloud Messaging (FCM) + flutter_local_notifications |
| Encryption | AES-256 via the encrypt Dart package |
| Background Service | flutter_background_service |
| State Management | ValueNotifier + StatefulWidget |
| Local Storage | shared_preferences |
| Charts | fl_chart |
| Theming | Custom ThemeNotifier + Material 3 |
CareLoop follows a layered service architecture:
lib/
βββ main.dart # App entry point, Firebase & Amplify init
βββ firebase_options.dart # Firebase platform config (β οΈ template only β see Setup)
βββ amplifyconfiguration.dart # AWS Amplify config (β οΈ template only β see Setup)
β
βββ config/ # Theme, colors, text styles
βββ models/ # Data models (User, Elder, AuthResult, β¦)
βββ services/ # Business logic & platform integrations
β βββ auth_service.dart # Cognito auth + Firestore user profiles
β βββ encryption_service.dart# AES-256 PII encryption / decryption
β βββ emergency_service.dart # SOS alert broadcasts
β βββ medication_service.dart# Medication CRUD
β βββ background_monitor_service.dart # Background health checks
β βββ localization_service.dart # Multi-language strings
βββ data/ # Local storage helpers & seed data
βββ screens/ # UI screens grouped by role
β βββ onboarding/ # Language selection, login, register
β βββ elder/ # Elder home, medications, notifications
β βββ family/ # Family home, reports, hire caretaker
β βββ caretaker/ # Caretaker home, profile, elder detail
β βββ settings/ # App settings
β βββ shared/ # Emergency alert (all roles)
βββ widgets/ # Reusable UI components
Key design decisions:
- Role-based navigation β On login, the app routes to the correct home screen (
elder/family/caretaker) based on the verified Firestore role, not the self-selected UI role, preventing privilege escalation. - Separation of concerns β All Firebase and AWS calls are encapsulated in
services/, keeping screens stateless and testable. - Singleton services β
AuthService,EncryptionService, andLocalStorageServiceare singletons to ensure a single source of truth for session state.
| Concern | Implementation |
|---|---|
| Authentication | AWS Cognito with email + OTP verification. Sessions managed by Amplify SDK. |
| Role enforcement | Role validation happens server-side (from Firestore) at login β not from client input. |
| PII encryption | Name, email, and phone stored in Firestore are encrypted with AES-256 before write and decrypted only on an authenticated client. |
| No secrets in code | firebase_options.dart and amplifyconfiguration.dart are template files excluded via .gitignore. Real credentials must be generated locally. |
| Key management ( |
The current AES key is hardcoded for development. In production, replace it with Android Keystore / iOS Secure Enclave or a cloud KMS. |
Before you begin, ensure you have the following installed:
- Flutter SDK β₯ 3.0
- Dart SDK β₯ 3.0
- Android Studio or VS Code with Flutter extension
- A Firebase project with Firestore and FCM enabled
- An AWS account with Amplify + Cognito configured
- Node.js (for Amplify CLI)
git clone https://github.com/YOUR_USERNAME/care_loop_v1.git
cd care_loop_v1flutter pub get- Create a Firebase project at console.firebase.google.com
- Enable Firestore Database and Cloud Messaging
- Register Android (and optionally iOS / Web) apps in your project
- Install the FlutterFire CLI:
dart pub global activate flutterfire_cli
- Run configuration from the project root:
This generates
flutterfire configure
lib/firebase_options.dartandandroid/app/google-services.jsonwith your real credentials.
-
Install the Amplify CLI:
npm install -g @aws-amplify/cli amplify configure
-
Initialize Amplify in the project:
amplify init amplify add auth amplify push
This generates
lib/amplifyconfiguration.dartwith your Cognito Pool IDs. -
In Cognito, ensure your User Pool is configured with:
- Username: Email
- Required attributes:
email,phone_number,name - Verification: Email OTP
Set up the following basic Firestore rules in your Firebase Console:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow read, write: if request.auth != null;
}
match /elders/{elderId} {
allow read, write: if request.auth != null;
}
match /caretakers/{caretakerId} {
allow read, write: if request.auth != null;
}
match /hire_requests/{requestId} {
allow read, write: if request.auth != null;
}
match /active_assignments/{assignmentId} {
allow read, write: if request.auth != null;
}
}
}
Tip: Tighten these rules per role in production.
# Check connected devices
flutter devices
# Run on Android
flutter run
# Run in release mode
flutter run --release
β οΈ Never commit real credentials to version control.
The following files are excluded from Git and must be generated locally:
| File | How to generate |
|---|---|
lib/firebase_options.dart |
flutterfire configure |
firebase.json |
flutterfire configure |
android/app/google-services.json |
flutterfire configure |
ios/Runner/GoogleService-Info.plist |
flutterfire configure |
lib/amplifyconfiguration.dart |
amplify push |
- Fork the repo
- Create a feature branch:
git checkout -b feature/your-feature-name - Commit your changes:
git commit -m 'feat: add your feature' - Push to the branch:
git push origin feature/your-feature-name - Open a Pull Request
Please make sure you do not commit any credential files (they are blocked by .gitignore).
This project is licensed under the MIT License. See the LICENSE file for details.
Enoch Jackson C.
π§ enochjackson441@gmail.com