# rycid/shortsify architecture

> Architecture diagram of the GitHub repository rycid/shortsify, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rycid/shortsify
- Repository: https://github.com/rycid/shortsify

## Overview

##### Project type and purpose
- From the README and file tree, “Shortsify” is a desktop video-processing app built on Electron (HTML/CSS/JS + Node.js) that wraps FFmpeg to convert landscape videos into vertical, mobile-ready formats.

##### File structure
- Top-level files:
- package.json / package-lock.json – Node/Electron metadata and dependencies
- index.html, styles.css – the renderer’s UI
- renderer.js – front-end logic running in the Renderer Process
- preload.js – safe bridge (context-isolated) exposing Node/IPC APIs to renderer
- main.js – the Electron Main Process (application lifecycle, menus, spawning jobs)
- ffmpeg/ffmpegT.exe – the bundled FFmpeg binary
- No separate “backend” server – all processing happens locally via Node child processes

##### README for additional insights
- Confirms Electron as platform (“Run in dev mode: npm run dev”), FFmpeg is invoked under the hood, and UI is minimal (“three buttons: select, process, save”).
- Mentions progress tracking (so the app listens to FFmpeg stdout/stderr), and future batch/multithreading.

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["User"]:::external

    subgraph "Renderer Process"
        direction TB
        UI["index.html"]:::frontend
        RendJS["renderer.js"]:::frontend
        CSS["styles.css"]:::frontend
    end

    Preload["preload.js"]:::frontend

    subgraph "Main Process"
        direction TB
        MainJS["main.js"]:::main
    end

    FFmpeg["FFmpeg Binary\nffmpegT.exe"]:::ext
    FS["File System"]:::fs
    Metadata["package.json\npackage-lock.json"]:::infra
    Doc["README.md"]:::infra
    GitIgnore[".gitignore"]:::infra

    User -->|"click buttons"| UI
    UI -.->|"ipcRenderer.send('select-video')"| Preload
    Preload -.->|"ipcMain.on('select-video')"| MainJS
    MainJS -->|"open dialog"| FS
    FS -->|"file path"| MainJS
    UI -.->|"ipcRenderer.send('process-video')"| Preload
    Preload -.->|"ipcMain.on('process-video')"| MainJS
    MainJS -->|"spawn ffmpeg -i input.mp4 ... "| FFmpeg
    FFmpeg -->|"stdout/stderr"| MainJS
    MainJS -.->|"ipcMain.emit('progress')"| Preload
    Preload -.->|"ipcRenderer.on('progress')"| UI
    MainJS -->|"write output"| FS
    FS -->|"output path"| MainJS

    Metadata -.-> MainJS
    Metadata -.-> UI
    Doc -.-> Metadata
    GitIgnore -.-> Metadata

    click UI "https://github.com/rycid/shortsify/blob/main/index.html"
    click RendJS "https://github.com/rycid/shortsify/blob/main/renderer.js"
    click CSS "https://github.com/rycid/shortsify/blob/main/styles.css"
    click Preload "https://github.com/rycid/shortsify/blob/main/preload.js"
    click MainJS "https://github.com/rycid/shortsify/blob/main/main.js"
    click FFmpeg "https://github.com/rycid/shortsify/blob/main/ffmpeg/ffmpegT.exe"
    click Metadata "https://github.com/rycid/shortsify/blob/main/package.json"
    click GitIgnore "https://github.com/rycid/shortsify/blob/main/.gitignore"
    click Doc "https://github.com/rycid/shortsify/blob/main/README.md"

    classDef external fill:#eef,stroke:#77f,stroke-width:1px;
    classDef frontend fill:#ddf,stroke:#55f,stroke-width:1px;
    classDef main fill:#dfd,stroke:#5a5,stroke-width:1px;
    classDef ext fill:#fed,stroke:#f95,stroke-width:1px;
    classDef fs fill:#eee,stroke:#999,stroke-width:1px;
    classDef infra fill:#f9f,stroke:#c3c,stroke-width:1px;
```
