# fullzer4/dusty architecture

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

- Interactive diagram: https://gitdiagram.com/fullzer4/dusty
- Repository: https://github.com/fullzer4/dusty

## Overview

##### Project type and purpose
- From the README and file-tree, we see this is a Rust-based Linux notification library (Dusty) that provides a CLI/daemon binary for sending desktop notifications.
- It is not a full-stack web app or microservices ecosystem, but rather a systems-level library/tool integrating with Linux’s D-Bus and systemd.

##### File structure
- Top level
- Cargo.toml / Cargo.lock / .cargo/: Rust build and dependency configuration
- src/main.rs: the entry point for the Dusty binary (and library exports, if any)
- dusty.service: systemd unit file to run Dusty as a daemon/service
- install.sh: install script that copies the binary and unit file into appropriate system paths
- No separate “frontend” or “backend” folders; this is a single binary that acts as both library and CLI/daemon.

##### README for additional insights
- Confirms “Modern Linux notification library in Rust”
- Early development; likely uses crates such as “dbus” or “notify-rdev” under the hood (you’d see these in Cargo.toml dependencies)

a. Main components
- User/Client (could be a script, another Rust program, or manual CLI invocation)
- Dusty Binary (the compiled Rust executable)
- D-Bus System Bus (IPC mechanism on Linux)
- Notification Daemon (e.g., notify-osd, dunst)
- systemd (when running as a service via dusty.service)
- install.sh (deployment step; not part of runtime but part of the delivery pipeline)

b. Relationships and interactions
1. User invokes `dusty` CLI or calls Dusty API from another Rust program → Dusty Binary
2. Dusty Binary formats the notification message and issues a D-Bus call on the System Bus
3. The Linux Notification Daemon (registered on D-Bus) receives the call and displays the notification
4. If deployed as a long-running service, systemd launches the Dusty service (dusty.service) at boot; it then listens on a socket or D-Bus to receive notification requests

c. Architectural patterns / design principles
- Single responsibility: binary handles both library API and CLI/daemon logic
- Modular layering:
– CLI/API layer (main.rs)
– D-Bus communication layer (dbus crate)
– System integration layer (systemd unit file)
- Separation of deployment (install.sh + dusty.service) from runtime logic

d. Key technologies / libraries
- Rust & Cargo (build system, dependency management)
- dbus crate (for IPC with the notification bus)
- systemd (unit file provided)
- Shell script (install.sh for deployment)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Nodes
    User["User or Rust App"]:::external
    DustyBinary["Dusty Binary<br/>(CLI/API Layer)"]:::code
    DBus["D-Bus System Bus"]:::ipc
    NotifDaemon["Notification Daemon"]:::system
    Systemd["systemd"]:::system
    Service["Dusty Service<br/>(daemon via systemd)"]:::code
    InstallScript["install.sh"]:::script
    ServiceFile["dusty.service"]:::script
    Cargo["Cargo.toml<br/>Cargo.lock<br/>.cargo/config.toml"]:::config
    README["README.md"]:::doc

    %% Flows
    User -->|"CLI args or API calls"| DustyBinary
    DustyBinary -->|"DBus Method Call: Notify"| DBus
    DBus -->|"Delivers notification"| NotifDaemon
    Systemd -->|"starts service"| Service
    Service -->|"listens on DBus or socket"| DBus

    %% Deployment arrows (dashed)
    InstallScript -.-> ServiceFile
    InstallScript -.-> DustyBinary

    %% Click events
    click DustyBinary "https://github.com/fullzer4/dusty/blob/main/src/main.rs"
    click InstallScript "https://github.com/fullzer4/dusty/blob/main/install.sh"
    click ServiceFile "https://github.com/fullzer4/dusty/blob/main/dusty.service"
    click Cargo "https://github.com/fullzer4/dusty/blob/main/Cargo.toml"
    click Cargo "https://github.com/fullzer4/dusty/blob/main/Cargo.lock"
    click Cargo "https://github.com/fullzer4/dusty/blob/main/.cargo/config.toml"
    click README "https://github.com/fullzer4/dusty/blob/main/README.md"

    %% Styles
    classDef code fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef system fill:#90EE90,stroke:#000,stroke-width:1px
    classDef ipc fill:#98FB98,stroke:#000,stroke-width:1px
    classDef script fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef external fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef config fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef doc fill:#ADD8E6,stroke:#000,stroke-width:1px
```
