wayray/docs/ai/adr/007-project-structure.md
Till Wegmueller 643c4f042d
Rename binaries to illumos-style short names
Follow illumos CLI naming conventions (zoneadm, svcadm, dladm):

  wayray-server           → wrsrvd
  wayray-client           → wrclient
  wayray-ctl              → wradm
  wayray-greeter          → wrlogin
  wayray-session-launcher → wrsessd
  wayray-gateway          → wrgw
  wayray-wm-floating      → wr-wm-floating
  wayray-wm-tiling        → wr-wm-tiling

Updated across all 23 documentation files, ADRs, book pages,
roadmap, and CLAUDE.md. Added binary name table to CLAUDE.md.
2026-03-29 00:34:19 +01:00

2.5 KiB

ADR-007: Project Structure (Cargo Workspace)

Status

Accepted

Context

WayRay consists of multiple binaries and shared libraries. We need a project structure that supports clean separation of concerns while sharing common code.

Decision

Cargo workspace with the following crate layout:

wayray/
├── Cargo.toml              # Workspace root
├── crates/
│   ├── wrsrvd/      # Wayland compositor + frame encoder + network server
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── main.rs
│   │       ├── compositor/  # Smithay compositor implementation
│   │       ├── encoder/     # Frame encoding pipeline
│   │       ├── network/     # QUIC server, session management
│   │       └── audio/       # PipeWire integration
│   │
│   ├── wrclient/      # Remote viewer + input capture + decoder
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── main.rs
│   │       ├── decoder/     # Frame decoding pipeline
│   │       ├── renderer/    # Local display (wgpu/winit)
│   │       ├── network/     # QUIC client
│   │       ├── input/       # Input capture and forwarding
│   │       └── audio/       # Local audio playback/capture
│   │
│   ├── wayray-protocol/    # Shared protocol definitions
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── lib.rs
│   │       ├── messages.rs  # Wire protocol message types
│   │       ├── codec.rs     # Serialization/deserialization
│   │       └── version.rs   # Protocol versioning
│   │
│   └── wradm/         # CLI management tool
│       ├── Cargo.toml
│       └── src/
│           └── main.rs
│
├── docs/                   # Documentation
├── book/                   # mdbook user guide
└── tests/                  # Integration tests

Rationale

  • crates/ directory keeps workspace root clean
  • Protocol crate ensures server and client agree on wire format at compile time
  • Server and client have completely different dependency trees (smithay vs wgpu)
  • wradm as separate binary avoids bloating server/client with admin dependencies
  • Integration tests at workspace root can spin up server + client together

Consequences

  • Must manage feature flags carefully across workspace
  • Protocol changes require updating both server and client
  • CI must build and test all crates