# natanmiuz/nonet architecture

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

- Interactive diagram: https://gitdiagram.com/natanmiuz/nonet
- Repository: https://github.com/natanmiuz/nonet

## Overview

##### Project Type and Purpose
- This is a standalone, desktop-centric Python application bundled into an .exe (via PyInstaller or similar).
- Purpose: Provide a GUI tool (“NONET”) for downloading video/audio from platforms (YouTube, Facebook, TikTok, Twitter), leveraging FFmpeg for processing and platform-specific downloader logic.

##### File Structure Analysis
- Top-level
- main.py           → entry point
- requirements.txt  → Python dependencies
- dist/NOTNET.exe   → packaged executable
- app/              → core application package
- app/
- core/downloader.py   → download logic, platform detection
- utils/helpers.py     → shared utility functions
- utils/styles.py      → UI styling constants
- views/main_window.py → GUI definition (window, controls, callbacks)
- External binary requirement: FFmpeg (to be placed under binaries/ per README)
- README emphasizes using FFmpeg, no other services are hosted locally.

##### Key Architectural Components
a. User Interface Layer
- main_window.py: input fields, buttons, progress bar, notifications
b. Application Logic Layer
- core/downloader.py: URL parsing, platform auto-detection, download orchestration
c. Utility Layer
- helpers.py: path management, URL validation
- styles.py: theming and styling constants
d. External Dependencies
- FFmpeg binary (binaries/ffmpeg.exe) for media conversion
- Platform APIs / Python libraries (youtube-dl or pytube) specified in requirements.txt
e. Packaging Layer
- PyInstaller (implied) for producing dist/NOTNET.exe

##### Relationships and Data Flows
- User action → GUI (main_window)
- GUI invokes Downloader API → Downloader core logic
- Downloader uses Helpers for I/O, platform detection
- Downloader triggers external library calls (YouTube/Facebook/TikTok/Twitter)
- Media streams piped through FFmpeg for format/quality conversion
- Converted file saved to disk → Downloader notifies GUI
- GUI displays success/error notification

##### Important Architectural Patterns
- MVC-like separation: Views (GUI) ↔ Controller (event handlers in main_window) ↔ Model (Downloader core logic)
- Layered architecture: UI → Business Logic → Utilities → External Services
- Single executable deployment (monolith) for portability

## Diagram (Mermaid)

```mermaid
flowchart TB
    User((User))
    Entry["main.py"]:::entry
    Exe["dist/NOTNET.exe"]:::entry
    UI["MainWindow"]:::ui
    Core["Downloader Module"]:::core
    subgraph Utils
        Helpers["Helpers"]:::utils
        Styles["Styles"]:::utils
    end
    Deps["Python Dependencies<br/>(pytube or youtube-dl)"]:::external
    subgraph "External Services"
        APIs["Platform APIs<br/>(YouTube, Facebook, TikTok, Twitter)"]:::external
        FFmpeg["FFmpeg<br/>(binaries/ffmpeg.exe)"]:::external
        FS["File System"]:::external
    end

    User -->|"enters URL"| UI
    Entry -->|"launches"| Exe
    Exe -->|"initializes GUI"| UI
    UI -->|"startDownload(url, options)"| Core
    Core -->|"uses"| Helpers
    Core -->|"uses"| Styles
    Core -->|"HTTP Request"| APIs
    Core -->|"Transcode"| FFmpeg
    Core -->|"Filesystem I/O"| FS
    Core -->|"completionCallback"| UI
    Core -->|"checks dependencies"| Deps

    click Entry "https://github.com/natanmiuz/nonet/blob/main/main.py"
    click Exe "https://github.com/natanmiuz/nonet/blob/main/dist/NOTNET.exe"
    click UI "https://github.com/natanmiuz/nonet/blob/main/app/views/main_window.py"
    click Core "https://github.com/natanmiuz/nonet/blob/main/app/core/downloader.py"
    click Helpers "https://github.com/natanmiuz/nonet/blob/main/app/utils/helpers.py"
    click Styles "https://github.com/natanmiuz/nonet/blob/main/app/utils/styles.py"
    click Deps "https://github.com/natanmiuz/nonet/blob/main/requirements.txt"

    classDef entry fill:#f9f,stroke:#333,stroke-width:1px
    classDef ui fill:#ccf,stroke:#333,stroke-width:1px
    classDef core fill:#cfc,stroke:#333,stroke-width:1px
    classDef utils fill:#ddd,stroke:#333,stroke-width:1px
    classDef external fill:#ffc,stroke:#333,stroke-width:1px
```
