# raand0/minical architecture

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

- Interactive diagram: https://gitdiagram.com/raand0/minical
- Repository: https://github.com/raand0/minical

## Overview

Minical is a lightweight terminal calendar for navigating months and years; it does not manage events or reminders. The main workflow starts the CLI, prepares user configuration, initializes a terminal screen, then handles navigation and renders the selected calendar. Separate CLI options print today’s date or generate a default config. The README documents these capabilities; source excerpts show the main calls and rendering/configuration flow, but not every runtime detail.

Main entry points: [`src/loadConfig.go`](https://github.com/raand0/minical/blob/master/src/loadConfig.go) (Config lifecycle), [`src/main.go`](https://github.com/raand0/minical/blob/master/src/main.go) (Application entry), [`src/renderer.go`](https://github.com/raand0/minical/blob/master/src/renderer.go) (Screen renderer), [`src/cmd.go`](https://github.com/raand0/minical/blob/master/src/cmd.go) (CLI options)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI entry"]
  node_main["Application entry<br/>[main.go]"]
  node_cli["CLI options<br/>[cmd.go]"]
  node_date["Date output<br/>[cmd.go]"]
end

subgraph group_configuration["User configuration"]
  node_config_file["User config file"]
  node_config_lifecycle["Config lifecycle<br/>[loadConfig.go]"]
  node_config_parser["Config parser<br/>[parser.go]"]
  node_color_settings["Color settings<br/>[loadConfig.go]"]
end

subgraph group_navigation["Calendar navigation"]
  node_terminal_loop["Terminal event loop<br/>[terminal.go]"]
  node_calendar_grid["Calendar grid<br/>[renderer.go]"]
  node_grid_cache["Grid cache<br/>[renderer.go]"]
end

subgraph group_display["Terminal display"]
  node_screen_render["Screen renderer<br/>[renderer.go]"]
  node_header["Header rendering<br/>[renderer.go]"]
  node_calendar_view["Calendar rendering<br/>[renderer.go]"]
  node_footer["Footer rendering<br/>[renderer.go]"]
  node_text_drawing["Text drawing<br/>[terminal.go]"]
end

node_user(("User"))

node_user -->|"runs calendar"| node_main
node_main -->|"parses options"| node_cli
node_main -->|"checks config"| node_config_lifecycle
node_main -->|"starts interface"| node_terminal_loop
node_cli -->|"prints date"| node_date
node_cli -->|"generates config"| node_config_lifecycle
node_config_lifecycle -->|"creates or opens"| node_config_file
node_config_lifecycle -->|"parses file"| node_config_parser
node_config_lifecycle -->|"parses colors"| node_color_settings
node_terminal_loop -->|"renders view"| node_screen_render
node_screen_render -->|"renders header"| node_header
node_screen_render -->|"renders calendar"| node_calendar_view
node_screen_render -->|"renders footer"| node_footer
node_calendar_view -->|"gets grid"| node_grid_cache
node_grid_cache -->|"populates grid"| node_calendar_grid
node_header -->|"draws text"| node_text_drawing
node_calendar_view -->|"draws text"| node_text_drawing
node_footer -->|"draws text"| node_text_drawing

click node_main "https://github.com/raand0/minical/blob/master/src/main.go"
click node_cli "https://github.com/raand0/minical/blob/master/src/cmd.go"
click node_date "https://github.com/raand0/minical/blob/master/src/cmd.go"
click node_config_lifecycle "https://github.com/raand0/minical/blob/master/src/loadConfig.go"
click node_config_parser "https://github.com/raand0/minical/blob/master/src/parser.go"
click node_color_settings "https://github.com/raand0/minical/blob/master/src/loadConfig.go"
click node_terminal_loop "https://github.com/raand0/minical/blob/master/src/terminal.go"
click node_calendar_grid "https://github.com/raand0/minical/blob/master/src/renderer.go"
click node_grid_cache "https://github.com/raand0/minical/blob/master/src/renderer.go"
click node_screen_render "https://github.com/raand0/minical/blob/master/src/renderer.go"
click node_header "https://github.com/raand0/minical/blob/master/src/renderer.go"
click node_calendar_view "https://github.com/raand0/minical/blob/master/src/renderer.go"
click node_footer "https://github.com/raand0/minical/blob/master/src/renderer.go"
click node_text_drawing "https://github.com/raand0/minical/blob/master/src/terminal.go"

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_cli,node_date,node_user toneBlue
class node_config_file,node_config_lifecycle,node_config_parser,node_color_settings toneAmber
class node_terminal_loop,node_calendar_grid,node_grid_cache toneMint
class node_screen_render,node_header,node_calendar_view,node_footer,node_text_drawing toneRose
```

## Components

### CLI entry

- [Application entry](https://github.com/raand0/minical/blob/master/src/main.go): `src/main.go`
- [CLI options](https://github.com/raand0/minical/blob/master/src/cmd.go): `src/cmd.go`
- [Date output](https://github.com/raand0/minical/blob/master/src/cmd.go): `src/cmd.go`

### User configuration

- **User config file**
- [Config lifecycle](https://github.com/raand0/minical/blob/master/src/loadConfig.go): `src/loadConfig.go`
- [Config parser](https://github.com/raand0/minical/blob/master/src/parser.go): `src/parser.go`
- [Color settings](https://github.com/raand0/minical/blob/master/src/loadConfig.go): `src/loadConfig.go`

### Calendar navigation

- [Terminal event loop](https://github.com/raand0/minical/blob/master/src/terminal.go): `src/terminal.go`
- [Calendar grid](https://github.com/raand0/minical/blob/master/src/renderer.go): `src/renderer.go`
- [Grid cache](https://github.com/raand0/minical/blob/master/src/renderer.go): `src/renderer.go`

### Terminal display

- [Screen renderer](https://github.com/raand0/minical/blob/master/src/renderer.go): `src/renderer.go`
- [Header rendering](https://github.com/raand0/minical/blob/master/src/renderer.go): `src/renderer.go`
- [Calendar rendering](https://github.com/raand0/minical/blob/master/src/renderer.go): `src/renderer.go`
- [Footer rendering](https://github.com/raand0/minical/blob/master/src/renderer.go): `src/renderer.go`
- [Text drawing](https://github.com/raand0/minical/blob/master/src/terminal.go): `src/terminal.go`

### Other components

- **User**

## Connections

- User → Application entry: runs calendar (evidence: `README.md`)
- Application entry → CLI options: parses options (evidence: `src/main.go`)
- Application entry → Config lifecycle: checks config (evidence: `src/main.go`)
- Application entry → Terminal event loop: starts interface (evidence: `src/main.go`)
- CLI options → Date output: prints date (evidence: `src/cmd.go`)
- CLI options → Config lifecycle: generates config (evidence: `src/cmd.go`)
- Config lifecycle → User config file: creates or opens (evidence: `src/loadConfig.go`)
- Config lifecycle → Config parser: parses file (evidence: `src/loadConfig.go`)
- Config lifecycle → Color settings: parses colors (evidence: `src/loadConfig.go`)
- Terminal event loop → Screen renderer: renders view (evidence: `src/terminal.go`)
- Screen renderer → Header rendering: renders header (evidence: `src/renderer.go`)
- Screen renderer → Calendar rendering: renders calendar (evidence: `src/renderer.go`)
- Screen renderer → Footer rendering: renders footer (evidence: `src/renderer.go`)
- Calendar rendering → Grid cache: gets grid (evidence: `src/renderer.go`)
- Grid cache → Calendar grid: populates grid (evidence: `src/renderer.go`)
- Header rendering → Text drawing: draws text (evidence: `src/renderer.go`)
- Calendar rendering → Text drawing: draws text (evidence: `src/renderer.go`)
- Footer rendering → Text drawing: draws text (evidence: `src/renderer.go`)
