# mamun657/amarguard architecture

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

- Interactive diagram: https://gitdiagram.com/mamun657/amarguard
- Repository: https://github.com/mamun657/amarguard

## Overview

AmarGuard is a Flutter digital-safety companion intended to help users assess suspicious calls, messages, links, screenshots, and audio, with explanations and next-step guidance. The README documents these analysis capabilities, account and guest access, family safety, and English/Bangla support; the supplied source excerpts do not show their analysis implementation or connect the Flutter screens to services, so those edges are documented product flows rather than verified code calls. The Windows host relationships are supported by excerpts; other platform and application wiring was not sampled.

Main entry points: [`lib/features/home`](https://github.com/mamun657/amarguard/tree/main/lib/features/home) (Risk explanation), [`lib/features/auth`](https://github.com/mamun657/amarguard/tree/main/lib/features/auth) (Authentication), [`windows/runner/flutter_window.cpp`](https://github.com/mamun657/amarguard/blob/main/windows/runner/flutter_window.cpp) (Flutter window), [`lib/features/home/home_screen.dart`](https://github.com/mamun657/amarguard/blob/main/lib/features/home/home_screen.dart) (Safety home)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_home["Safety home<br/>[home_screen.dart]"]
  node_dashboard["Dashboard"]
  node_onboarding["Onboarding"]
end

subgraph group_safety["Safety analysis"]
  node_call["Call analysis"]
  node_message["Message analysis"]
  node_link["Link checks"]
  node_screenshot["Screenshot scan"]
  node_audio["Audio analysis"]
  node_risk["Risk explanation"]
  node_family["Family safety"]
end

subgraph group_account["Identity and preferences"]
  node_auth["Authentication"]
  node_guest["Guest access"]
  node_locale["Language preference"]
  node_preferences["Local preferences<br/>[local_prefs.dart]"]
  node_firebase_auth["Firebase authentication<br/>[auth_service.dart]"]
end

subgraph group_platform["Platform host"]
  node_windows_entry["Windows entry<br/>[main.cpp]"]
  node_flutter_window["Flutter window<br/>[flutter_window.cpp]"]
  node_win32_window["Win32 window<br/>[win32_window.cpp]"]
  node_plugin_registration["Plugin registration"]
end

node_user(("User"))

node_user -->|"signs in"| node_auth
node_user -->|"uses guest mode"| node_guest
node_auth -->|"accesses app"| node_home
node_guest -->|"accesses app"| node_home
node_user -.->|"starts app"| node_onboarding
node_home -.->|"opens dashboard"| node_dashboard
node_user -->|"provides audio"| node_call
node_user -->|"submits message"| node_message
node_user -->|"submits URL"| node_link
node_user -->|"provides screenshot"| node_screenshot
node_user -->|"provides audio"| node_audio
node_call -.->|"assesses interaction"| node_risk
node_message -.->|"assesses interaction"| node_risk
node_link -.->|"assesses interaction"| node_risk
node_screenshot -.->|"extracts context"| node_risk
node_audio -.->|"extracts context"| node_risk
node_risk -->|"explains signals"| node_user
node_user -->|"uses family safety"| node_family
node_user -->|"selects language"| node_locale
node_locale -.->|"persists choice"| node_preferences
node_auth -->|"authenticates with"| node_firebase_auth
node_windows_entry -->|"creates window"| node_flutter_window
node_flutter_window -->|"inherits window"| node_win32_window
node_flutter_window -->|"registers plugins"| node_plugin_registration

click node_auth "https://github.com/mamun657/amarguard/tree/main/lib/features/auth"
click node_guest "https://github.com/mamun657/amarguard/tree/main/lib/features/home"
click node_home "https://github.com/mamun657/amarguard/blob/main/lib/features/home/home_screen.dart"
click node_dashboard "https://github.com/mamun657/amarguard/blob/main/lib/features/home/dashboard_screen.dart"
click node_onboarding "https://github.com/mamun657/amarguard/blob/main/lib/features/onboarding/onboarding_screen.dart"
click node_call "https://github.com/mamun657/amarguard/tree/main/lib/features/home"
click node_message "https://github.com/mamun657/amarguard/tree/main/lib/features/home"
click node_link "https://github.com/mamun657/amarguard/tree/main/lib/features/home"
click node_screenshot "https://github.com/mamun657/amarguard/tree/main/lib/features/home"
click node_audio "https://github.com/mamun657/amarguard/tree/main/lib/features/home"
click node_risk "https://github.com/mamun657/amarguard/tree/main/lib/features/home"
click node_family "https://github.com/mamun657/amarguard/tree/main/lib/features/home"
click node_locale "https://github.com/mamun657/amarguard/blob/main/lib/core/locale/locale_controller.dart"
click node_preferences "https://github.com/mamun657/amarguard/blob/main/lib/data/services/local_prefs.dart"
click node_firebase_auth "https://github.com/mamun657/amarguard/blob/main/lib/data/services/auth_service.dart"
click node_windows_entry "https://github.com/mamun657/amarguard/blob/main/windows/runner/main.cpp"
click node_flutter_window "https://github.com/mamun657/amarguard/blob/main/windows/runner/flutter_window.cpp"
click node_win32_window "https://github.com/mamun657/amarguard/blob/main/windows/runner/win32_window.cpp"
click node_plugin_registration "https://github.com/mamun657/amarguard/blob/main/windows/flutter/generated_plugin_registrant.cc"

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_home,node_dashboard,node_onboarding,node_user toneBlue
class node_call,node_message,node_link,node_screenshot,node_audio,node_risk,node_family toneAmber
class node_auth,node_guest,node_locale,node_preferences,node_firebase_auth toneMint
class node_windows_entry,node_flutter_window,node_win32_window,node_plugin_registration toneRose
```

## Components

### App experience

- [Safety home](https://github.com/mamun657/amarguard/blob/main/lib/features/home/home_screen.dart): `lib/features/home/home_screen.dart`
- [Dashboard](https://github.com/mamun657/amarguard/blob/main/lib/features/home/dashboard_screen.dart): `lib/features/home/dashboard_screen.dart`
- [Onboarding](https://github.com/mamun657/amarguard/blob/main/lib/features/onboarding/onboarding_screen.dart): `lib/features/onboarding/onboarding_screen.dart`

### Safety analysis

- [Call analysis](https://github.com/mamun657/amarguard/tree/main/lib/features/home): `lib/features/home`
- [Message analysis](https://github.com/mamun657/amarguard/tree/main/lib/features/home): `lib/features/home`
- [Link checks](https://github.com/mamun657/amarguard/tree/main/lib/features/home): `lib/features/home`
- [Screenshot scan](https://github.com/mamun657/amarguard/tree/main/lib/features/home): `lib/features/home`
- [Audio analysis](https://github.com/mamun657/amarguard/tree/main/lib/features/home): `lib/features/home`
- [Risk explanation](https://github.com/mamun657/amarguard/tree/main/lib/features/home): `lib/features/home`
- [Family safety](https://github.com/mamun657/amarguard/tree/main/lib/features/home): `lib/features/home`

### Identity and preferences

- [Authentication](https://github.com/mamun657/amarguard/tree/main/lib/features/auth): `lib/features/auth`
- [Guest access](https://github.com/mamun657/amarguard/tree/main/lib/features/home): `lib/features/home`
- [Language preference](https://github.com/mamun657/amarguard/blob/main/lib/core/locale/locale_controller.dart): `lib/core/locale/locale_controller.dart`
- [Local preferences](https://github.com/mamun657/amarguard/blob/main/lib/data/services/local_prefs.dart): `lib/data/services/local_prefs.dart`
- [Firebase authentication](https://github.com/mamun657/amarguard/blob/main/lib/data/services/auth_service.dart): `lib/data/services/auth_service.dart`

### Platform host

- [Windows entry](https://github.com/mamun657/amarguard/blob/main/windows/runner/main.cpp): `windows/runner/main.cpp`
- [Flutter window](https://github.com/mamun657/amarguard/blob/main/windows/runner/flutter_window.cpp): `windows/runner/flutter_window.cpp`
- [Win32 window](https://github.com/mamun657/amarguard/blob/main/windows/runner/win32_window.cpp): `windows/runner/win32_window.cpp`
- [Plugin registration](https://github.com/mamun657/amarguard/blob/main/windows/flutter/generated_plugin_registrant.cc): `windows/flutter/generated_plugin_registrant.cc`

### Other components

- **User**

## Connections

- User → Authentication: signs in (evidence: `README.md`)
- User → Guest access: uses guest mode (evidence: `README.md`)
- Authentication → Safety home: accesses app (evidence: `README.md`)
- Guest access → Safety home: accesses app (evidence: `README.md`)
- User → Onboarding: starts app
- Safety home → Dashboard: opens dashboard
- User → Call analysis: provides audio (evidence: `README.md`)
- User → Message analysis: submits message (evidence: `README.md`)
- User → Link checks: submits URL (evidence: `README.md`)
- User → Screenshot scan: provides screenshot (evidence: `README.md`)
- User → Audio analysis: provides audio (evidence: `README.md`)
- Call analysis → Risk explanation: assesses interaction (evidence: `README.md`)
- Message analysis → Risk explanation: assesses interaction (evidence: `README.md`)
- Link checks → Risk explanation: assesses interaction (evidence: `README.md`)
- Screenshot scan → Risk explanation: extracts context (evidence: `README.md`)
- Audio analysis → Risk explanation: extracts context (evidence: `README.md`)
- Risk explanation → User: explains signals (evidence: `README.md`)
- User → Family safety: uses family safety (evidence: `README.md`)
- User → Language preference: selects language (evidence: `README.md`)
- Language preference → Local preferences: persists choice
- Authentication → Firebase authentication: authenticates with (evidence: `README.md`)
- Windows entry → Flutter window: creates window (evidence: `windows/runner/main.cpp`)
- Flutter window → Win32 window: inherits window
- Flutter window → Plugin registration: registers plugins (evidence: `windows/runner/flutter_window.cpp`)
