# gabe565/ascii-movie architecture

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

- Interactive diagram: https://gitdiagram.com/gabe565/ascii-movie
- Repository: https://github.com/gabe565/ascii-movie

## Overview

ASCII Movie is a Go CLI for listing and loading embedded or local ASCII movies, playing them interactively in a terminal, and serving streams over SSH and Telnet. The principal path is CLI dispatch → movie loading → player rendering, either locally or through a server session; server mode can also expose a metrics API queried by `get stream`. The README documents both server protocols and the interactive UI. Source excerpts establish the main calls; some server internals and movie-loading details are only indexed, so uncertain links are omitted.

Main entry points: [`cmd/cmd.go`](https://github.com/gabe565/ascii-movie/blob/main/cmd/cmd.go) (Command router), [`cmd/serve/cmd.go`](https://github.com/gabe565/ascii-movie/blob/main/cmd/serve/cmd.go) (Serve command), [`internal/player/player.go`](https://github.com/gabe565/ascii-movie/blob/main/internal/player/player.go) (Interactive player), [`cmd/play/cmd.go`](https://github.com/gabe565/ascii-movie/blob/main/cmd/play/cmd.go) (Local play)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI commands"]
  node_entry["Application entry<br/>[main.go]"]
  node_commands["Command router<br/>[cmd.go]"]
  node_playcmd["Local play<br/>[cmd.go]"]
  node_servecmd["Serve command<br/>[cmd.go]"]
  node_lscmd["Movie listing<br/>[cmd.go]"]
  node_getcmd["Metrics command<br/>[cmd.go]"]
  node_config["Runtime configuration"]
end

subgraph group_movie["Movie data"]
  node_movie_load["Movie loading<br/>[load.go]"]
  node_movie_file["Movie file handling<br/>[file.go]"]
  node_movie_info["Movie metadata<br/>[info.go]"]
  node_embedded[("Embedded movies<br/>[movies_plain.go]")]
end

subgraph group_playback["Playback UI"]
  node_player["Interactive player<br/>[player.go]"]
  node_player_styles["Player styles<br/>[styles.go]"]
end

subgraph group_servers["Streaming servers"]
  node_ssh["SSH streaming<br/>[ssh.go]"]
  node_telnet["Telnet streaming<br/>[telnet.go]"]
  node_server_core["Server configuration<br/>[server.go]"]
end

subgraph group_monitoring["Stream monitoring"]
  node_api["Metrics API<br/>[api.go]"]
  node_stream_metrics["Stream information<br/>[info.go]"]
end

node_user(("Terminal user"))
node_remote_client(("Remote client"))
node_http_service(("HTTP API client"))

node_user -->|"runs"| node_entry
node_entry -->|"creates"| node_commands
node_commands -->|"initializes"| node_config
node_commands -->|"registers"| node_playcmd
node_commands -->|"registers"| node_servecmd
node_commands -->|"registers"| node_lscmd
node_commands -.->|"registers"| node_getcmd
node_playcmd -->|"loads settings"| node_config
node_playcmd -->|"loads movie"| node_movie_load
node_playcmd -->|"starts playback"| node_player
node_servecmd -->|"loads settings"| node_config
node_servecmd -->|"loads movie"| node_movie_load
node_servecmd -->|"creates API"| node_api
node_servecmd -->|"starts listener"| node_ssh
node_servecmd -->|"starts listener"| node_telnet
node_lscmd -->|"reads metadata"| node_movie_info
node_movie_load -->|"reads embedded data"| node_embedded
node_movie_file -.->|"reads movie files"| node_embedded
node_player -->|"uses frames"| node_movie_load
node_player -->|"renders with"| node_player_styles
node_remote_client -->|"connects by SSH"| node_ssh
node_remote_client -->|"connects by Telnet"| node_telnet
node_ssh -->|"runs player"| node_player
node_telnet -->|"runs player"| node_player
node_ssh -.->|"uses server state"| node_server_core
node_telnet -.->|"uses server state"| node_server_core
node_api -.->|"serves metrics"| node_stream_metrics
node_http_service -->|"queries streams"| node_getcmd

click node_entry "https://github.com/gabe565/ascii-movie/blob/main/main.go"
click node_commands "https://github.com/gabe565/ascii-movie/blob/main/cmd/cmd.go"
click node_playcmd "https://github.com/gabe565/ascii-movie/blob/main/cmd/play/cmd.go"
click node_servecmd "https://github.com/gabe565/ascii-movie/blob/main/cmd/serve/cmd.go"
click node_lscmd "https://github.com/gabe565/ascii-movie/blob/main/cmd/ls/cmd.go"
click node_getcmd "https://github.com/gabe565/ascii-movie/blob/main/cmd/get/stream/cmd.go"
click node_config "https://github.com/gabe565/ascii-movie/tree/main/internal/config"
click node_movie_load "https://github.com/gabe565/ascii-movie/blob/main/internal/movie/load.go"
click node_movie_file "https://github.com/gabe565/ascii-movie/blob/main/internal/movie/file.go"
click node_movie_info "https://github.com/gabe565/ascii-movie/blob/main/internal/movie/info.go"
click node_embedded "https://github.com/gabe565/ascii-movie/blob/main/movies/movies_plain.go"
click node_player "https://github.com/gabe565/ascii-movie/blob/main/internal/player/player.go"
click node_player_styles "https://github.com/gabe565/ascii-movie/blob/main/internal/player/styles.go"
click node_ssh "https://github.com/gabe565/ascii-movie/blob/main/internal/server/ssh.go"
click node_telnet "https://github.com/gabe565/ascii-movie/blob/main/internal/server/telnet.go"
click node_server_core "https://github.com/gabe565/ascii-movie/blob/main/internal/server/server.go"
click node_api "https://github.com/gabe565/ascii-movie/blob/main/internal/server/api.go"
click node_stream_metrics "https://github.com/gabe565/ascii-movie/blob/main/internal/server/info.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_entry,node_commands,node_playcmd,node_servecmd,node_lscmd,node_getcmd,node_config,node_user,node_remote_client,node_http_service toneBlue
class node_movie_load,node_movie_file,node_movie_info,node_embedded toneAmber
class node_player,node_player_styles toneMint
class node_ssh,node_telnet,node_server_core toneRose
class node_api,node_stream_metrics toneIndigo
```

## Components

### CLI commands

- [Application entry](https://github.com/gabe565/ascii-movie/blob/main/main.go): `main.go`
- [Command router](https://github.com/gabe565/ascii-movie/blob/main/cmd/cmd.go): `cmd/cmd.go`
- [Local play](https://github.com/gabe565/ascii-movie/blob/main/cmd/play/cmd.go): `cmd/play/cmd.go`
- [Serve command](https://github.com/gabe565/ascii-movie/blob/main/cmd/serve/cmd.go): `cmd/serve/cmd.go`
- [Movie listing](https://github.com/gabe565/ascii-movie/blob/main/cmd/ls/cmd.go): `cmd/ls/cmd.go`
- [Metrics command](https://github.com/gabe565/ascii-movie/blob/main/cmd/get/stream/cmd.go): `cmd/get/stream/cmd.go`
- [Runtime configuration](https://github.com/gabe565/ascii-movie/tree/main/internal/config): `internal/config`

### Movie data

- [Movie loading](https://github.com/gabe565/ascii-movie/blob/main/internal/movie/load.go): `internal/movie/load.go`
- [Movie file handling](https://github.com/gabe565/ascii-movie/blob/main/internal/movie/file.go): `internal/movie/file.go`
- [Movie metadata](https://github.com/gabe565/ascii-movie/blob/main/internal/movie/info.go): `internal/movie/info.go`
- [Embedded movies](https://github.com/gabe565/ascii-movie/blob/main/movies/movies_plain.go): `movies/movies_plain.go`

### Playback UI

- [Interactive player](https://github.com/gabe565/ascii-movie/blob/main/internal/player/player.go): `internal/player/player.go`
- [Player styles](https://github.com/gabe565/ascii-movie/blob/main/internal/player/styles.go): `internal/player/styles.go`

### Streaming servers

- [SSH streaming](https://github.com/gabe565/ascii-movie/blob/main/internal/server/ssh.go): `internal/server/ssh.go`
- [Telnet streaming](https://github.com/gabe565/ascii-movie/blob/main/internal/server/telnet.go): `internal/server/telnet.go`
- [Server configuration](https://github.com/gabe565/ascii-movie/blob/main/internal/server/server.go): `internal/server/server.go`

### Stream monitoring

- [Metrics API](https://github.com/gabe565/ascii-movie/blob/main/internal/server/api.go): `internal/server/api.go`
- [Stream information](https://github.com/gabe565/ascii-movie/blob/main/internal/server/info.go): `internal/server/info.go`

### Other components

- **Terminal user**
- **Remote client**
- **HTTP API client**

## Connections

- Terminal user → Application entry: runs (evidence: `README.md`)
- Application entry → Command router: creates (evidence: `main.go`)
- Command router → Runtime configuration: initializes (evidence: `cmd/cmd.go`)
- Command router → Local play: registers (evidence: `cmd/cmd.go`)
- Command router → Serve command: registers (evidence: `cmd/cmd.go`)
- Command router → Movie listing: registers (evidence: `cmd/cmd.go`)
- Command router → Metrics command: registers (evidence: `cmd/cmd.go`)
- Local play → Runtime configuration: loads settings (evidence: `cmd/play/cmd.go`)
- Local play → Movie loading: loads movie (evidence: `cmd/play/cmd.go`)
- Local play → Interactive player: starts playback (evidence: `cmd/play/cmd.go`)
- Serve command → Runtime configuration: loads settings (evidence: `cmd/serve/cmd.go`)
- Serve command → Movie loading: loads movie (evidence: `cmd/serve/cmd.go`)
- Serve command → Metrics API: creates API (evidence: `cmd/serve/cmd.go`)
- Serve command → SSH streaming: starts listener (evidence: `cmd/serve/cmd.go`)
- Serve command → Telnet streaming: starts listener (evidence: `cmd/serve/cmd.go`)
- Movie listing → Movie metadata: reads metadata (evidence: `cmd/ls/cmd.go`)
- Movie loading → Embedded movies: reads embedded data (evidence: `internal/movie/load.go`)
- Movie file handling → Embedded movies: reads movie files (evidence: `internal/movie/file.go`)
- Interactive player → Movie loading: uses frames (evidence: `internal/player/player.go`)
- Interactive player → Player styles: renders with (evidence: `internal/player/player.go`)
- Remote client → SSH streaming: connects by SSH (evidence: `README.md`)
- Remote client → Telnet streaming: connects by Telnet (evidence: `README.md`)
- SSH streaming → Interactive player: runs player (evidence: `internal/server/ssh.go`)
- Telnet streaming → Interactive player: runs player (evidence: `internal/server/telnet.go`)
- SSH streaming → Server configuration: uses server state (evidence: `internal/server/ssh.go`)
- Telnet streaming → Server configuration: uses server state (evidence: `internal/server/telnet.go`)
- Metrics API → Stream information: serves metrics
- HTTP API client → Metrics command: queries streams (evidence: `cmd/get/stream/cmd.go`)
