# mrdhivakar/family_editor architecture

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

- Interactive diagram: https://gitdiagram.com/mrdhivakar/family_editor
- Repository: https://github.com/mrdhivakar/family_editor

## Overview

Family Editor is a Flutter video editor with two user-facing workflows: general-purpose editing and on-device detection and editing of sensitive scenes. The documented family workflow runs from movie selection through category selection, analysis, scene review and per-scene edits to gallery export. The README documents these capabilities, but the sampled source excerpts do not show Flutter runtime calls, so the edges below reflect documented workflow rather than verified call ownership.

Main entry points: [`lib/screens/family_editor/analysis_screen.dart`](https://github.com/mrdhivakar/family_editor/blob/main/lib/screens/family_editor/analysis_screen.dart) (Scene analysis), [`lib/screens/family_editor/scene_list_screen.dart`](https://github.com/mrdhivakar/family_editor/blob/main/lib/screens/family_editor/scene_list_screen.dart) (Scene review), [`lib/screens/family_editor/process_screen.dart`](https://github.com/mrdhivakar/family_editor/blob/main/lib/screens/family_editor/process_screen.dart) (Export screen), [`lib/app.dart`](https://github.com/mrdhivakar/family_editor/blob/main/lib/app.dart) (Flutter app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry"]
  node_app["Flutter app<br/>[app.dart]"]
  node_home["Home screen<br/>[home_screen.dart]"]
end

subgraph group_editing["Video editing"]
  node_normal["Normal editor"]
end

subgraph group_family["Family-safe workflow"]
  node_upload["Movie upload<br/>[upload_screen.dart]"]
  node_categories["Detection categories"]
  node_analysis["Scene analysis"]
  node_scene_review["Scene review"]
  node_scene_actions["Scene actions<br/>[edit_action.dart]"]
  node_export["Export screen"]
end

subgraph group_runtime["Media runtime"]
  node_detector["Detection service"]
  node_model["TFLite model<br/>[nsfw.tflite]"]
  node_processing["Video processing"]
  node_gallery_service["Gallery service"]
end

node_user(("User"))
node_gallery[("Device gallery")]

node_user -->|"opens"| node_app
node_app -->|"shows"| node_home
node_home -->|"opens editor"| node_normal
node_user -->|"selects movie"| node_upload
node_upload -->|"continues to"| node_categories
node_categories -->|"starts analysis"| node_analysis
node_analysis -->|"runs detection"| node_detector
node_detector -->|"uses model"| node_model
node_analysis -->|"shows detections"| node_scene_review
node_scene_review -->|"sets per-scene action"| node_scene_actions
node_scene_review -->|"continues to export"| node_export
node_export -->|"exports video"| node_processing
node_export -->|"saves export"| node_gallery_service
node_gallery_service -->|"writes video"| node_gallery

click node_app "https://github.com/mrdhivakar/family_editor/blob/main/lib/app.dart"
click node_home "https://github.com/mrdhivakar/family_editor/blob/main/lib/screens/home_screen.dart"
click node_normal "https://github.com/mrdhivakar/family_editor/blob/main/lib/screens/normal_editor/normal_editor_screen.dart"
click node_upload "https://github.com/mrdhivakar/family_editor/blob/main/lib/screens/family_editor/upload_screen.dart"
click node_categories "https://github.com/mrdhivakar/family_editor/blob/main/lib/screens/family_editor/detect_options_screen.dart"
click node_analysis "https://github.com/mrdhivakar/family_editor/blob/main/lib/screens/family_editor/analysis_screen.dart"
click node_detector "https://github.com/mrdhivakar/family_editor/blob/main/lib/services/detection_service.dart"
click node_model "https://github.com/mrdhivakar/family_editor/blob/main/assets/models/nsfw.tflite"
click node_scene_review "https://github.com/mrdhivakar/family_editor/blob/main/lib/screens/family_editor/scene_list_screen.dart"
click node_scene_actions "https://github.com/mrdhivakar/family_editor/blob/main/lib/models/edit_action.dart"
click node_processing "https://github.com/mrdhivakar/family_editor/blob/main/lib/services/ffmpeg_service.dart"
click node_export "https://github.com/mrdhivakar/family_editor/blob/main/lib/screens/family_editor/process_screen.dart"
click node_gallery_service "https://github.com/mrdhivakar/family_editor/blob/main/lib/services/gallery_service.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_home,node_user toneBlue
class node_normal,node_gallery toneAmber
class node_upload,node_categories,node_analysis,node_scene_review,node_scene_actions,node_export toneMint
class node_detector,node_model,node_processing,node_gallery_service toneRose
```

## Components

### App entry

- [Flutter app](https://github.com/mrdhivakar/family_editor/blob/main/lib/app.dart): `lib/app.dart`
- [Home screen](https://github.com/mrdhivakar/family_editor/blob/main/lib/screens/home_screen.dart): `lib/screens/home_screen.dart`

### Video editing

- [Normal editor](https://github.com/mrdhivakar/family_editor/blob/main/lib/screens/normal_editor/normal_editor_screen.dart): `lib/screens/normal_editor/normal_editor_screen.dart`

### Family-safe workflow

- [Movie upload](https://github.com/mrdhivakar/family_editor/blob/main/lib/screens/family_editor/upload_screen.dart): `lib/screens/family_editor/upload_screen.dart`
- [Detection categories](https://github.com/mrdhivakar/family_editor/blob/main/lib/screens/family_editor/detect_options_screen.dart): `lib/screens/family_editor/detect_options_screen.dart`
- [Scene analysis](https://github.com/mrdhivakar/family_editor/blob/main/lib/screens/family_editor/analysis_screen.dart): `lib/screens/family_editor/analysis_screen.dart`
- [Scene review](https://github.com/mrdhivakar/family_editor/blob/main/lib/screens/family_editor/scene_list_screen.dart): `lib/screens/family_editor/scene_list_screen.dart`
- [Scene actions](https://github.com/mrdhivakar/family_editor/blob/main/lib/models/edit_action.dart): `lib/models/edit_action.dart`
- [Export screen](https://github.com/mrdhivakar/family_editor/blob/main/lib/screens/family_editor/process_screen.dart): `lib/screens/family_editor/process_screen.dart`

### Media runtime

- [Detection service](https://github.com/mrdhivakar/family_editor/blob/main/lib/services/detection_service.dart): `lib/services/detection_service.dart`
- [TFLite model](https://github.com/mrdhivakar/family_editor/blob/main/assets/models/nsfw.tflite): `assets/models/nsfw.tflite`
- [Video processing](https://github.com/mrdhivakar/family_editor/blob/main/lib/services/ffmpeg_service.dart): `lib/services/ffmpeg_service.dart`
- [Gallery service](https://github.com/mrdhivakar/family_editor/blob/main/lib/services/gallery_service.dart): `lib/services/gallery_service.dart`

### Other components

- **User**
- **Device gallery**

## Connections

- User → Flutter app: opens (evidence: `README.md`)
- Flutter app → Home screen: shows (evidence: `README.md`)
- Home screen → Normal editor: opens editor (evidence: `README.md`)
- User → Movie upload: selects movie (evidence: `README.md`)
- Movie upload → Detection categories: continues to (evidence: `README.md`)
- Detection categories → Scene analysis: starts analysis (evidence: `README.md`)
- Scene analysis → Detection service: runs detection (evidence: `README.md`)
- Detection service → TFLite model: uses model (evidence: `README.md`)
- Scene analysis → Scene review: shows detections (evidence: `README.md`)
- Scene review → Scene actions: sets per-scene action (evidence: `README.md`)
- Scene review → Export screen: continues to export (evidence: `README.md`)
- Export screen → Video processing: exports video (evidence: `README.md`)
- Export screen → Gallery service: saves export (evidence: `README.md`)
- Gallery service → Device gallery: writes video (evidence: `README.md`)
