Skip to content

Architecture Overview

High-level architecture of the rninja system.

Components

graph TB
    subgraph "Client Tools"
        A[rninja CLI]
    end

    subgraph "Local Services"
        B[rninja-daemon]
        C[(Local Cache)]
    end

    subgraph "Remote Services"
        D[rninja-cached]
        E[(Remote Cache)]
    end

    A <-->|IPC| B
    B <--> C
    B <-->|NNG| D
    D <--> E

Core Components

rninja CLI

Main user interface. Parses commands, connects to daemon, executes builds.

rninja-daemon

Long-running process that:

  • Caches parsed manifests
  • Manages build execution
  • Coordinates cache access

rninja-cached

Remote cache server:

  • Stores shared artifacts
  • Handles authentication
  • Manages storage

Data Flow

  1. User runs rninja
  2. CLI connects to daemon
  3. Daemon parses manifest (or uses cache)
  4. For each target:
  5. Compute cache key
  6. Check cache (local, then remote)
  7. Execute or restore
  8. Store result in cache
  9. Return results to CLI

Key Technologies

Component Technology
Runtime Tokio (async)
Database sled
Hashing BLAKE3
Network NNG
Serialization rkyv, MessagePack