Skip to content

EnochJackson/care_loop_v1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

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 services β€” AuthService, 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

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors