# frezzie-cats/capstone_mobile_app architecture

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

- Interactive diagram: https://gitdiagram.com/frezzie-cats/capstone_mobile_app
- Repository: https://github.com/frezzie-cats/capstone_mobile_app

## Overview

The tree suggests a Flutter mobile app with a camera screen, on-device TensorFlow Lite inference, result display, and a database helper. The README is only the default Flutter-project introduction, and no application source was excerpted, so the workflow and component relationships below are inferred from filenames; dashed edges mark those unverified links.

Main entry points: [`lib/services/tflite_service.dart`](https://github.com/frezzie-cats/capstone_mobile_app/blob/main/lib/services/tflite_service.dart) (TFLite service), [`lib/main.dart`](https://github.com/frezzie-cats/capstone_mobile_app/blob/main/lib/main.dart) (App entry), [`lib/screens/camera_screen.dart`](https://github.com/frezzie-cats/capstone_mobile_app/blob/main/lib/screens/camera_screen.dart) (Camera screen), [`lib/screens/result_screen.dart`](https://github.com/frezzie-cats/capstone_mobile_app/blob/main/lib/screens/result_screen.dart) (Result screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App flow"]
  node_entry["App entry<br/>[main.dart]"]
  node_camera["Camera screen<br/>[camera_screen.dart]"]
  node_result["Result screen<br/>[result_screen.dart]"]
end

subgraph group_ml["Image inference"]
  node_inference["TFLite service"]
  node_stage1["Binary model"]
  node_stage2["Four-class model"]
end

subgraph group_state["Local data"]
  node_database[("Database helper<br/>[db_helper.dart]")]
end

node_user(("User"))

node_user -.->|"opens"| node_entry
node_entry -.->|"shows"| node_camera
node_camera -.->|"submits image"| node_inference
node_inference -.->|"uses model"| node_stage1
node_inference -.->|"uses model"| node_stage2
node_inference -.->|"returns prediction"| node_result
node_result -.->|"stores result"| node_database

click node_entry "https://github.com/frezzie-cats/capstone_mobile_app/blob/main/lib/main.dart"
click node_camera "https://github.com/frezzie-cats/capstone_mobile_app/blob/main/lib/screens/camera_screen.dart"
click node_result "https://github.com/frezzie-cats/capstone_mobile_app/blob/main/lib/screens/result_screen.dart"
click node_inference "https://github.com/frezzie-cats/capstone_mobile_app/blob/main/lib/services/tflite_service.dart"
click node_stage1 "https://github.com/frezzie-cats/capstone_mobile_app/blob/main/assets/models/stage1_mobilenetv2_binary.tflite"
click node_stage2 "https://github.com/frezzie-cats/capstone_mobile_app/blob/main/assets/models/stage2_efficientnetb0_4class.tflite"
click node_database "https://github.com/frezzie-cats/capstone_mobile_app/blob/main/lib/database/db_helper.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_entry,node_camera,node_result,node_user toneBlue
class node_inference,node_stage1,node_stage2 toneAmber
class node_database toneMint
```

## Components

### App flow

- [App entry](https://github.com/frezzie-cats/capstone_mobile_app/blob/main/lib/main.dart): `lib/main.dart`
- [Camera screen](https://github.com/frezzie-cats/capstone_mobile_app/blob/main/lib/screens/camera_screen.dart): `lib/screens/camera_screen.dart`
- [Result screen](https://github.com/frezzie-cats/capstone_mobile_app/blob/main/lib/screens/result_screen.dart): `lib/screens/result_screen.dart`

### Image inference

- [TFLite service](https://github.com/frezzie-cats/capstone_mobile_app/blob/main/lib/services/tflite_service.dart): `lib/services/tflite_service.dart`
- [Binary model](https://github.com/frezzie-cats/capstone_mobile_app/blob/main/assets/models/stage1_mobilenetv2_binary.tflite): `assets/models/stage1_mobilenetv2_binary.tflite`
- [Four-class model](https://github.com/frezzie-cats/capstone_mobile_app/blob/main/assets/models/stage2_efficientnetb0_4class.tflite): `assets/models/stage2_efficientnetb0_4class.tflite`

### Local data

- [Database helper](https://github.com/frezzie-cats/capstone_mobile_app/blob/main/lib/database/db_helper.dart): `lib/database/db_helper.dart`

### Other components

- **User**

## Connections

- User → App entry: opens
- App entry → Camera screen: shows
- Camera screen → TFLite service: submits image
- TFLite service → Binary model: uses model
- TFLite service → Four-class model: uses model
- TFLite service → Result screen: returns prediction
- Result screen → Database helper: stores result
