# geoshua/blob-app architecture

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

- Interactive diagram: https://gitdiagram.com/geoshua/blob-app
- Repository: https://github.com/geoshua/blob-app

## Overview

Blob is a prototype Android app for on-device first response to grooming, sextortion, and blackmail. The primary workflow captures chat activity from notifications or accessibility screens, assesses incoming messages, and can present a discreet check-in and guidance. A separate branch lets a child save chat evidence and prepare a report. Model and detector development is also documented in the repository; its connection to Android runtime is not established by the supplied excerpts. Evidence limits: several runtime modules are represented by the tree and README, but their internal wiring is not shown.

Main entry points: [`android/app/src/main/java/com/geoshua/childsafety/intervention/InterventionHub.kt`](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/intervention/InterventionHub.kt) (Intervention hub), [`android/app/src/main/java/com/geoshua/childsafety/capture/CaptureHub.kt`](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/capture/CaptureHub.kt) (Capture hub), [`android/app/src/main/java/com/geoshua/childsafety/ui/EvidenceReportActivity.kt`](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/ui/EvidenceReportActivity.kt) (Evidence report), [`android/app/src/main/java/com/geoshua/childsafety/report/ReportExporter.kt`](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/report/ReportExporter.kt) (Report exporter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and detection"]
  node_notification["Notification reader"]
  node_screen["Screen reader"]
  node_capturehub["Capture hub<br/>[CaptureHub.kt]"]
  node_identity["Contact identity<br/>[ContactKeyer.kt]"]
  node_event["Message event<br/>[MessageEvent.kt]"]
  node_flag["Flag engine<br/>[FlagEngine.kt]"]
end

subgraph group_response["Risk and response"]
  node_risk["Risk engine<br/>[RiskEngine.kt]"]
  node_controller["Intervention controller"]
  node_interventionhub["Intervention hub<br/>[InterventionHub.kt]"]
  node_blob["Check-in interface<br/>[BlobView.kt]"]
  node_guide["Child guidance<br/>[Guide.kt]"]
end

subgraph group_evidence["Evidence and reports"]
  node_captureevidence["Evidence capture"]
  node_caserepo[("Evidence cases<br/>[CaseRepo.kt]")]
  node_reportui["Evidence report"]
  node_reportexport["Report exporter<br/>[ReportExporter.kt]"]
  node_statement["Statement text<br/>[StatementText.kt]"]
end

subgraph group_models["Detector models"]
  node_category["Category model<br/>[CategoryModel.kt]"]
  node_textmodel["Text detector rules<br/>[rules.py]"]
  node_image["Nudity detector<br/>[nsfw.py]"]
end

subgraph group_support["App and support"]
  node_help["Help directory<br/>[HelpActivity.kt]"]
  node_palette["Visual design<br/>[Palette.kt]"]
  node_settings["Buddy settings<br/>[BuddySettings.kt]"]
  node_app["Application startup<br/>[App.kt]"]
end

node_child(("Child"))

node_notification -->|"submits messages"| node_capturehub
node_screen -->|"submits messages"| node_capturehub
node_screen -->|"attaches overlay"| node_interventionhub
node_capturehub -->|"initializes keyer"| node_identity
node_capturehub -->|"processes events"| node_event
node_capturehub -->|"assesses messages"| node_flag
node_flag -->|"consults model"| node_category
node_capturehub -->|"sends assessments"| node_interventionhub
node_interventionhub -.->|"scores risk"| node_risk
node_interventionhub -->|"offers decisions"| node_controller
node_interventionhub -.->|"renders check-in"| node_blob
node_interventionhub -.->|"runs guidance"| node_guide
node_interventionhub -->|"opens help"| node_help
node_interventionhub -->|"starts capture"| node_captureevidence
node_captureevidence -.->|"saves cases"| node_caserepo
node_reportui -->|"loads case"| node_caserepo
node_reportui -->|"requests export"| node_reportexport
node_reportexport -->|"reads case"| node_caserepo
node_reportexport -->|"builds statement"| node_statement
node_child -.->|"uses chat apps"| node_notification
node_child -.->|"uses chat apps"| node_screen
node_child -->|"prepares report"| node_reportui
node_app -->|"initializes"| node_capturehub
node_app -->|"initializes"| node_interventionhub
node_app -->|"cleans exports"| node_reportexport
node_reportui -.->|"uses palette"| node_palette
node_textmodel -.->|"informs detector"| node_flag
node_image -.->|"supports safety"| node_child

click node_notification "https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/capture/NotificationReaderService.kt"
click node_screen "https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/capture/ScreenReaderService.kt"
click node_capturehub "https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/capture/CaptureHub.kt"
click node_identity "https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/core/ContactKeyer.kt"
click node_event "https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/core/MessageEvent.kt"
click node_flag "https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/core/detect/FlagEngine.kt"
click node_category "https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/core/detect/model/CategoryModel.kt"
click node_textmodel "https://github.com/geoshua/blob-app/blob/main/text-model/rules.py"
click node_image "https://github.com/geoshua/blob-app/blob/main/image-model/nsfw.py"
click node_risk "https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/core/risk/RiskEngine.kt"
click node_controller "https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/core/intervene/InterventionController.kt"
click node_interventionhub "https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/intervention/InterventionHub.kt"
click node_blob "https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/intervention/BlobView.kt"
click node_guide "https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/core/guide/Guide.kt"
click node_help "https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/ui/HelpActivity.kt"
click node_captureevidence "https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/evidence/EvidenceCapturer.kt"
click node_caserepo "https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/evidence/CaseRepo.kt"
click node_reportui "https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/ui/EvidenceReportActivity.kt"
click node_reportexport "https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/report/ReportExporter.kt"
click node_statement "https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/core/report/StatementText.kt"
click node_palette "https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/core/design/Palette.kt"
click node_settings "https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/ui/BuddySettings.kt"
click node_app "https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/App.kt"

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_notification,node_screen,node_capturehub,node_identity,node_event,node_flag toneBlue
class node_risk,node_controller,node_interventionhub,node_blob,node_guide toneAmber
class node_captureevidence,node_caserepo,node_reportui,node_reportexport,node_statement toneMint
class node_category,node_textmodel,node_image toneRose
class node_help,node_palette,node_settings,node_app,node_child toneIndigo
```

## Components

### Capture and detection

- [Notification reader](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/capture/NotificationReaderService.kt): `android/app/src/main/java/com/geoshua/childsafety/capture/NotificationReaderService.kt`
- [Screen reader](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/capture/ScreenReaderService.kt): `android/app/src/main/java/com/geoshua/childsafety/capture/ScreenReaderService.kt`
- [Capture hub](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/capture/CaptureHub.kt): `android/app/src/main/java/com/geoshua/childsafety/capture/CaptureHub.kt`
- [Contact identity](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/core/ContactKeyer.kt): `android/app/src/main/java/com/geoshua/childsafety/core/ContactKeyer.kt`
- [Message event](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/core/MessageEvent.kt): `android/app/src/main/java/com/geoshua/childsafety/core/MessageEvent.kt`
- [Flag engine](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/core/detect/FlagEngine.kt): `android/app/src/main/java/com/geoshua/childsafety/core/detect/FlagEngine.kt`

### Risk and response

- [Risk engine](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/core/risk/RiskEngine.kt): `android/app/src/main/java/com/geoshua/childsafety/core/risk/RiskEngine.kt`
- [Intervention controller](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/core/intervene/InterventionController.kt): `android/app/src/main/java/com/geoshua/childsafety/core/intervene/InterventionController.kt`
- [Intervention hub](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/intervention/InterventionHub.kt): `android/app/src/main/java/com/geoshua/childsafety/intervention/InterventionHub.kt`
- [Check-in interface](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/intervention/BlobView.kt): `android/app/src/main/java/com/geoshua/childsafety/intervention/BlobView.kt`
- [Child guidance](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/core/guide/Guide.kt): `android/app/src/main/java/com/geoshua/childsafety/core/guide/Guide.kt`

### Evidence and reports

- [Evidence capture](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/evidence/EvidenceCapturer.kt): `android/app/src/main/java/com/geoshua/childsafety/evidence/EvidenceCapturer.kt`
- [Evidence cases](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/evidence/CaseRepo.kt): `android/app/src/main/java/com/geoshua/childsafety/evidence/CaseRepo.kt`
- [Evidence report](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/ui/EvidenceReportActivity.kt): `android/app/src/main/java/com/geoshua/childsafety/ui/EvidenceReportActivity.kt`
- [Report exporter](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/report/ReportExporter.kt): `android/app/src/main/java/com/geoshua/childsafety/report/ReportExporter.kt`
- [Statement text](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/core/report/StatementText.kt): `android/app/src/main/java/com/geoshua/childsafety/core/report/StatementText.kt`

### Detector models

- [Category model](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/core/detect/model/CategoryModel.kt): `android/app/src/main/java/com/geoshua/childsafety/core/detect/model/CategoryModel.kt`
- [Text detector rules](https://github.com/geoshua/blob-app/blob/main/text-model/rules.py): `text-model/rules.py`
- [Nudity detector](https://github.com/geoshua/blob-app/blob/main/image-model/nsfw.py): `image-model/nsfw.py`

### App and support

- [Help directory](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/ui/HelpActivity.kt): `android/app/src/main/java/com/geoshua/childsafety/ui/HelpActivity.kt`
- [Visual design](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/core/design/Palette.kt): `android/app/src/main/java/com/geoshua/childsafety/core/design/Palette.kt`
- [Buddy settings](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/ui/BuddySettings.kt): `android/app/src/main/java/com/geoshua/childsafety/ui/BuddySettings.kt`
- [Application startup](https://github.com/geoshua/blob-app/blob/main/android/app/src/main/java/com/geoshua/childsafety/App.kt): `android/app/src/main/java/com/geoshua/childsafety/App.kt`

### Other components

- **Child**

## Connections

- Notification reader → Capture hub: submits messages (evidence: `android/app/src/main/java/com/geoshua/childsafety/capture/NotificationReaderService.kt`)
- Screen reader → Capture hub: submits messages (evidence: `android/app/src/main/java/com/geoshua/childsafety/capture/ScreenReaderService.kt`)
- Screen reader → Intervention hub: attaches overlay (evidence: `android/app/src/main/java/com/geoshua/childsafety/capture/ScreenReaderService.kt`)
- Capture hub → Contact identity: initializes keyer (evidence: `android/app/src/main/java/com/geoshua/childsafety/capture/CaptureHub.kt`)
- Capture hub → Message event: processes events (evidence: `android/app/src/main/java/com/geoshua/childsafety/capture/CaptureHub.kt`)
- Capture hub → Flag engine: assesses messages (evidence: `android/app/src/main/java/com/geoshua/childsafety/capture/CaptureHub.kt`)
- Flag engine → Category model: consults model (evidence: `android/app/src/main/java/com/geoshua/childsafety/core/detect/FlagEngine.kt`)
- Capture hub → Intervention hub: sends assessments (evidence: `android/app/src/main/java/com/geoshua/childsafety/capture/CaptureHub.kt`)
- Intervention hub → Risk engine: scores risk (evidence: `android/app/src/main/java/com/geoshua/childsafety/intervention/InterventionHub.kt`)
- Intervention hub → Intervention controller: offers decisions (evidence: `android/app/src/main/java/com/geoshua/childsafety/intervention/InterventionHub.kt`)
- Intervention hub → Check-in interface: renders check-in
- Intervention hub → Child guidance: runs guidance
- Intervention hub → Help directory: opens help (evidence: `android/app/src/main/java/com/geoshua/childsafety/intervention/InterventionHub.kt`)
- Intervention hub → Evidence capture: starts capture (evidence: `android/app/src/main/java/com/geoshua/childsafety/intervention/InterventionHub.kt`)
- Evidence capture → Evidence cases: saves cases
- Evidence report → Evidence cases: loads case (evidence: `android/app/src/main/java/com/geoshua/childsafety/ui/EvidenceReportActivity.kt`)
- Evidence report → Report exporter: requests export (evidence: `android/app/src/main/java/com/geoshua/childsafety/ui/EvidenceReportActivity.kt`)
- Report exporter → Evidence cases: reads case (evidence: `android/app/src/main/java/com/geoshua/childsafety/report/ReportExporter.kt`)
- Report exporter → Statement text: builds statement (evidence: `android/app/src/main/java/com/geoshua/childsafety/report/ReportExporter.kt`)
- Child → Notification reader: uses chat apps
- Child → Screen reader: uses chat apps
- Child → Evidence report: prepares report (evidence: `android/app/src/main/java/com/geoshua/childsafety/ui/EvidenceReportActivity.kt`)
- Application startup → Capture hub: initializes (evidence: `android/app/src/main/java/com/geoshua/childsafety/App.kt`)
- Application startup → Intervention hub: initializes (evidence: `android/app/src/main/java/com/geoshua/childsafety/App.kt`)
- Application startup → Report exporter: cleans exports (evidence: `android/app/src/main/java/com/geoshua/childsafety/App.kt`)
- Evidence report → Visual design: uses palette
- Text detector rules → Flag engine: informs detector
- Nudity detector → Child: supports safety
