# minightdev/autoshorts architecture

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

- Interactive diagram: https://gitdiagram.com/minightdev/autoshorts
- Repository: https://github.com/minightdev/autoshorts

## Overview

##### Project type and purpose
- Autoshorts AI is a full-stack web application that ingests long videos (from uploads or third-party sources), runs AI-powered video analysis & editing, and delivers short, shareable clips with effects, captions, and metadata.
- Key use cases: automatic highlight extraction, face tracking, captioning, branded effects, subscription-based usage, cloud storage, and social-media scheduling.

##### (implied) file structure
- Top level:
- app/ or src/ – contains the Python Flask application code (routes, business logic, AI pipelines)
- templates/ – HTML templates using Bootstrap & jQuery for the UI
- static/ – CSS, JS, images, Font-Awesome, custom styles & scripts
- config/ – Nginx, Gunicorn, Flask settings (environment, secrets, database URIs)
- services/ or workers/ – modules invoking OpenAI Whisper/GPT, Dlib, FFmpeg/MoviePy, OpenCV, ImageMagick, Twitch-dl, Pytube
- tasks/ – background/video-processing task definitions (could be Celery or RQ)
- tests/ – unit and integration tests
- requirements.txt / Pipfile – Python dependencies
- Dockerfile / docker-compose.yml (optional) – deployment definitions
- README.md – project overview

##### README for additional insights
- Tech stack: Nginx ➔ Gunicorn ➔ Flask, MySQL, Wasabi cloud, AI libraries (Whisper, GPT), video libs, payment SDKs, reCAPTCHA
- Features: authentication, subscription/credits, affiliate system, notifications, scheduling uploads

##### Elements
- Clear labels for each component (e.g., “Flask API”, “Video Processor Worker”)
- UI components (blue)
- Backend services (green)
- Workers/asynchronous (orange)
- External 3rd-party services (gray)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client/UI Layer
    subgraph "Client/UI Layer"
        Browser["Browser/Mobile UI"]:::ui
    end

    %% Web/API Layer
    subgraph "Web/API Layer"
        Nginx["Nginx (Reverse Proxy)"]:::backend
        Gunicorn["Gunicorn (WSGI)"]:::backend
        Flask["Flask Backend"]:::backend
    end

    %% Background/Worker Layer
    subgraph "Background/Worker Layer"
        Processor["Video Processor Worker"]:::worker
        Scheduler["Social Scheduler Daemon"]:::worker
    end

    %% Data Layer
    subgraph "Data Layer"
        MySQL["MySQL Database"]:::data
        Wasabi["Wasabi Object Storage"]:::data
    end

    %% External Services
    subgraph "External Services"
        OpenAI["OpenAI APIs"]:::external
        Payments["Stripe/PayPal Payment Gateways"]:::external
        Recaptcha["Google reCAPTCHA"]:::external
        SocialAPI["Social Media Platform APIs"]:::external
    end

    %% Documentation
    Doc["README.md"]:::doc

    %% Connections
    Browser -->|"HTTPS"| Nginx
    Nginx --> Gunicorn
    Gunicorn --> Flask
    Flask -->|"Auth/Queries"| MySQL
    Flask -->|"Upload & Download"| Wasabi
    Flask -->|"Validate User"| Recaptcha
    Flask -->|"Payment Flow"| Payments
    Flask -->|"Invoke AI"| OpenAI
    Flask -->|"Enqueue Job"| Processor
    Processor -->|"Transcribe/Summarize"| OpenAI
    Processor -->|"Store Clips"| Wasabi
    Processor -->|"Update Metadata"| MySQL
    Processor -->|"Notify User"| Flask
    Flask -->|"Schedule Post"| Scheduler
    Scheduler -->|"Post Content"| SocialAPI
    Scheduler -->|"Update Status"| MySQL

    %% Click Events
    click Doc "https://github.com/minightdev/autoshorts/blob/main/README.md"

    %% Styles
    classDef ui fill:#D6E9FE,stroke:#000,stroke-width:1px
    classDef backend fill:#DFF2BF,stroke:#000,stroke-width:1px
    classDef worker fill:#FFE4B5,stroke:#000,stroke-width:1px
    classDef data fill:#E3E4FA,stroke:#000,stroke-width:1px
    classDef external fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef doc fill:#F0F0F0,stroke:#000,stroke-width:1px
```
