# azhanali305/revised_fyp architecture

> Architecture diagram of the GitHub repository azhanali305/revised_fyp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/azhanali305/revised_fyp
- Repository: https://github.com/azhanali305/revised_fyp

## Overview

This is a Flutter application whose tree indicates caregiver and patient experiences, including account access, face scanning, memories, calming resources, routines, and safe-zone guidance. The likely user journey begins at the app entry point, proceeds through sign-in and role-specific screens, and reaches those patient-support features; caregiver screens provide corresponding setup and management. The README does not document product behavior, and no Dart implementation was excerpted, so these subsystem links are dashed and unverified rather than asserted as observed calls. Platform runner details are omitted as hosting scaffolding.

Main entry points: [`lib/screens/patient`](https://github.com/azhanali305/revised_fyp/tree/main/lib/screens/patient) (Patient workflows), [`lib/screens`](https://github.com/azhanali305/revised_fyp/tree/main/lib/screens) (Account screens), [`lib/screens/role_selection_screen.dart`](https://github.com/azhanali305/revised_fyp/blob/main/lib/screens/role_selection_screen.dart) (Role selection), [`lib/screens/caregiver`](https://github.com/azhanali305/revised_fyp/tree/main/lib/screens/caregiver) (Caregiver workflows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry and access"]
  node_app["Flutter app entry<br/>[main.dart]"]
  node_auth_ui["Account screens"]
  node_role_ui["Role selection"]
end

subgraph group_caregiver["Caregiver management"]
  node_caregiver_ui["Caregiver workflows"]
end

subgraph group_patient["Patient support"]
  node_patient_ui["Patient workflows"]
end

subgraph group_services["Shared services"]
  node_auth["Authentication service<br/>[auth_service.dart]"]
  node_face["Face recognition"]
  node_patient_data["Patient data access"]
  node_patient_lookup["Patient lookup"]
  node_routine_notify["Routine notifications"]
  node_safe_location["Safe-zone location"]
  node_safe_background["Safe-zone monitoring"]
  node_safe_notify["Safe-zone notifications"]
  node_guidance["Guidance launcher"]
end

node_user(("User"))
node_firebase[("Firebase")]

node_user -.->|"opens"| node_app
node_app -.->|"shows"| node_auth_ui
node_auth_ui -.->|"authenticates"| node_auth
node_auth -.->|"uses"| node_firebase
node_auth_ui -.->|"continues to"| node_role_ui
node_role_ui -.->|"selects caregiver"| node_caregiver_ui
node_role_ui -.->|"selects patient"| node_patient_ui
node_caregiver_ui -.->|"manages data"| node_patient_data
node_caregiver_ui -.->|"looks up patient"| node_patient_lookup
node_patient_ui -.->|"reads data"| node_patient_data
node_patient_ui -.->|"scans face"| node_face
node_patient_ui -.->|"schedules alerts"| node_routine_notify
node_patient_ui -.->|"checks location"| node_safe_location
node_safe_background -.->|"monitors location"| node_safe_location
node_safe_background -.->|"triggers alerts"| node_safe_notify
node_patient_ui -.->|"opens guidance"| node_guidance

click node_app "https://github.com/azhanali305/revised_fyp/blob/main/lib/main.dart"
click node_auth_ui "https://github.com/azhanali305/revised_fyp/tree/main/lib/screens"
click node_role_ui "https://github.com/azhanali305/revised_fyp/blob/main/lib/screens/role_selection_screen.dart"
click node_auth "https://github.com/azhanali305/revised_fyp/blob/main/lib/firebase_files/auth_service.dart"
click node_caregiver_ui "https://github.com/azhanali305/revised_fyp/tree/main/lib/screens/caregiver"
click node_patient_ui "https://github.com/azhanali305/revised_fyp/tree/main/lib/screens/patient"
click node_face "https://github.com/azhanali305/revised_fyp/blob/main/lib/services/face_recognition_service.dart"
click node_patient_data "https://github.com/azhanali305/revised_fyp/blob/main/lib/services/patient_data_service.dart"
click node_patient_lookup "https://github.com/azhanali305/revised_fyp/blob/main/lib/services/patient_lookup_service.dart"
click node_routine_notify "https://github.com/azhanali305/revised_fyp/blob/main/lib/services/routine_notification_service.dart"
click node_safe_location "https://github.com/azhanali305/revised_fyp/blob/main/lib/services/safe_zone_location_service.dart"
click node_safe_background "https://github.com/azhanali305/revised_fyp/blob/main/lib/services/safe_zone_background_service.dart"
click node_safe_notify "https://github.com/azhanali305/revised_fyp/blob/main/lib/services/safe_zone_notification_service.dart"
click node_guidance "https://github.com/azhanali305/revised_fyp/blob/main/lib/services/guidance_launcher.dart"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_auth_ui,node_role_ui,node_user toneBlue
class node_caregiver_ui,node_firebase toneAmber
class node_patient_ui toneMint
class node_auth,node_face,node_patient_data,node_patient_lookup,node_routine_notify,node_safe_location,node_safe_background,node_safe_notify,node_guidance toneRose
```

## Components

### App entry and access

- [Flutter app entry](https://github.com/azhanali305/revised_fyp/blob/main/lib/main.dart): `lib/main.dart`
- [Account screens](https://github.com/azhanali305/revised_fyp/tree/main/lib/screens): `lib/screens`
- [Role selection](https://github.com/azhanali305/revised_fyp/blob/main/lib/screens/role_selection_screen.dart): `lib/screens/role_selection_screen.dart`

### Caregiver management

- [Caregiver workflows](https://github.com/azhanali305/revised_fyp/tree/main/lib/screens/caregiver): `lib/screens/caregiver`

### Patient support

- [Patient workflows](https://github.com/azhanali305/revised_fyp/tree/main/lib/screens/patient): `lib/screens/patient`

### Shared services

- [Authentication service](https://github.com/azhanali305/revised_fyp/blob/main/lib/firebase_files/auth_service.dart): `lib/firebase_files/auth_service.dart`
- [Face recognition](https://github.com/azhanali305/revised_fyp/blob/main/lib/services/face_recognition_service.dart): `lib/services/face_recognition_service.dart`
- [Patient data access](https://github.com/azhanali305/revised_fyp/blob/main/lib/services/patient_data_service.dart): `lib/services/patient_data_service.dart`
- [Patient lookup](https://github.com/azhanali305/revised_fyp/blob/main/lib/services/patient_lookup_service.dart): `lib/services/patient_lookup_service.dart`
- [Routine notifications](https://github.com/azhanali305/revised_fyp/blob/main/lib/services/routine_notification_service.dart): `lib/services/routine_notification_service.dart`
- [Safe-zone location](https://github.com/azhanali305/revised_fyp/blob/main/lib/services/safe_zone_location_service.dart): `lib/services/safe_zone_location_service.dart`
- [Safe-zone monitoring](https://github.com/azhanali305/revised_fyp/blob/main/lib/services/safe_zone_background_service.dart): `lib/services/safe_zone_background_service.dart`
- [Safe-zone notifications](https://github.com/azhanali305/revised_fyp/blob/main/lib/services/safe_zone_notification_service.dart): `lib/services/safe_zone_notification_service.dart`
- [Guidance launcher](https://github.com/azhanali305/revised_fyp/blob/main/lib/services/guidance_launcher.dart): `lib/services/guidance_launcher.dart`

### Other components

- **User**
- **Firebase**

## Connections

- User → Flutter app entry: opens
- Flutter app entry → Account screens: shows
- Account screens → Authentication service: authenticates
- Authentication service → Firebase: uses
- Account screens → Role selection: continues to
- Role selection → Caregiver workflows: selects caregiver
- Role selection → Patient workflows: selects patient
- Caregiver workflows → Patient data access: manages data
- Caregiver workflows → Patient lookup: looks up patient
- Patient workflows → Patient data access: reads data
- Patient workflows → Face recognition: scans face
- Patient workflows → Routine notifications: schedules alerts
- Patient workflows → Safe-zone location: checks location
- Safe-zone monitoring → Safe-zone location: monitors location
- Safe-zone monitoring → Safe-zone notifications: triggers alerts
- Patient workflows → Guidance launcher: opens guidance
