CareBridge is a Flutter Android MVP for post-discharge recovery management. It helps patients and family carers turn discharge instructions into daily tasks, local reminders, symptom logs, and a read-only family overview.
Important: CareBridge is a logging and reminder tool only. It does not provide medical advice, diagnosis, or treatment recommendations.
- Onboarding: splash, legal disclaimer, email sign-in / sign-up
- Patient profiles: create, edit, switch patients; recovery day on dashboard
- Tasks: medication, visit, rehab, and note types; CRUD, repeat rules, assignee, mark complete; pending / completed views
- OCR import: scan discharge documents (camera or gallery); review and edit extracted lines before creating tasks (never auto-saved)
- Symptoms: daily pain (0–10), temperature, notes, photos; 7-day trend chart; recovery timeline
- Family hub: read-only summary of progress, responsibilities, and latest log
- Settings: large text, notification toggle, local notification self-test, sign out
Presentation (screens.dart, app_router.dart)
↓
CareStore (Provider / ChangeNotifier)
↓
CareRepository Integration ports
├─ FirebaseCareRepository ├─ OcrPort → MlKitOcrPort
└─ DemoCareRepository (fallback) ├─ NotificationPort → LocalNotificationPort
└─ StoragePort → FirebaseStoragePort | LocalStoragePort
Startup (lib/main.dart):
- Initialize
LocalNotificationPortbeforerunApp. _initializeBackend()triesFirebase.initializeAppwithDefaultFirebaseOptions.currentPlatform.- On success:
FirebaseCareRepository+FirebaseStoragePort. - On failure:
DemoCareRepository(seeded in-memory data) +LocalStoragePort(local photo paths). - Inject
MlKitOcrPort, notification port, and storage port intoCareStore, thenload().
UI code calls CareStore only—not Firebase or ML Kit plugins directly.
| Area | Status |
|---|---|
| UI, navigation, state | Complete |
| Firebase Auth, Firestore, Storage | Implemented (firebase_care_repository.dart) |
| Demo fallback backend | Implemented when Firebase init fails |
| ML Kit OCR (Latin), mandatory review | Implemented |
| Local task notifications | Implemented |
7-day symptom chart (fl_chart) |
Implemented |
| Symptom / discharge photos | Implemented (image_picker + StoragePort) |
Known limitations (see also docs/requirements_trace.md):
- Firestore / Storage security rules are not committed in this repo; apply equivalent rules in the Firebase Console for shared testing.
- OCR uses Latin script only; Chinese or handwritten discharge sheets need manual editing on the review screen.
- Legal disclaimer acceptance is not persisted across app restarts.
- Task status missed appears in UI/filters and demo seed data only; users cannot mark a task as missed in the app.
- Family multi-account invite is limited in UI; Firestore
sharedWithmodel is ready on the backend side.
- Flutter
3.41.xand Dart3.11.x(recommended dev environment;pubspec.yamlallows Dart>=3.4.0 <4.0.0) - Android package
hk.hku.carebridge - State:
provider - Backend:
firebase_core,firebase_auth,cloud_firestore,firebase_storage - Native:
google_mlkit_text_recognition,flutter_local_notifications,timezone,fl_chart,image_picker,uuid
git clone https://github.com/Edgardcai/carebridge.git
cd carebridge
flutter pub get
flutter run- With valid Firebase config (committed
lib/firebase_options.dartfor projectcarebridge7506), the app uses the cloud backend. - If initialization fails, the app falls back to demo mode automatically
(check debug console for
CareBridge backend:messages).
List devices and pick one:
flutter devices
flutter run -d <device-id>Quality checks:
flutter analyze
flutter testOn Windows, if the debug service cannot attach through a proxy:
$env:NO_PROXY = "localhost,127.0.0.1,::1"Android application id:
hk.hku.carebridge
To reconfigure or use your own project:
dart pub global activate flutterfire_cli
flutterfire configure --project=<your-project-id> --platforms=androidFor this coursework repo:
flutterfire configure --project=carebridge7506 --platforms=androidIn Firebase Console, enable:
- Authentication — Email/Password
- Firestore — database + security rules (see
docs/backend_integration.md) - Storage — for cloud photo URLs (optional; app keeps local paths on failure)
Config files:
| File | Notes |
|---|---|
lib/firebase_options.dart |
FlutterFire Android options (committed) |
android/app/google-services.json |
Local only; gitignored |
firebase.json |
FlutterFire project mapping (committed) |
Debug:
flutter build apk --debug
# build/app/outputs/flutter-apk/app-debug.apkRelease (coursework/demo signing, not Play Store ready):
flutter build apk --release
# build/app/outputs/flutter-apk/app-release.apkInstall on a connected device:
flutter install -d <device-id>lib/
main.dart # Backend bootstrap, CareStore wiring
app.dart # MaterialApp, theme, routes
firebase_options.dart
core/routing/app_router.dart
core/theme/app_theme.dart
features/care/
application/care_store.dart
data/care_repository.dart
data/demo_care_repository.dart
data/firebase_care_repository.dart
domain/models.dart
integrations/
integration_ports.dart
firebase_storage_port.dart
local_storage_port.dart
mlkit_ocr_port.dart
local_notification_port.dart
presentation/screens.dart
docs/
requirements_trace.md # Requirement ↔ implementation matrix
backend_integration.md # Firestore, Storage, fallback behaviour
native_integration.md # OCR, notifications, chart, device testing
scripts/
seed_demo_account.mjs # Optional Firebase demo data seed (Node)
android/ # Manifest, permissions, notification receivers
test/widget_test.dart # Splash smoke test
Create a local Submission/ folder at the repo root for coursework upload to
Moodle. Do not commit this folder — it is listed in .gitignore.
| File | Purpose |
|---|---|
DocumentFile.pdf |
Final project report |
IntroductoryVideo.mp4 |
App introduction video |
Peer_Review.docs |
Peer review form |
Keep these files on your machine only; submit them through Moodle, not via this repository.
signInDemo,signOutsavePatient,selectPatientsaveTask,deleteTask,markTaskStatussaveSymptomLogscanOcrCandidatesFromImage,createTasksFromOcrsetLargeText,setNotificationsEnabled
Repository contract: lib/features/care/data/care_repository.dart (implemented
for both Firebase and demo backends).
Permissions in android/app/src/main/AndroidManifest.xml:
CAMERA,POST_NOTIFICATIONS,SCHEDULE_EXACT_ALARM,READ_MEDIA_IMAGES,RECEIVE_BOOT_COMPLETED
Scheduled notifications also require Flutter Local Notifications receivers
(already registered). If timed reminders fail but instant test notifications
work, see the Troubleshooting section in docs/native_integration.md.
git clone https://github.com/Edgardcai/carebridge.git
cd carebridge
git switch main
flutter pub get
flutter analyze
flutter testUse feature branches, run flutter analyze / flutter test before push, and
open PRs to main.
Do not commit:
Submission/
android/app/google-services.json
build/
.dart_tool/
.idea/
*.iml
If the Android folder is missing after clone:
flutter create --platforms=android .Keep existing lib/, pubspec.yaml, README.md, and docs/ when prompted.
| Document | Purpose |
|---|---|
docs/requirements_trace.md |
MVP requirements mapped to code |
docs/backend_integration.md |
Firebase schema, bootstrap, verification |
docs/native_integration.md |
OCR, notifications, chart, photos, device testing |
Moodle deliverables (DocumentFile.pdf, IntroductoryVideo.mp4,
Peer_Review.docs) live in a local Submission/ folder — see
Moodle submission above.
Splash → Legal disclaimer → Auth → Patient (if none) → Home
Bottom nav: Home | Tasks | Log | Family
Home → Scan doc → OCR review → Create tasks
Log → symptom entry, 7-day chart → Timeline
Settings (Home or Log): notifications, large text, sign out
For requirement-level notes (e.g. missed tasks, legal persistence), see
docs/requirements_trace.md.