Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔄 CareLoop

Bridging the gap between Elders, their Families, and Caretakers

Flutter Firebase AWS Amplify License


📖 Overview

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.


✨ Features

👴 Elder

  • Log daily mood / feelings
  • View and acknowledge medication reminders
  • Trigger emergency SOS alerts (notifies family + caretaker)
  • View personal profile and linked caretaker details

👨‍👩‍👧 Family

  • Real-time dashboard of their elder's health state
  • Browse & hire available caretakers
  • Receive and manage hire requests
  • View health reports and activity history

🧑‍⚕️ Caretaker

  • Professional onboarding with skill declaration
  • Toggle availability for hire
  • Accept / reject hire requests from families
  • View assigned elders and manage care schedules

⚙️ Shared

  • Multi-language support (via LocalizationService)
  • Dark / Light theme toggle
  • Background health monitoring service
  • AES-256 encrypted PII in Firestore (name, email, phone)

🛠️ Tech Stack

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

🏗️ Architecture & Methodology

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 servicesAuthService, EncryptionService, and LocalStorageService are singletons to ensure a single source of truth for session state.

🔒 Security Design

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 (⚠️ Production TODO) The current AES key is hardcoded for development. In production, replace it with Android Keystore / iOS Secure Enclave or a cloud KMS.

✅ Prerequisites

Before you begin, ensure you have the following installed:


🚀 Installation & Setup

1. Clone the Repository

git clone https://github.com/YOUR_USERNAME/care_loop_v1.git
cd care_loop_v1

2. Install Flutter Dependencies

flutter pub get

3. Configure Firebase

  1. Create a Firebase project at console.firebase.google.com
  2. Enable Firestore Database and Cloud Messaging
  3. Register Android (and optionally iOS / Web) apps in your project
  4. Install the FlutterFire CLI:
    dart pub global activate flutterfire_cli
  5. Run configuration from the project root:
    flutterfire configure
    This generates lib/firebase_options.dart and android/app/google-services.json with your real credentials.

4. Configure AWS Amplify (Cognito Auth)

  1. Install the Amplify CLI:

    npm install -g @aws-amplify/cli
    amplify configure
  2. Initialize Amplify in the project:

    amplify init
    amplify add auth
    amplify push

    This generates lib/amplifyconfiguration.dart with your Cognito Pool IDs.

  3. In Cognito, ensure your User Pool is configured with:

    • Username: Email
    • Required attributes: email, phone_number, name
    • Verification: Email OTP

5. Firestore Security Rules

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.

6. Run the App

# Check connected devices
flutter devices

# Run on Android
flutter run

# Run in release mode
flutter run --release

🌐 Environment Variables & Secrets

⚠️ 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

🤝 Contributing

  1. Fork the repo
  2. Create a feature branch: git checkout -b feature/your-feature-name
  3. Commit your changes: git commit -m 'feat: add your feature'
  4. Push to the branch: git push origin feature/your-feature-name
  5. Open a Pull Request

Please make sure you do not commit any credential files (they are blocked by .gitignore).


📄 License

This project is licensed under the MIT License. See the LICENSE file for details.


👤 Author

Enoch Jackson C.
📧 enochjackson441@gmail.com


Made with ❤️ using Flutter

About

Flutter-based elder care app connecting elders, families, and caretakers

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages