# dkssvp/day12-developer-focus-timeline-extraction architecture

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

- Interactive diagram: https://gitdiagram.com/dkssvp/day12-developer-focus-timeline-extraction
- Repository: https://github.com/dkssvp/day12-developer-focus-timeline-extraction

## Overview

A small Python utility that queries ActivityWatch for foreground-window and AFK events, estimates developer-application focus time over a selected period, and prints and saves a JSON summary. The single source file contains the workflow and interval calculations; the output file is a generated report, not an implemented runtime subsystem. Relationships shown are supported by the inspected source.

Main entry points: [`focus_tracker.py`](https://github.com/dkssvp/day12-developer-focus-timeline-extraction/blob/feature/day12-developer-focus-timeline/focus_tracker.py) (Focus tracker), [`focus_summary.json`](https://github.com/dkssvp/day12-developer-focus-timeline-extraction/blob/feature/day12-developer-focus-timeline/focus_summary.json) (JSON report)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Focus analysis"]
  node_tracker["Focus tracker<br/>[focus_tracker.py]"]
  node_report["JSON report<br/>[focus_summary.json]"]
end

node_user(("User"))
node_aw["ActivityWatch"]

node_user -->|"runs"| node_tracker
node_tracker -->|"requests events"| node_aw
node_tracker -->|"writes summary"| node_report

click node_tracker "https://github.com/dkssvp/day12-developer-focus-timeline-extraction/blob/feature/day12-developer-focus-timeline/focus_tracker.py"
click node_report "https://github.com/dkssvp/day12-developer-focus-timeline-extraction/blob/feature/day12-developer-focus-timeline/focus_summary.json"

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_tracker,node_report,node_user toneBlue
class node_aw toneIndigo
```

## Components

### Focus analysis

- [Focus tracker](https://github.com/dkssvp/day12-developer-focus-timeline-extraction/blob/feature/day12-developer-focus-timeline/focus_tracker.py): `focus_tracker.py`
- [JSON report](https://github.com/dkssvp/day12-developer-focus-timeline-extraction/blob/feature/day12-developer-focus-timeline/focus_summary.json): `focus_summary.json`

### Other components

- **User**
- **ActivityWatch**

## Connections

- User → Focus tracker: runs (evidence: `focus_tracker.py`)
- Focus tracker → ActivityWatch: requests events (evidence: `focus_tracker.py`)
- Focus tracker → JSON report: writes summary (evidence: `focus_tracker.py`)
