# mystiafin/amane architecture

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

- Interactive diagram: https://gitdiagram.com/mystiafin/amane
- Repository: https://github.com/mystiafin/amane

## Overview

Amane is a Rust library and CLI for building Wayland desktop shells. The main workflow is to create or select a Rust shell project, build and launch it (or rebuild it during development), then have the shell construct windows and widgets that the Wayland backend displays and routes input for. The library also exposes graphics, animation, IPC, and built-in desktop services. Some runtime modules are represented at their known source paths, but their internal call relationships are omitted where excerpts do not establish them.

Main entry points: [`src/services.rs`](https://github.com/mystiafin/amane/blob/main/src/services.rs) (Service framework), [`cli/src/main.rs`](https://github.com/mystiafin/amane/blob/main/cli/src/main.rs) (CLI commands), [`src/app.rs`](https://github.com/mystiafin/amane/blob/main/src/app.rs) (App entry), [`cli/src`](https://github.com/mystiafin/amane/tree/main/cli/src) (Build and run)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI and projects"]
  node_commands["CLI commands<br/>[main.rs]"]
  node_project["Project creation<br/>[new.rs]"]
  node_target["Project target<br/>[target.rs]"]
  node_build_run["Build and run"]
  node_shell_source["Shell source<br/>[main.rs]"]
end

subgraph group_runtime["Shell runtime"]
  node_app["App entry<br/>[app.rs]"]
  node_wayland["Wayland backend<br/>[wayland.rs]"]
  node_scale["Display scaling<br/>[scale.rs]"]
  node_ipc["Shell IPC<br/>[ipc.rs]"]
end

subgraph group_interface["Windows and rendering"]
  node_windows["Window management<br/>[window.rs]"]
  node_layer_window["Layer windows<br/>[layer_window.rs]"]
  node_rectangle["Rectangle drawing<br/>[draw.rs]"]
  node_text["Text layout<br/>[lines.rs]"]
  node_input["Input routing<br/>[input.rs]"]
  node_graphics["Graphics renderer<br/>[renderer.rs]"]
  node_gpu["GPU rendering<br/>[gpu.rs]"]
  node_animation["Animation<br/>[animation.rs]"]
end

subgraph group_services["Shell capabilities"]
  node_services["Service framework<br/>[services.rs]"]
  node_apps["App discovery<br/>[apps.rs]"]
  node_notifications["Notifications<br/>[notifications.rs]"]
  node_network["Network service<br/>[network.rs]"]
  node_audio["Audio service<br/>[audio.rs]"]
end

node_user(("Shell developer"))

node_user -->|"invokes"| node_commands
node_commands -->|"dispatches"| node_project
node_commands -->|"dispatches"| node_target
node_commands -->|"dispatches"| node_build_run
node_project -->|"creates starter"| node_shell_source
node_target -->|"selects project"| node_build_run
node_build_run -->|"builds shell"| node_shell_source
node_build_run -->|"launches shell"| node_app
node_app -->|"starts backend"| node_wayland
node_app -->|"configures"| node_scale
node_app -->|"configures handlers"| node_ipc
node_wayland -->|"uses scaling"| node_scale
node_wayland -->|"uses window state"| node_windows
node_layer_window -.->|"supports window API"| node_windows
node_rectangle -->|"draws through"| node_graphics
node_rectangle -->|"collects targets"| node_input
node_text -->|"uses font rendering"| node_graphics
node_graphics -.->|"uses GPU"| node_gpu
node_rectangle -->|"requests frames"| node_animation
node_services -->|"exports service"| node_apps
node_services -->|"exports service"| node_notifications
node_services -->|"exports service"| node_network
node_services -->|"exports service"| node_audio

click node_commands "https://github.com/mystiafin/amane/blob/main/cli/src/main.rs"
click node_project "https://github.com/mystiafin/amane/blob/main/cli/src/new.rs"
click node_target "https://github.com/mystiafin/amane/blob/main/cli/src/target.rs"
click node_build_run "https://github.com/mystiafin/amane/tree/main/cli/src"
click node_shell_source "https://github.com/mystiafin/amane/blob/main/cli/template/main.rs"
click node_app "https://github.com/mystiafin/amane/blob/main/src/app.rs"
click node_wayland "https://github.com/mystiafin/amane/blob/main/src/wayland.rs"
click node_scale "https://github.com/mystiafin/amane/blob/main/src/scale.rs"
click node_windows "https://github.com/mystiafin/amane/blob/main/src/window.rs"
click node_layer_window "https://github.com/mystiafin/amane/blob/main/src/layer_window.rs"
click node_rectangle "https://github.com/mystiafin/amane/blob/main/src/widgets/rectangle/draw.rs"
click node_text "https://github.com/mystiafin/amane/blob/main/src/widgets/text/lines.rs"
click node_input "https://github.com/mystiafin/amane/blob/main/src/input.rs"
click node_graphics "https://github.com/mystiafin/amane/blob/main/src/graphics/renderer.rs"
click node_gpu "https://github.com/mystiafin/amane/blob/main/src/graphics/gpu.rs"
click node_animation "https://github.com/mystiafin/amane/blob/main/src/animation.rs"
click node_services "https://github.com/mystiafin/amane/blob/main/src/services.rs"
click node_apps "https://github.com/mystiafin/amane/blob/main/src/services/apps.rs"
click node_notifications "https://github.com/mystiafin/amane/blob/main/src/services/notifications.rs"
click node_network "https://github.com/mystiafin/amane/blob/main/src/services/network.rs"
click node_audio "https://github.com/mystiafin/amane/blob/main/src/services/audio.rs"
click node_ipc "https://github.com/mystiafin/amane/blob/main/src/ipc.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_commands,node_project,node_target,node_build_run,node_shell_source toneBlue
class node_app,node_wayland,node_scale,node_ipc toneAmber
class node_windows,node_layer_window,node_rectangle,node_text,node_input,node_graphics,node_gpu,node_animation toneMint
class node_services,node_apps,node_notifications,node_network,node_audio toneRose
class node_user toneIndigo
```

## Components

### CLI and projects

- [CLI commands](https://github.com/mystiafin/amane/blob/main/cli/src/main.rs): `cli/src/main.rs`
- [Project creation](https://github.com/mystiafin/amane/blob/main/cli/src/new.rs): `cli/src/new.rs`
- [Project target](https://github.com/mystiafin/amane/blob/main/cli/src/target.rs): `cli/src/target.rs`
- [Build and run](https://github.com/mystiafin/amane/tree/main/cli/src): `cli/src`
- [Shell source](https://github.com/mystiafin/amane/blob/main/cli/template/main.rs): `cli/template/main.rs`

### Shell runtime

- [App entry](https://github.com/mystiafin/amane/blob/main/src/app.rs): `src/app.rs`
- [Wayland backend](https://github.com/mystiafin/amane/blob/main/src/wayland.rs): `src/wayland.rs`
- [Display scaling](https://github.com/mystiafin/amane/blob/main/src/scale.rs): `src/scale.rs`
- [Shell IPC](https://github.com/mystiafin/amane/blob/main/src/ipc.rs): `src/ipc.rs`

### Windows and rendering

- [Window management](https://github.com/mystiafin/amane/blob/main/src/window.rs): `src/window.rs`
- [Layer windows](https://github.com/mystiafin/amane/blob/main/src/layer_window.rs): `src/layer_window.rs`
- [Rectangle drawing](https://github.com/mystiafin/amane/blob/main/src/widgets/rectangle/draw.rs): `src/widgets/rectangle/draw.rs`
- [Text layout](https://github.com/mystiafin/amane/blob/main/src/widgets/text/lines.rs): `src/widgets/text/lines.rs`
- [Input routing](https://github.com/mystiafin/amane/blob/main/src/input.rs): `src/input.rs`
- [Graphics renderer](https://github.com/mystiafin/amane/blob/main/src/graphics/renderer.rs): `src/graphics/renderer.rs`
- [GPU rendering](https://github.com/mystiafin/amane/blob/main/src/graphics/gpu.rs): `src/graphics/gpu.rs`
- [Animation](https://github.com/mystiafin/amane/blob/main/src/animation.rs): `src/animation.rs`

### Shell capabilities

- [Service framework](https://github.com/mystiafin/amane/blob/main/src/services.rs): `src/services.rs`
- [App discovery](https://github.com/mystiafin/amane/blob/main/src/services/apps.rs): `src/services/apps.rs`
- [Notifications](https://github.com/mystiafin/amane/blob/main/src/services/notifications.rs): `src/services/notifications.rs`
- [Network service](https://github.com/mystiafin/amane/blob/main/src/services/network.rs): `src/services/network.rs`
- [Audio service](https://github.com/mystiafin/amane/blob/main/src/services/audio.rs): `src/services/audio.rs`

### Other components

- **Shell developer**

## Connections

- Shell developer → CLI commands: invokes (evidence: `README.md`)
- CLI commands → Project creation: dispatches (evidence: `cli/src/main.rs`)
- CLI commands → Project target: dispatches (evidence: `cli/src/main.rs`)
- CLI commands → Build and run: dispatches (evidence: `cli/src/main.rs`)
- Project creation → Shell source: creates starter (evidence: `README.md`)
- Project target → Build and run: selects project (evidence: `README.md`)
- Build and run → Shell source: builds shell (evidence: `README.md`)
- Build and run → App entry: launches shell (evidence: `README.md`)
- App entry → Wayland backend: starts backend (evidence: `src/app.rs`)
- App entry → Display scaling: configures (evidence: `src/app.rs`)
- App entry → Shell IPC: configures handlers (evidence: `src/app.rs`)
- Wayland backend → Display scaling: uses scaling (evidence: `src/wayland.rs`)
- Wayland backend → Window management: uses window state (evidence: `src/wayland.rs`)
- Layer windows → Window management: supports window API
- Rectangle drawing → Graphics renderer: draws through (evidence: `src/widgets/rectangle/draw.rs`)
- Rectangle drawing → Input routing: collects targets (evidence: `src/widgets/rectangle/draw.rs`)
- Text layout → Graphics renderer: uses font rendering (evidence: `src/widgets/text/lines.rs`)
- Graphics renderer → GPU rendering: uses GPU
- Rectangle drawing → Animation: requests frames (evidence: `src/widgets/rectangle/draw.rs`)
- Service framework → App discovery: exports service (evidence: `src/services.rs`)
- Service framework → Notifications: exports service (evidence: `src/services.rs`)
- Service framework → Network service: exports service (evidence: `src/services.rs`)
- Service framework → Audio service: exports service (evidence: `src/services.rs`)
