# soloofboom/rifterm architecture

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

- Interactive diagram: https://gitdiagram.com/soloofboom/rifterm
- Repository: https://github.com/soloofboom/rifterm

## Overview

rifterm is a terminal client for RIF market data. Users save an API key, then check its validity and quota or request Heat Index and pépites data over a chosen day window. Those data commands use a five-minute local cache unless disabled, then render either rich terminal tables or raw JSON. The README also documents cache controls and quota behavior. The tree and sampled source support no separate report workflow; report is only a roadmap item.

Main entry points: [`src/rifterm/cli.py`](https://github.com/soloofboom/rifterm/blob/main/src/rifterm/cli.py) (CLI commands), [`src/rifterm/client.py`](https://github.com/soloofboom/rifterm/blob/main/src/rifterm/client.py) (HTTP client), [`src/rifterm/cache.py`](https://github.com/soloofboom/rifterm/blob/main/src/rifterm/cache.py) (TTL cache), [`src/rifterm/config.py`](https://github.com/soloofboom/rifterm/blob/main/src/rifterm/config.py) (API key config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_commands["CLI commands"]
  node_cli["CLI commands<br/>[cli.py]"]
end

subgraph group_data["Market data"]
  node_client["HTTP client<br/>[client.py]"]
  node_api["RIF API"]
end

subgraph group_local["Local state"]
  node_config["API key config<br/>[config.py]"]
  node_config_store[("Config file<br/>[config.py]")]
  node_cache["TTL cache<br/>[cache.py]"]
  node_cache_store[("Cached payloads<br/>[cache.py]")]
end

subgraph group_output["Output"]
  node_render["Heat and pépites rendering<br/>[render.py]"]
end

node_user(("User"))
node_terminal(("Terminal output"))

node_user -->|"runs commands"| node_cli
node_cli -->|"saves or loads key"| node_config
node_config -->|"reads and writes"| node_config_store
node_cli -->|"fetches market data"| node_cache
node_cache -->|"reads and writes"| node_cache_store
node_cache -->|"miss calls"| node_client
node_cli -->|"checks status"| node_client
node_client -->|"sends GET"| node_api
node_api -->|"returns response"| node_client
node_cache -->|"returns payload"| node_cli
node_client -->|"returns status response"| node_cli
node_cli -->|"renders payload"| node_render
node_render -->|"prints tables or JSON"| node_terminal

click node_cli "https://github.com/soloofboom/rifterm/blob/main/src/rifterm/cli.py"
click node_config "https://github.com/soloofboom/rifterm/blob/main/src/rifterm/config.py"
click node_config_store "https://github.com/soloofboom/rifterm/blob/main/src/rifterm/config.py"
click node_cache "https://github.com/soloofboom/rifterm/blob/main/src/rifterm/cache.py"
click node_cache_store "https://github.com/soloofboom/rifterm/blob/main/src/rifterm/cache.py"
click node_client "https://github.com/soloofboom/rifterm/blob/main/src/rifterm/client.py"
click node_render "https://github.com/soloofboom/rifterm/blob/main/src/rifterm/render.py"

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,node_user toneBlue
class node_client,node_api toneAmber
class node_config,node_config_store,node_cache,node_cache_store toneMint
class node_render toneRose
class node_terminal toneIndigo
```

## Components

### CLI commands

- [CLI commands](https://github.com/soloofboom/rifterm/blob/main/src/rifterm/cli.py): `src/rifterm/cli.py`

### Market data

- [HTTP client](https://github.com/soloofboom/rifterm/blob/main/src/rifterm/client.py): `src/rifterm/client.py`
- **RIF API**

### Local state

- [API key config](https://github.com/soloofboom/rifterm/blob/main/src/rifterm/config.py): `src/rifterm/config.py`
- [Config file](https://github.com/soloofboom/rifterm/blob/main/src/rifterm/config.py): `src/rifterm/config.py`
- [TTL cache](https://github.com/soloofboom/rifterm/blob/main/src/rifterm/cache.py): `src/rifterm/cache.py`
- [Cached payloads](https://github.com/soloofboom/rifterm/blob/main/src/rifterm/cache.py): `src/rifterm/cache.py`

### Output

- [Heat and pépites rendering](https://github.com/soloofboom/rifterm/blob/main/src/rifterm/render.py): `src/rifterm/render.py`

### Other components

- **User**
- **Terminal output**

## Connections

- User → CLI commands: runs commands
- CLI commands → API key config: saves or loads key
- API key config → Config file: reads and writes
- CLI commands → TTL cache: fetches market data
- TTL cache → Cached payloads: reads and writes
- TTL cache → HTTP client: miss calls
- CLI commands → HTTP client: checks status
- HTTP client → RIF API: sends GET
- RIF API → HTTP client: returns response
- TTL cache → CLI commands: returns payload
- HTTP client → CLI commands: returns status response
- CLI commands → Heat and pépites rendering: renders payload
- Heat and pépites rendering → Terminal output: prints tables or JSON
