# saptarshisarkar12/drifty architecture

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

- Interactive diagram: https://gitdiagram.com/saptarshisarkar12/drifty
- Repository: https://github.com/saptarshisarkar12/drifty

## Overview

Based on our review of the file tree and README, the Drifty project is an open‐source interactive file downloader system developed in Java. It offers two UI modes—a command line (CLI) and a graphical interface (GUI)—and even has a dedicated website (built with Next.js and Tailwind CSS) for downloads, documentation, and other user interactions. The project is structured as a multi-module/multi-component Java application with accompanying Docker configuration and CI/CD workflows using GitHub Actions.

##### Primary components
- Core Business Logic Module: Found in the “Core” directory, this module holds the fundamental downloading logic, configuration and updater functionalities. It includes components such as download management, job history recording, update checking, and configuration utilities.
- CLI Module: The “CLI” directory contains the command-line interface implementation, including its own internal helpers, initialization code, and components for interacting with the core functions (e.g., DownloaderThread, ProgressBarThread).
- Website Module: The “Website” directory is a Next.js based project. It provides the front-end for users to download executables, read documentation, and navigate interactive content.
- Infrastructure & Deployment: Include the Docker folder (with separate subdirectories for “dev” and “prod”) and Docker Compose files. These illustrate how the different application variants (CLI and GUI) are containerized and deployed. Additionally, CI/CD workflow files in the “.github/workflows” directory indicate automated build, test and deployment pipelines.
- Supporting Components: Configuration files (e.g., Maven “pom.xml” files, .dockerignore, and others), resource configuration for different operating systems (e.g., ffmpeg and yt-dlp executables), and updater routines are also critical.

##### Out relationships and data flow
- That both CLI and GUI are deployed separately; for instance, include Docker container images and Dockerfiles that wrap them.
- That the Website (Next.js) is an external front-end system primarily used for user access (downloads, documentation, and feedback) and integrates with the deployment/release process.
- Optionally, represent external interactions like downloading files from remote URLs, the integration with OS-specific resources (like the bundled ffmpeg and yt-dlp binaries), and update checking services used by both the CLI and GUI.

##### Design patterns and architectural principles
- Interface Abstraction: Where CLI and GUI share common utilities (for tasks like logging, network resource management, or file downloading), illustrate these as shared interfaces or libraries (in Core).
- Containerization: With Docker configurations available, show how the applications are containerized for different environments (development and production).
- CI/CD Integration: Briefly note the existence of automated workflows (build, code quality, release, etc.) that ensure continuous integration and deployment.

##### Relevant technologies and frameworks
- Core application is written in Java, built with Maven.
- CLI and GUI implementations are also in Java.
- Website is built with Next.js and styled using Tailwind CSS.
- Docker is used for containerization.
- GitHub Actions (via workflows) for automated build and release.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Application Layer
    subgraph "Application Layer"
        Core["Core Business Logic Module"]:::core
        CLI["CLI Module"]:::frontend
        GUI["GUI Module"]:::frontend
        MavenCore["Maven Config (Core)"]:::config
        MavenCLI["Maven Config (CLI)"]:::config
        MavenGUI["Maven Config (GUI)"]:::config

        CLI -->|"uses"| Core
        GUI -->|"uses"| Core
        MavenCore -->|"configures"| Core
        MavenCLI -->|"configures"| CLI
        MavenGUI -->|"configures"| GUI
        CLI -->|"containerized"| Docker
        GUI -->|"containerized"| Docker
    end

    %% Website & External Layer
    subgraph "Website & External Layer"
        Website["Website Module"]:::website
        Website -->|"integrates"| CI
    end

    %% Infrastructure & Deployment
    subgraph "Infrastructure & Deployment"
        Docker["Docker (dev/prod)"]:::infra
        Compose["Docker Compose"]:::infra
        CI["CI/CD Workflows"]:::infra
        
        CI -->|"deploys"| Docker
        CI -->|"deploys"| Compose
    end

    %% Supporting Components
    OSConfig["OS-specific Config"]:::config
    OSConfig -->|"supports"| Core

    %% Click Events
    click Core "https://github.com/saptarshisarkar12/drifty/tree/master/Core/"
    click CLI "https://github.com/saptarshisarkar12/drifty/tree/master/CLI/"
    click GUI "https://github.com/saptarshisarkar12/drifty/tree/master/GUI/"
    click Website "https://github.com/saptarshisarkar12/drifty/tree/master/Website/"
    click Docker "https://github.com/saptarshisarkar12/drifty/tree/master/Docker/"
    click Compose "https://github.com/saptarshisarkar12/drifty/blob/master/docker-compose.yaml"
    click CI "https://github.com/saptarshisarkar12/drifty/tree/master/.github/workflows/"
    click MavenCore "https://github.com/saptarshisarkar12/drifty/tree/master/Core/"
    click MavenCLI "https://github.com/saptarshisarkar12/drifty/tree/master/CLI/"
    click MavenGUI "https://github.com/saptarshisarkar12/drifty/tree/master/GUI/"
    click OSConfig "https://github.com/saptarshisarkar12/drifty/tree/master/config/"

    %% Styles
    classDef core fill:#ffcc99,stroke:#d35400,stroke-width:2px;
    classDef frontend fill:#add8e6,stroke:#2980b9,stroke-width:2px;
    classDef website fill:#c1f0c1,stroke:#27ae60,stroke-width:2px;
    classDef infra fill:#f0e68c,stroke:#f39c12,stroke-width:2px;
    classDef config fill:#dcdcdc,stroke:#7f8c8d,stroke-width:2px;
```
