# ashfaqueo/brobehave architecture

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

- Interactive diagram: https://gitdiagram.com/ashfaqueo/brobehave
- Repository: https://github.com/ashfaqueo/brobehave

## Overview

BroBehave is an Android app for personal streak tracking and recovery, social accountability, and optional automatic adult-domain detection. The main path is app launch and navigation into onboarding or sign-in, then profile and streak activity backed by local storage and server sync; social feed and detection are additional user workflows. The source excerpts support several repository, storage, and detection relationships, but the README is empty and many screens and navigation routes were not sampled, so those links are not asserted.

Main entry points: [`core/data/src/main/kotlin/com/brobehave/core/data/StreakRepository.kt`](https://github.com/ashfaqueo/brobehave/blob/main/core/data/src/main/kotlin/com/brobehave/core/data/StreakRepository.kt) (Streak tracking), [`core/data/src/main/kotlin/com/brobehave/core/data/ProfileRepository.kt`](https://github.com/ashfaqueo/brobehave/blob/main/core/data/src/main/kotlin/com/brobehave/core/data/ProfileRepository.kt) (Profile data), [`detection/src/main/kotlin/com/brobehave/detection/DetectionVpnService.kt`](https://github.com/ashfaqueo/brobehave/blob/main/detection/src/main/kotlin/com/brobehave/detection/DetectionVpnService.kt) (VPN detection), [`core/data/src/main/kotlin/com/brobehave/core/data/AuthRepository.kt`](https://github.com/ashfaqueo/brobehave/blob/main/core/data/src/main/kotlin/com/brobehave/core/data/AuthRepository.kt) (Authentication data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and onboarding"]
  node_main["Android activity<br/>[MainActivity.kt]"]
  node_navigation["Navigation shell"]
  node_auth["Authentication UI<br/>[AuthScreen.kt]"]
  node_authvm["Authentication state<br/>[AuthViewModel.kt]"]
  node_onboarding["Setup workflow<br/>[SetupViewModel.kt]"]
  node_push["Push messaging"]
end

subgraph group_accountability["Streak and social"]
  node_profileui["Own profile<br/>[ProfileScreen.kt]"]
  node_profileviews["Profile and settings"]
  node_feed["Social feed<br/>[FeedScreen.kt]"]
  node_feedvm["Feed state<br/>[FeedViewModel.kt]"]
  node_social["Social data"]
  node_streak["Streak tracking"]
end

subgraph group_detection["Automatic detection"]
  node_detectionui["Detection disclosure"]
  node_controller["Detection controller"]
  node_vpn["VPN detection"]
  node_matcher["Domain matching<br/>[DomainMatcher.kt]"]
  node_blocklist["Blocklist updates"]
end

subgraph group_platform["Data and services"]
  node_authrepo["Authentication data<br/>[AuthRepository.kt]"]
  node_profilerepo["Profile data"]
  node_local["Local store<br/>[LocalStore.kt]"]
  node_database[("Room database")]
  node_flaggeddao["Flagged-day storage<br/>[FlaggedDayDao.kt]"]
  node_flaggedentity["Flagged-day records"]
end

node_user(("App user"))
node_supabase{{"Supabase services"}}

node_user -->|"opens app"| node_main
node_main -->|"hosts navigation"| node_navigation
node_auth -->|"dispatches input"| node_authvm
node_authvm -->|"uses auth"| node_authrepo
node_onboarding -->|"uses auth"| node_authrepo
node_onboarding -->|"updates profile"| node_profilerepo
node_feed -->|"dispatches actions"| node_feedvm
node_feedvm -->|"loads feed"| node_social
node_profileui -.->|"opens views"| node_profileviews
node_profileui -.->|"toggles detection"| node_controller
node_controller -->|"starts service"| node_vpn
node_vpn -->|"matches domains"| node_matcher
node_vpn -->|"loads updates"| node_blocklist
node_vpn -->|"records heartbeat"| node_streak
node_streak -->|"reads and writes"| node_flaggeddao
node_streak -->|"updates cache"| node_local
node_streak -->|"refreshes profile"| node_profilerepo
node_streak -->|"syncs events"| node_supabase
node_local -->|"uses DAO"| node_flaggeddao
node_database -->|"provides DAO"| node_flaggeddao
node_database -->|"stores records"| node_flaggedentity
node_flaggeddao -->|"queries records"| node_flaggedentity
node_authrepo -->|"auth and functions"| node_supabase
node_authrepo -->|"clears local data"| node_local
node_profilerepo -->|"caches profile"| node_local
node_profilerepo -->|"reads profile"| node_supabase
node_push -->|"registers token"| node_profilerepo
node_push -->|"opens on tap"| node_main

click node_main "https://github.com/ashfaqueo/brobehave/blob/main/app/src/main/kotlin/com/brobehave/app/MainActivity.kt"
click node_navigation "https://github.com/ashfaqueo/brobehave/blob/main/app/src/main/kotlin/com/brobehave/app/navigation/BroBehaveNavShell.kt"
click node_auth "https://github.com/ashfaqueo/brobehave/blob/main/feature/auth/src/main/kotlin/com/brobehave/feature/auth/AuthScreen.kt"
click node_authvm "https://github.com/ashfaqueo/brobehave/blob/main/feature/auth/src/main/kotlin/com/brobehave/feature/auth/AuthViewModel.kt"
click node_onboarding "https://github.com/ashfaqueo/brobehave/blob/main/feature/onboarding/src/main/kotlin/com/brobehave/feature/onboarding/SetupViewModel.kt"
click node_profileui "https://github.com/ashfaqueo/brobehave/blob/main/feature/profile/src/main/kotlin/com/brobehave/feature/profile/ProfileScreen.kt"
click node_profileviews "https://github.com/ashfaqueo/brobehave/blob/main/feature/profile/src/main/kotlin/com/brobehave/feature/profile/UserProfileScreen.kt"
click node_feed "https://github.com/ashfaqueo/brobehave/blob/main/feature/feed/src/main/kotlin/com/brobehave/feature/feed/FeedScreen.kt"
click node_feedvm "https://github.com/ashfaqueo/brobehave/blob/main/feature/feed/src/main/kotlin/com/brobehave/feature/feed/FeedViewModel.kt"
click node_social "https://github.com/ashfaqueo/brobehave/blob/main/core/data/src/main/kotlin/com/brobehave/core/data/SocialRepository.kt"
click node_streak "https://github.com/ashfaqueo/brobehave/blob/main/core/data/src/main/kotlin/com/brobehave/core/data/StreakRepository.kt"
click node_detectionui "https://github.com/ashfaqueo/brobehave/blob/main/detection/src/main/kotlin/com/brobehave/detection/DetectionDisclosureScreen.kt"
click node_controller "https://github.com/ashfaqueo/brobehave/blob/main/detection/src/main/kotlin/com/brobehave/detection/DetectionController.kt"
click node_vpn "https://github.com/ashfaqueo/brobehave/blob/main/detection/src/main/kotlin/com/brobehave/detection/DetectionVpnService.kt"
click node_matcher "https://github.com/ashfaqueo/brobehave/blob/main/detection/src/main/kotlin/com/brobehave/detection/engine/DomainMatcher.kt"
click node_blocklist "https://github.com/ashfaqueo/brobehave/blob/main/detection/src/main/kotlin/com/brobehave/detection/BlocklistUpdater.kt"
click node_authrepo "https://github.com/ashfaqueo/brobehave/blob/main/core/data/src/main/kotlin/com/brobehave/core/data/AuthRepository.kt"
click node_profilerepo "https://github.com/ashfaqueo/brobehave/blob/main/core/data/src/main/kotlin/com/brobehave/core/data/ProfileRepository.kt"
click node_local "https://github.com/ashfaqueo/brobehave/blob/main/core/data/src/main/kotlin/com/brobehave/core/data/LocalStore.kt"
click node_database "https://github.com/ashfaqueo/brobehave/blob/main/core/database/src/main/kotlin/com/brobehave/core/database/BroBehaveDatabase.kt"
click node_flaggeddao "https://github.com/ashfaqueo/brobehave/blob/main/core/database/src/main/kotlin/com/brobehave/core/database/FlaggedDayDao.kt"
click node_flaggedentity "https://github.com/ashfaqueo/brobehave/blob/main/core/database/src/main/kotlin/com/brobehave/core/database/FlaggedDayEntity.kt"
click node_push "https://github.com/ashfaqueo/brobehave/blob/main/app/src/main/kotlin/com/brobehave/app/push/BroBehaveMessagingService.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_main,node_navigation,node_auth,node_authvm,node_onboarding,node_push,node_user toneBlue
class node_profileui,node_profileviews,node_feed,node_feedvm,node_social,node_streak toneAmber
class node_detectionui,node_controller,node_vpn,node_matcher,node_blocklist toneMint
class node_authrepo,node_profilerepo,node_local,node_database,node_flaggeddao,node_flaggedentity toneRose
class node_supabase toneIndigo
```

## Components

### App and onboarding

- [Android activity](https://github.com/ashfaqueo/brobehave/blob/main/app/src/main/kotlin/com/brobehave/app/MainActivity.kt): `app/src/main/kotlin/com/brobehave/app/MainActivity.kt`
- [Navigation shell](https://github.com/ashfaqueo/brobehave/blob/main/app/src/main/kotlin/com/brobehave/app/navigation/BroBehaveNavShell.kt): `app/src/main/kotlin/com/brobehave/app/navigation/BroBehaveNavShell.kt`
- [Authentication UI](https://github.com/ashfaqueo/brobehave/blob/main/feature/auth/src/main/kotlin/com/brobehave/feature/auth/AuthScreen.kt): `feature/auth/src/main/kotlin/com/brobehave/feature/auth/AuthScreen.kt`
- [Authentication state](https://github.com/ashfaqueo/brobehave/blob/main/feature/auth/src/main/kotlin/com/brobehave/feature/auth/AuthViewModel.kt): `feature/auth/src/main/kotlin/com/brobehave/feature/auth/AuthViewModel.kt`
- [Setup workflow](https://github.com/ashfaqueo/brobehave/blob/main/feature/onboarding/src/main/kotlin/com/brobehave/feature/onboarding/SetupViewModel.kt): `feature/onboarding/src/main/kotlin/com/brobehave/feature/onboarding/SetupViewModel.kt`
- [Push messaging](https://github.com/ashfaqueo/brobehave/blob/main/app/src/main/kotlin/com/brobehave/app/push/BroBehaveMessagingService.kt): `app/src/main/kotlin/com/brobehave/app/push/BroBehaveMessagingService.kt`

### Streak and social

- [Own profile](https://github.com/ashfaqueo/brobehave/blob/main/feature/profile/src/main/kotlin/com/brobehave/feature/profile/ProfileScreen.kt): `feature/profile/src/main/kotlin/com/brobehave/feature/profile/ProfileScreen.kt`
- [Profile and settings](https://github.com/ashfaqueo/brobehave/blob/main/feature/profile/src/main/kotlin/com/brobehave/feature/profile/UserProfileScreen.kt): `feature/profile/src/main/kotlin/com/brobehave/feature/profile/UserProfileScreen.kt`
- [Social feed](https://github.com/ashfaqueo/brobehave/blob/main/feature/feed/src/main/kotlin/com/brobehave/feature/feed/FeedScreen.kt): `feature/feed/src/main/kotlin/com/brobehave/feature/feed/FeedScreen.kt`
- [Feed state](https://github.com/ashfaqueo/brobehave/blob/main/feature/feed/src/main/kotlin/com/brobehave/feature/feed/FeedViewModel.kt): `feature/feed/src/main/kotlin/com/brobehave/feature/feed/FeedViewModel.kt`
- [Social data](https://github.com/ashfaqueo/brobehave/blob/main/core/data/src/main/kotlin/com/brobehave/core/data/SocialRepository.kt): `core/data/src/main/kotlin/com/brobehave/core/data/SocialRepository.kt`
- [Streak tracking](https://github.com/ashfaqueo/brobehave/blob/main/core/data/src/main/kotlin/com/brobehave/core/data/StreakRepository.kt): `core/data/src/main/kotlin/com/brobehave/core/data/StreakRepository.kt`

### Automatic detection

- [Detection disclosure](https://github.com/ashfaqueo/brobehave/blob/main/detection/src/main/kotlin/com/brobehave/detection/DetectionDisclosureScreen.kt): `detection/src/main/kotlin/com/brobehave/detection/DetectionDisclosureScreen.kt`
- [Detection controller](https://github.com/ashfaqueo/brobehave/blob/main/detection/src/main/kotlin/com/brobehave/detection/DetectionController.kt): `detection/src/main/kotlin/com/brobehave/detection/DetectionController.kt`
- [VPN detection](https://github.com/ashfaqueo/brobehave/blob/main/detection/src/main/kotlin/com/brobehave/detection/DetectionVpnService.kt): `detection/src/main/kotlin/com/brobehave/detection/DetectionVpnService.kt`
- [Domain matching](https://github.com/ashfaqueo/brobehave/blob/main/detection/src/main/kotlin/com/brobehave/detection/engine/DomainMatcher.kt): `detection/src/main/kotlin/com/brobehave/detection/engine/DomainMatcher.kt`
- [Blocklist updates](https://github.com/ashfaqueo/brobehave/blob/main/detection/src/main/kotlin/com/brobehave/detection/BlocklistUpdater.kt): `detection/src/main/kotlin/com/brobehave/detection/BlocklistUpdater.kt`

### Data and services

- [Authentication data](https://github.com/ashfaqueo/brobehave/blob/main/core/data/src/main/kotlin/com/brobehave/core/data/AuthRepository.kt): `core/data/src/main/kotlin/com/brobehave/core/data/AuthRepository.kt`
- [Profile data](https://github.com/ashfaqueo/brobehave/blob/main/core/data/src/main/kotlin/com/brobehave/core/data/ProfileRepository.kt): `core/data/src/main/kotlin/com/brobehave/core/data/ProfileRepository.kt`
- [Local store](https://github.com/ashfaqueo/brobehave/blob/main/core/data/src/main/kotlin/com/brobehave/core/data/LocalStore.kt): `core/data/src/main/kotlin/com/brobehave/core/data/LocalStore.kt`
- [Room database](https://github.com/ashfaqueo/brobehave/blob/main/core/database/src/main/kotlin/com/brobehave/core/database/BroBehaveDatabase.kt): `core/database/src/main/kotlin/com/brobehave/core/database/BroBehaveDatabase.kt`
- [Flagged-day storage](https://github.com/ashfaqueo/brobehave/blob/main/core/database/src/main/kotlin/com/brobehave/core/database/FlaggedDayDao.kt): `core/database/src/main/kotlin/com/brobehave/core/database/FlaggedDayDao.kt`
- [Flagged-day records](https://github.com/ashfaqueo/brobehave/blob/main/core/database/src/main/kotlin/com/brobehave/core/database/FlaggedDayEntity.kt): `core/database/src/main/kotlin/com/brobehave/core/database/FlaggedDayEntity.kt`

### Other components

- **App user**
- **Supabase services**

## Connections

- App user → Android activity: opens app (evidence: `app/src/main/kotlin/com/brobehave/app/MainActivity.kt`)
- Android activity → Navigation shell: hosts navigation (evidence: `app/src/main/kotlin/com/brobehave/app/MainActivity.kt`)
- Authentication UI → Authentication state: dispatches input (evidence: `feature/auth/src/main/kotlin/com/brobehave/feature/auth/AuthScreen.kt`)
- Authentication state → Authentication data: uses auth (evidence: `feature/auth/src/main/kotlin/com/brobehave/feature/auth/AuthViewModel.kt`)
- Setup workflow → Authentication data: uses auth (evidence: `feature/onboarding/src/main/kotlin/com/brobehave/feature/onboarding/SetupViewModel.kt`)
- Setup workflow → Profile data: updates profile (evidence: `feature/onboarding/src/main/kotlin/com/brobehave/feature/onboarding/SetupViewModel.kt`)
- Social feed → Feed state: dispatches actions (evidence: `feature/feed/src/main/kotlin/com/brobehave/feature/feed/FeedScreen.kt`)
- Feed state → Social data: loads feed (evidence: `feature/feed/src/main/kotlin/com/brobehave/feature/feed/FeedViewModel.kt`)
- Own profile → Profile and settings: opens views
- Own profile → Detection controller: toggles detection
- Detection controller → VPN detection: starts service (evidence: `detection/src/main/kotlin/com/brobehave/detection/DetectionController.kt`)
- VPN detection → Domain matching: matches domains (evidence: `detection/src/main/kotlin/com/brobehave/detection/DetectionVpnService.kt`)
- VPN detection → Blocklist updates: loads updates (evidence: `detection/src/main/kotlin/com/brobehave/detection/DetectionVpnService.kt`)
- VPN detection → Streak tracking: records heartbeat (evidence: `detection/src/main/kotlin/com/brobehave/detection/DetectionVpnService.kt`)
- Streak tracking → Flagged-day storage: reads and writes (evidence: `core/data/src/main/kotlin/com/brobehave/core/data/StreakRepository.kt`)
- Streak tracking → Local store: updates cache (evidence: `core/data/src/main/kotlin/com/brobehave/core/data/StreakRepository.kt`)
- Streak tracking → Profile data: refreshes profile (evidence: `core/data/src/main/kotlin/com/brobehave/core/data/StreakRepository.kt`)
- Streak tracking → Supabase services: syncs events (evidence: `core/data/src/main/kotlin/com/brobehave/core/data/StreakRepository.kt`)
- Local store → Flagged-day storage: uses DAO (evidence: `core/data/src/main/kotlin/com/brobehave/core/data/LocalStore.kt`)
- Room database → Flagged-day storage: provides DAO (evidence: `core/database/src/main/kotlin/com/brobehave/core/database/BroBehaveDatabase.kt`)
- Room database → Flagged-day records: stores records (evidence: `core/database/src/main/kotlin/com/brobehave/core/database/BroBehaveDatabase.kt`)
- Flagged-day storage → Flagged-day records: queries records (evidence: `core/database/src/main/kotlin/com/brobehave/core/database/FlaggedDayDao.kt`)
- Authentication data → Supabase services: auth and functions (evidence: `core/data/src/main/kotlin/com/brobehave/core/data/AuthRepository.kt`)
- Authentication data → Local store: clears local data (evidence: `core/data/src/main/kotlin/com/brobehave/core/data/AuthRepository.kt`)
- Profile data → Local store: caches profile (evidence: `core/data/src/main/kotlin/com/brobehave/core/data/ProfileRepository.kt`)
- Profile data → Supabase services: reads profile (evidence: `core/data/src/main/kotlin/com/brobehave/core/data/ProfileRepository.kt`)
- Push messaging → Profile data: registers token (evidence: `app/src/main/kotlin/com/brobehave/app/push/BroBehaveMessagingService.kt`)
- Push messaging → Android activity: opens on tap (evidence: `app/src/main/kotlin/com/brobehave/app/push/BroBehaveMessagingService.kt`)
