# rlynx0/timetrack architecture

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

- Interactive diagram: https://gitdiagram.com/rlynx0/timetrack
- Repository: https://github.com/rlynx0/timetrack

## Overview

timetrack is a command-line time tracker. Users start and end named activities, then inspect recorded time or generate a configured export. The map also includes activity-catalog management and attendance/configuration support. The excerpts show command dispatch, log reconstruction, grouping, and export behavior; unsampled command and storage details are represented only where the tree or CLI declarations support them.

Main entry points: [`src/main.rs`](https://github.com/rlynx0/timetrack/blob/master/src/main.rs) (Command dispatch), [`src/entry_commands/generate.rs`](https://github.com/rlynx0/timetrack/blob/master/src/entry_commands/generate.rs) (Generate export), [`src/entry_commands.rs`](https://github.com/rlynx0/timetrack/blob/master/src/entry_commands.rs) (Entry commands), [`src/entry_commands/show.rs`](https://github.com/rlynx0/timetrack/blob/master/src/entry_commands/show.rs) (Show activities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI and commands"]
  node_cli_args["Command options<br/>[cli.rs]"]
  node_dispatch["Command dispatch<br/>[main.rs]"]
end

subgraph group_tracking["Time tracking"]
  node_entry_commands["Entry commands<br/>[entry_commands.rs]"]
  node_entry_model["Entry model<br/>[activity_entry.rs]"]
  node_activity_range["Time ranges<br/>[activity_range.rs]"]
  node_entry_store[("Time entry log<br/>[files.rs]")]
end

subgraph group_catalog["Catalog and configuration"]
  node_activity_commands["Activity commands"]
  node_activity_tree["Activity hierarchy<br/>[trackable.rs]"]
  node_config["User configuration<br/>[config.rs]"]
  node_config_setup["Config setup<br/>[main.rs]"]
end

subgraph group_outputs["Reports and export"]
  node_show["Show activities<br/>[show.rs]"]
  node_grouping["Activity grouping"]
  node_generate["Generate export<br/>[generate.rs]"]
  node_format_string["Format templates<br/>[format_string.rs]"]
end

node_user(("Terminal user"))
node_terminal(("Terminal output"))
node_export_file["Generated file"]

node_user -->|"provides options"| node_cli_args
node_cli_args -->|"parsed by"| node_dispatch
node_dispatch -->|"dispatches tracking"| node_entry_commands
node_dispatch -->|"dispatches show"| node_show
node_dispatch -->|"dispatches export"| node_generate
node_dispatch -->|"dispatches catalog"| node_activity_commands
node_dispatch -->|"dispatches setup"| node_config_setup
node_entry_commands -->|"reads and writes log"| node_entry_store
node_entry_commands -->|"builds tracked activities"| node_entry_model
node_entry_commands -->|"filters by range"| node_activity_range
node_activity_commands -->|"reads activity file"| node_entry_store
node_activity_commands -->|"builds hierarchy"| node_activity_tree
node_entry_commands -->|"resolves activity"| node_activity_tree
node_dispatch -->|"loads configuration"| node_config
node_config_setup -->|"creates configuration"| node_config
node_show -->|"requests activities"| node_entry_commands
node_show -->|"groups activity data"| node_grouping
node_show -->|"reads attendance labels"| node_config
node_show -->|"prints report"| node_terminal
node_generate -->|"requests recent activities"| node_entry_commands
node_generate -->|"collapses activities"| node_grouping
node_generate -->|"reads export settings"| node_config
node_generate -->|"evaluates templates"| node_format_string
node_generate -->|"prints or confirms"| node_terminal
node_generate -->|"writes export"| node_export_file
node_user -->|"views output"| node_terminal

click node_cli_args "https://github.com/rlynx0/timetrack/blob/master/src/cli.rs"
click node_dispatch "https://github.com/rlynx0/timetrack/blob/master/src/main.rs"
click node_entry_commands "https://github.com/rlynx0/timetrack/blob/master/src/entry_commands.rs"
click node_entry_model "https://github.com/rlynx0/timetrack/blob/master/src/activity_entry.rs"
click node_activity_range "https://github.com/rlynx0/timetrack/blob/master/src/activity_range.rs"
click node_entry_store "https://github.com/rlynx0/timetrack/blob/master/src/files.rs"
click node_activity_commands "https://github.com/rlynx0/timetrack/blob/master/src/activity_commands.rs"
click node_activity_tree "https://github.com/rlynx0/timetrack/blob/master/src/trackable.rs"
click node_config "https://github.com/rlynx0/timetrack/blob/master/src/config.rs"
click node_config_setup "https://github.com/rlynx0/timetrack/blob/master/src/main.rs"
click node_show "https://github.com/rlynx0/timetrack/blob/master/src/entry_commands/show.rs"
click node_grouping "https://github.com/rlynx0/timetrack/blob/master/src/activity_entry/activity_groupings.rs"
click node_generate "https://github.com/rlynx0/timetrack/blob/master/src/entry_commands/generate.rs"
click node_format_string "https://github.com/rlynx0/timetrack/blob/master/src/format_string.rs"

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_cli_args,node_dispatch,node_user toneBlue
class node_entry_commands,node_entry_model,node_activity_range,node_entry_store toneAmber
class node_activity_commands,node_activity_tree,node_config,node_config_setup toneMint
class node_show,node_grouping,node_generate,node_format_string toneRose
class node_terminal,node_export_file toneIndigo
```

## Components

### CLI and commands

- [Command options](https://github.com/rlynx0/timetrack/blob/master/src/cli.rs): `src/cli.rs`
- [Command dispatch](https://github.com/rlynx0/timetrack/blob/master/src/main.rs): `src/main.rs`

### Time tracking

- [Entry commands](https://github.com/rlynx0/timetrack/blob/master/src/entry_commands.rs): `src/entry_commands.rs`
- [Entry model](https://github.com/rlynx0/timetrack/blob/master/src/activity_entry.rs): `src/activity_entry.rs`
- [Time ranges](https://github.com/rlynx0/timetrack/blob/master/src/activity_range.rs): `src/activity_range.rs`
- [Time entry log](https://github.com/rlynx0/timetrack/blob/master/src/files.rs): `src/files.rs`

### Catalog and configuration

- [Activity commands](https://github.com/rlynx0/timetrack/blob/master/src/activity_commands.rs): `src/activity_commands.rs`
- [Activity hierarchy](https://github.com/rlynx0/timetrack/blob/master/src/trackable.rs): `src/trackable.rs`
- [User configuration](https://github.com/rlynx0/timetrack/blob/master/src/config.rs): `src/config.rs`
- [Config setup](https://github.com/rlynx0/timetrack/blob/master/src/main.rs): `src/main.rs`

### Reports and export

- [Show activities](https://github.com/rlynx0/timetrack/blob/master/src/entry_commands/show.rs): `src/entry_commands/show.rs`
- [Activity grouping](https://github.com/rlynx0/timetrack/blob/master/src/activity_entry/activity_groupings.rs): `src/activity_entry/activity_groupings.rs`
- [Generate export](https://github.com/rlynx0/timetrack/blob/master/src/entry_commands/generate.rs): `src/entry_commands/generate.rs`
- [Format templates](https://github.com/rlynx0/timetrack/blob/master/src/format_string.rs): `src/format_string.rs`

### Other components

- **Terminal user**
- **Terminal output**
- **Generated file**

## Connections

- Terminal user → Command options: provides options
- Command options → Command dispatch: parsed by
- Command dispatch → Entry commands: dispatches tracking
- Command dispatch → Show activities: dispatches show
- Command dispatch → Generate export: dispatches export
- Command dispatch → Activity commands: dispatches catalog
- Command dispatch → Config setup: dispatches setup
- Entry commands → Time entry log: reads and writes log
- Entry commands → Entry model: builds tracked activities
- Entry commands → Time ranges: filters by range
- Activity commands → Time entry log: reads activity file
- Activity commands → Activity hierarchy: builds hierarchy
- Entry commands → Activity hierarchy: resolves activity
- Command dispatch → User configuration: loads configuration
- Config setup → User configuration: creates configuration
- Show activities → Entry commands: requests activities
- Show activities → Activity grouping: groups activity data
- Show activities → User configuration: reads attendance labels
- Show activities → Terminal output: prints report
- Generate export → Entry commands: requests recent activities
- Generate export → Activity grouping: collapses activities
- Generate export → User configuration: reads export settings
- Generate export → Format templates: evaluates templates
- Generate export → Terminal output: prints or confirms
- Generate export → Generated file: writes export
- Terminal user → Terminal output: views output
