# robi46/focus-forge architecture

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

- Interactive diagram: https://gitdiagram.com/robi46/focus-forge
- Repository: https://github.com/robi46/focus-forge

## Overview

FocusForge is a local-first Android study timer. The main workflow is to configure a rhythm and optional goal, run focus and rest rounds with audible/notification cues, then review recorded sessions through analytics and growth progress. Separate workspaces support notes and routines, Android focus guidance, and optional advertising. The README documents module responsibilities and capabilities, but source excerpts were not provided, so the graph omits uncertain implementation-level wiring.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_session["Focus sessions"]
  node_dashboard["Focus dashboard"]
  node_rhythm["Rhythm designer"]
  node_provider["Session provider"]
  node_timer["Timer state machine"]
  node_cueevents["Cue transitions"]
end

subgraph group_insights["Progress and planning"]
  node_history["History and goals"]
  node_analytics["Focus analytics"]
  node_notes["Notes workspace"]
  node_noteslogic["Notes and routines"]
  node_growth["Growth progression"]
  node_growthscenes["Garden, Hive, River"]
end

subgraph group_platform["Device integrations"]
  node_cueschedule["Cue scheduling"]
  node_notifications["Notification behavior"]
  node_cuereplay["Repeated audio cues"]
  node_localstore[("On-device storage")]
  node_shield["Focus Shield guidance"]
  node_interruptions["Allowed interruptions"]
  node_settings["Audio and preferences"]
end

subgraph group_monetization["Optional monetization"]
  node_ads["Consent-aware ads"]
end

node_student(("Student"))
node_osnotifications["Android notifications"]
node_audio["Device audio"]
node_adservice["Ad service"]

node_student -->|"starts sessions"| node_dashboard
node_student -->|"designs rhythm"| node_rhythm
node_student -->|"reviews progress"| node_history
node_student -->|"plans study"| node_notes
node_student -->|"checks setup"| node_shield
node_student -->|"sets preferences"| node_settings
node_dashboard -->|"controls session"| node_provider
node_rhythm -->|"sets rhythm"| node_provider
node_provider -->|"advances rounds"| node_timer
node_provider -->|"persists state"| node_localstore
node_provider -->|"emits transitions"| node_cueevents
node_provider -->|"schedules cues"| node_cueschedule
node_cueschedule -->|"uses behavior"| node_notifications
node_notifications -->|"schedules alerts"| node_osnotifications
node_cueevents -->|"triggers replay"| node_cuereplay
node_cuereplay -->|"plays cues"| node_audio
node_history -->|"derives insights"| node_analytics
node_analytics -->|"reads sessions"| node_localstore
node_notes -->|"manages content"| node_noteslogic
node_noteslogic -->|"persists notes"| node_localstore
node_provider -->|"updates progress"| node_growth
node_growth -->|"persists growth"| node_localstore
node_growth -->|"supplies progression"| node_growthscenes
node_student -->|"selects exceptions"| node_interruptions
node_student -.->|"opts into rewards"| node_ads
node_ads -.->|"requests ads"| node_adservice

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_dashboard,node_rhythm,node_provider,node_timer,node_cueevents toneBlue
class node_history,node_analytics,node_notes,node_noteslogic,node_growth,node_growthscenes toneAmber
class node_cueschedule,node_notifications,node_cuereplay,node_localstore,node_shield,node_interruptions,node_settings toneMint
class node_ads toneRose
class node_student,node_osnotifications,node_audio,node_adservice toneIndigo
```

## Components

### Focus sessions

- **Focus dashboard**
- **Rhythm designer**
- **Session provider**
- **Timer state machine**
- **Cue transitions**

### Progress and planning

- **History and goals**
- **Focus analytics**
- **Notes workspace**
- **Notes and routines**
- **Growth progression**
- **Garden, Hive, River**

### Device integrations

- **Cue scheduling**
- **Notification behavior**
- **Repeated audio cues**
- **On-device storage**
- **Focus Shield guidance**
- **Allowed interruptions**
- **Audio and preferences**

### Optional monetization

- **Consent-aware ads**

### Other components

- **Student**
- **Android notifications**
- **Device audio**
- **Ad service**

## Connections

- Student → Focus dashboard: starts sessions
- Student → Rhythm designer: designs rhythm
- Student → History and goals: reviews progress
- Student → Notes workspace: plans study
- Student → Focus Shield guidance: checks setup
- Student → Audio and preferences: sets preferences
- Focus dashboard → Session provider: controls session
- Rhythm designer → Session provider: sets rhythm
- Session provider → Timer state machine: advances rounds
- Session provider → On-device storage: persists state
- Session provider → Cue transitions: emits transitions
- Session provider → Cue scheduling: schedules cues
- Cue scheduling → Notification behavior: uses behavior
- Notification behavior → Android notifications: schedules alerts
- Cue transitions → Repeated audio cues: triggers replay
- Repeated audio cues → Device audio: plays cues
- History and goals → Focus analytics: derives insights
- Focus analytics → On-device storage: reads sessions
- Notes workspace → Notes and routines: manages content
- Notes and routines → On-device storage: persists notes
- Session provider → Growth progression: updates progress
- Growth progression → On-device storage: persists growth
- Growth progression → Garden, Hive, River: supplies progression
- Student → Allowed interruptions: selects exceptions
- Student → Consent-aware ads: opts into rewards
- Consent-aware ads → Ad service: requests ads
