# scottinp/downframe architecture

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

- Interactive diagram: https://gitdiagram.com/scottinp/downframe
- Repository: https://github.com/scottinp/downframe

## Overview

Downframe is a browser-based After Effects preset and project downgrader. A visitor selects or drops files; the page reads and identifies them, surfaces third-party effects, offers supported older targets, converts and checks results, then downloads one file or a ZIP. Conversion runs locally, while an optional server endpoint maintains a public conversion count. The graph reflects the shown call sites and README workflow; converter internals are grouped because detection, rewriting, and validation share one source file.

Main entry points: [`src/main.ts`](https://github.com/scottinp/downframe/blob/main/src/main.ts) (Page workflow), [`src/ui/reveal.ts`](https://github.com/scottinp/downframe/blob/main/src/ui/reveal.ts) (Section reveal), [`api/count.ts`](https://github.com/scottinp/downframe/blob/main/api/count.ts) (Count endpoint), [`src/converter/index.ts`](https://github.com/scottinp/downframe/blob/main/src/converter/index.ts) (Format conversion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Conversion workflow"]
  node_app["Page workflow<br/>[main.ts]"]
  node_file_read["File intake<br/>[main.ts]"]
  node_effect_scan["Plugin effects<br/>[index.ts]"]
  node_zip["Batch ZIP<br/>[zip.ts]"]
  node_download["Browser download<br/>[main.ts]"]
end

subgraph group_engine["Binary conversion"]
  node_conversion["Format conversion<br/>[index.ts]"]
end

subgraph group_interface["Page interface"]
  node_byte_strip["Byte animation<br/>[byte-strip.ts]"]
  node_keyframe_grid["Keyframe canvas<br/>[keyframe-grid.ts]"]
  node_reveal["Section reveal<br/>[reveal.ts]"]
end

subgraph group_counter["Public counter"]
  node_counter_api["Count endpoint<br/>[count.ts]"]
end

node_visitor(("Visitor"))
node_redis[("Redis counter")]

node_visitor -->|"selects files"| node_app
node_app -->|"loads files"| node_file_read
node_file_read -->|"detects format"| node_conversion
node_file_read -->|"scans effects"| node_effect_scan
node_app -->|"converts files"| node_conversion
node_app -->|"builds batch"| node_zip
node_app -->|"starts download"| node_download
node_app -->|"fetches total"| node_counter_api
node_counter_api -->|"reads or increments"| node_redis
node_app -->|"loads animation"| node_byte_strip
node_app -->|"loads canvas"| node_keyframe_grid
node_app -->|"loads reveal"| node_reveal
node_reveal -->|"signals reveal"| node_byte_strip

click node_app "https://github.com/scottinp/downframe/blob/main/src/main.ts"
click node_file_read "https://github.com/scottinp/downframe/blob/main/src/main.ts"
click node_effect_scan "https://github.com/scottinp/downframe/blob/main/src/converter/index.ts"
click node_conversion "https://github.com/scottinp/downframe/blob/main/src/converter/index.ts"
click node_zip "https://github.com/scottinp/downframe/blob/main/src/zip.ts"
click node_download "https://github.com/scottinp/downframe/blob/main/src/main.ts"
click node_counter_api "https://github.com/scottinp/downframe/blob/main/api/count.ts"
click node_byte_strip "https://github.com/scottinp/downframe/blob/main/src/ui/byte-strip.ts"
click node_keyframe_grid "https://github.com/scottinp/downframe/blob/main/src/ui/keyframe-grid.ts"
click node_reveal "https://github.com/scottinp/downframe/blob/main/src/ui/reveal.ts"

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_app,node_file_read,node_effect_scan,node_zip,node_download toneBlue
class node_conversion,node_redis toneAmber
class node_byte_strip,node_keyframe_grid,node_reveal toneMint
class node_counter_api toneRose
class node_visitor toneIndigo
```

## Components

### Conversion workflow

- [Page workflow](https://github.com/scottinp/downframe/blob/main/src/main.ts): `src/main.ts`
- [File intake](https://github.com/scottinp/downframe/blob/main/src/main.ts): `src/main.ts`
- [Plugin effects](https://github.com/scottinp/downframe/blob/main/src/converter/index.ts): `src/converter/index.ts`
- [Batch ZIP](https://github.com/scottinp/downframe/blob/main/src/zip.ts): `src/zip.ts`
- [Browser download](https://github.com/scottinp/downframe/blob/main/src/main.ts): `src/main.ts`

### Binary conversion

- [Format conversion](https://github.com/scottinp/downframe/blob/main/src/converter/index.ts): `src/converter/index.ts`

### Page interface

- [Byte animation](https://github.com/scottinp/downframe/blob/main/src/ui/byte-strip.ts): `src/ui/byte-strip.ts`
- [Keyframe canvas](https://github.com/scottinp/downframe/blob/main/src/ui/keyframe-grid.ts): `src/ui/keyframe-grid.ts`
- [Section reveal](https://github.com/scottinp/downframe/blob/main/src/ui/reveal.ts): `src/ui/reveal.ts`

### Public counter

- [Count endpoint](https://github.com/scottinp/downframe/blob/main/api/count.ts): `api/count.ts`

### Other components

- **Visitor**
- **Redis counter**

## Connections

- Visitor → Page workflow: selects files (evidence: `README.md`)
- Page workflow → File intake: loads files (evidence: `src/main.ts`)
- File intake → Format conversion: detects format (evidence: `src/main.ts`)
- File intake → Plugin effects: scans effects (evidence: `src/main.ts`)
- Page workflow → Format conversion: converts files (evidence: `src/main.ts`)
- Page workflow → Batch ZIP: builds batch (evidence: `src/main.ts`)
- Page workflow → Browser download: starts download (evidence: `src/main.ts`)
- Page workflow → Count endpoint: fetches total (evidence: `src/main.ts`)
- Count endpoint → Redis counter: reads or increments (evidence: `api/count.ts`)
- Page workflow → Byte animation: loads animation (evidence: `src/main.ts`)
- Page workflow → Keyframe canvas: loads canvas (evidence: `src/main.ts`)
- Page workflow → Section reveal: loads reveal (evidence: `src/main.ts`)
- Section reveal → Byte animation: signals reveal (evidence: `src/ui/reveal.ts`)
