# shehatacoder/agesense-app architecture

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

- Interactive diagram: https://gitdiagram.com/shehatacoder/agesense-app
- Repository: https://github.com/shehatacoder/agesense-app

## Overview

Agesense is a Flutter app for on-device age and gender analysis. Its main workflow processes live camera frames through face detection and TFLite prediction, then overlays results; the README also documents gallery analysis and local prediction history. Authentication, appearance, and localization are separate product capabilities. Relationships are based on README descriptions and project structure; Dart implementations were not sampled, so the graph does not assert unverified internal calls.

Main entry points: [`lib/camera_analysis_screen.dart`](https://github.com/shehatacoder/agesense-app/blob/main/lib/camera_analysis_screen.dart) (Live camera analysis), [`lib/core/image_isolate_processor.dart`](https://github.com/shehatacoder/agesense-app/blob/main/lib/core/image_isolate_processor.dart) (Image processing), [`lib/home_screen.dart`](https://github.com/shehatacoder/agesense-app/blob/main/lib/home_screen.dart) (Home navigation), [`lib/analysis_details_screen.dart`](https://github.com/shehatacoder/agesense-app/blob/main/lib/analysis_details_screen.dart) (Gallery analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Face analysis"]
  node_camera["Live camera analysis"]
  node_camera_feed["Camera stream"]
  node_face_detection["Face detection"]
  node_image_processing["Image processing"]
  node_age_model["Age model<br/>[age_model.tflite]"]
  node_gender_model["Gender model"]
  node_face_overlay["Prediction overlay<br/>[face_painter.dart]"]
  node_gallery_analysis["Gallery analysis"]
end

subgraph group_experience["App experience"]
  node_home["Home navigation<br/>[home_screen.dart]"]
  node_app_entry["App startup<br/>[main.dart]"]
end

subgraph group_persistence["History storage"]
  node_history_screen["History browser"]
  node_history_provider["History state"]
  node_database[("Prediction database")]
end

subgraph group_identity["Identity and preferences"]
  node_authentication["Authentication<br/>[auth_service.dart]"]
  node_firebase_auth["Firebase Auth"]
  node_settings["Theme and locale"]
end

node_user(("User"))

node_user -->|"starts analysis"| node_camera
node_camera -->|"streams frames"| node_camera_feed
node_camera -->|"detects faces"| node_face_detection
node_face_detection -->|"provides face regions"| node_image_processing
node_image_processing -->|"runs inference"| node_age_model
node_image_processing -->|"runs inference"| node_gender_model
node_camera -->|"renders predictions"| node_face_overlay
node_user -->|"selects image"| node_gallery_analysis
node_gallery_analysis -->|"analyzes image"| node_image_processing
node_home -.->|"opens analysis"| node_camera
node_home -.->|"opens history"| node_history_screen
node_history_screen -.->|"browses predictions"| node_history_provider
node_history_provider -->|"persists history"| node_database
node_user -->|"signs in"| node_authentication
node_authentication -->|"authenticates with"| node_firebase_auth
node_user -->|"changes preferences"| node_settings
node_app_entry -.->|"opens app"| node_home

click node_camera "https://github.com/shehatacoder/agesense-app/blob/main/lib/camera_analysis_screen.dart"
click node_image_processing "https://github.com/shehatacoder/agesense-app/blob/main/lib/core/image_isolate_processor.dart"
click node_age_model "https://github.com/shehatacoder/agesense-app/blob/main/assets/age_model.tflite"
click node_gender_model "https://github.com/shehatacoder/agesense-app/blob/main/assets/gender_model.tflite"
click node_face_overlay "https://github.com/shehatacoder/agesense-app/blob/main/lib/face_painter.dart"
click node_gallery_analysis "https://github.com/shehatacoder/agesense-app/blob/main/lib/analysis_details_screen.dart"
click node_home "https://github.com/shehatacoder/agesense-app/blob/main/lib/home_screen.dart"
click node_history_screen "https://github.com/shehatacoder/agesense-app/blob/main/lib/history_screen.dart"
click node_history_provider "https://github.com/shehatacoder/agesense-app/blob/main/lib/providers/history_provider.dart"
click node_database "https://github.com/shehatacoder/agesense-app/blob/main/lib/core/database_helper.dart"
click node_authentication "https://github.com/shehatacoder/agesense-app/blob/main/lib/services/auth_service.dart"
click node_settings "https://github.com/shehatacoder/agesense-app/tree/main/lib/settings"
click node_app_entry "https://github.com/shehatacoder/agesense-app/blob/main/lib/main.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_camera,node_camera_feed,node_face_detection,node_image_processing,node_age_model,node_gender_model,node_face_overlay,node_gallery_analysis,node_user toneBlue
class node_home,node_app_entry toneAmber
class node_history_screen,node_history_provider,node_database toneMint
class node_authentication,node_firebase_auth,node_settings toneRose
```

## Components

### Face analysis

- [Live camera analysis](https://github.com/shehatacoder/agesense-app/blob/main/lib/camera_analysis_screen.dart): `lib/camera_analysis_screen.dart`
- **Camera stream**
- **Face detection**
- [Image processing](https://github.com/shehatacoder/agesense-app/blob/main/lib/core/image_isolate_processor.dart): `lib/core/image_isolate_processor.dart`
- [Age model](https://github.com/shehatacoder/agesense-app/blob/main/assets/age_model.tflite): `assets/age_model.tflite`
- [Gender model](https://github.com/shehatacoder/agesense-app/blob/main/assets/gender_model.tflite): `assets/gender_model.tflite`
- [Prediction overlay](https://github.com/shehatacoder/agesense-app/blob/main/lib/face_painter.dart): `lib/face_painter.dart`
- [Gallery analysis](https://github.com/shehatacoder/agesense-app/blob/main/lib/analysis_details_screen.dart): `lib/analysis_details_screen.dart`

### App experience

- [Home navigation](https://github.com/shehatacoder/agesense-app/blob/main/lib/home_screen.dart): `lib/home_screen.dart`
- [App startup](https://github.com/shehatacoder/agesense-app/blob/main/lib/main.dart): `lib/main.dart`

### History storage

- [History browser](https://github.com/shehatacoder/agesense-app/blob/main/lib/history_screen.dart): `lib/history_screen.dart`
- [History state](https://github.com/shehatacoder/agesense-app/blob/main/lib/providers/history_provider.dart): `lib/providers/history_provider.dart`
- [Prediction database](https://github.com/shehatacoder/agesense-app/blob/main/lib/core/database_helper.dart): `lib/core/database_helper.dart`

### Identity and preferences

- [Authentication](https://github.com/shehatacoder/agesense-app/blob/main/lib/services/auth_service.dart): `lib/services/auth_service.dart`
- **Firebase Auth**
- [Theme and locale](https://github.com/shehatacoder/agesense-app/tree/main/lib/settings): `lib/settings`

### Other components

- **User**

## Connections

- User → Live camera analysis: starts analysis (evidence: `README.md`)
- Live camera analysis → Camera stream: streams frames (evidence: `README.md`)
- Live camera analysis → Face detection: detects faces (evidence: `README.md`)
- Face detection → Image processing: provides face regions (evidence: `README.md`)
- Image processing → Age model: runs inference (evidence: `README.md`)
- Image processing → Gender model: runs inference (evidence: `README.md`)
- Live camera analysis → Prediction overlay: renders predictions (evidence: `README.md`)
- User → Gallery analysis: selects image (evidence: `README.md`)
- Gallery analysis → Image processing: analyzes image (evidence: `README.md`)
- Home navigation → Live camera analysis: opens analysis
- Home navigation → History browser: opens history
- History browser → History state: browses predictions
- History state → Prediction database: persists history (evidence: `README.md`)
- User → Authentication: signs in (evidence: `README.md`)
- Authentication → Firebase Auth: authenticates with (evidence: `README.md`)
- User → Theme and locale: changes preferences (evidence: `README.md`)
- App startup → Home navigation: opens app
