# gristlabs/frame-order architecture

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

- Interactive diagram: https://gitdiagram.com/gristlabs/frame-order
- Repository: https://github.com/gristlabs/frame-order

## Overview

This is a small Node.js command-line solution to the frame-ordering task. It reads PNG filenames from the supplied video directory (defaulting to /frames), sorts them lexically, reverses that list, and prints each name to standard output. The implementation does not inspect image content, so the example's visual sequence and real-video ordering are not inferred. The workflow and edges below are limited to the README and the excerpted runtime source.

Main entry points: [`order.js`](https://github.com/gristlabs/frame-order/blob/main/order.js) (Order CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Frame ordering runtime"]
  node_cli["Order CLI<br/>[order.js]"]
  node_names["Sorted frame names<br/>[order.js]"]
end

node_user(("Video input"))
node_frames[("Frame directory")]
node_stdout(("Standard output"))

node_user -->|"provides frames"| node_frames
node_frames -->|"reads names"| node_cli
node_cli -->|"sorts and reverses"| node_names
node_names -->|"prints names"| node_stdout

click node_cli "https://github.com/gristlabs/frame-order/blob/main/order.js"
click node_names "https://github.com/gristlabs/frame-order/blob/main/order.js"

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_names toneBlue
class node_user,node_stdout toneIndigo
class node_frames toneAmber
```

## Components

### Frame ordering runtime

- [Order CLI](https://github.com/gristlabs/frame-order/blob/main/order.js): `order.js`
- [Sorted frame names](https://github.com/gristlabs/frame-order/blob/main/order.js): `order.js`

### Other components

- **Video input**
- **Frame directory**
- **Standard output**

## Connections

- Video input → Frame directory: provides frames (evidence: `README.md`)
- Frame directory → Order CLI: reads names (evidence: `order.js`)
- Order CLI → Sorted frame names: sorts and reverses (evidence: `order.js`)
- Sorted frame names → Standard output: prints names (evidence: `order.js`)
