# pratyush618/carrova architecture

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

- Interactive diagram: https://gitdiagram.com/pratyush618/carrova
- Repository: https://github.com/pratyush618/carrova

## Overview

Carrova is a cross-platform app-data migration product with CLI and desktop clients. Its main workflow scans installed apps, lets users select data, prepares a destination plan, transfers via encrypted archive or LAN, reviews and applies changes, and supports session history and rollback. The graph also retains recipe/catalog management, reporting, and settings. Relationships are limited to source-index references and explicit excerpts; unsampled subsystems are represented by exact enclosing directories, without asserting undocumented call paths.

Main entry points: [`apps/cli/src/main.rs`](https://github.com/pratyush618/carrova/blob/main/apps/cli/src/main.rs) (CLI commands), [`apps/cli/src/session/review.rs`](https://github.com/pratyush618/carrova/blob/main/apps/cli/src/session/review.rs) (CLI review), [`apps/desktop/src/app/App.tsx`](https://github.com/pratyush618/carrova/blob/main/apps/desktop/src/app/App.tsx) (Desktop app), [`crates/carrova-core/src/apply/handlers.rs`](https://github.com/pratyush618/carrova/blob/main/crates/carrova-core/src/apply/handlers.rs) (Apply and journal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User clients"]
  node_cli["CLI commands<br/>[main.rs]"]
  node_cli_review["CLI review<br/>[review.rs]"]
end

subgraph group_desktop["Desktop experience"]
  node_desktop_app["Desktop app<br/>[App.tsx]"]
  node_controllers["Flow controllers<br/>[Controllers.tsx]"]
  node_engine_state["Engine event state<br/>[EngineState.tsx]"]
  node_receive_routes["Receive routes<br/>[ReceiveRoutes.tsx]"]
  node_desktop_ipc["Desktop IPC"]
  node_tauri_commands["Desktop commands"]
end

subgraph group_engine["Migration engine"]
  node_scan["App scanning<br/>[apps.rs]"]
  node_planning["Import planning<br/>[mod.rs]"]
  node_apply["Apply and journal<br/>[handlers.rs]"]
  node_rollback["Rollback<br/>[preview.rs]"]
  node_sessions["Session lifecycle<br/>[sessions.rs]"]
  node_platform["Platform adapters"]
end

subgraph group_transfer["Transfer and storage"]
  node_archive["Encrypted archives"]
  node_lan["LAN transport"]
  node_pairing["Secure pairing<br/>[mod.rs]"]
end

subgraph group_support["Recipes and support"]
  node_bundle["Recipe bundles"]
  node_recipe["Recipe resolution"]
  node_reports["Error reports"]
end

node_user(("User"))

node_user -->|"runs commands"| node_cli
node_cli -->|"dispatches import"| node_cli_review
node_cli_review -->|"prepares plan"| node_planning
node_cli_review -->|"approves and applies"| node_apply
node_user -.->|"uses app"| node_desktop_app
node_desktop_app -->|"creates flows"| node_controllers
node_desktop_app -->|"subscribes events"| node_engine_state
node_controllers -->|"supplies receive flow"| node_receive_routes
node_receive_routes -->|"reads session progress"| node_engine_state
node_scan -->|"detects on"| node_platform
node_scan -->|"resolves recipe items"| node_recipe
node_cli_review -.->|"runs handler apply"| node_apply
node_apply -.->|"emits action events"| node_sessions
node_rollback -.->|"uses session state"| node_sessions
node_cli -.->|"imports and exports"| node_archive
node_cli -.->|"sends and receives"| node_lan
node_lan -.->|"secures pairing"| node_pairing
node_bundle -.->|"supplies recipes"| node_recipe
node_desktop_app -->|"selects runtime port"| node_desktop_ipc
node_tauri_commands -.->|"dispatches engine work"| node_sessions
node_cli -.->|"records errors"| node_reports

click node_cli "https://github.com/pratyush618/carrova/blob/main/apps/cli/src/main.rs"
click node_cli_review "https://github.com/pratyush618/carrova/blob/main/apps/cli/src/session/review.rs"
click node_desktop_app "https://github.com/pratyush618/carrova/blob/main/apps/desktop/src/app/App.tsx"
click node_controllers "https://github.com/pratyush618/carrova/blob/main/apps/desktop/src/app/controllers/Controllers.tsx"
click node_engine_state "https://github.com/pratyush618/carrova/blob/main/apps/desktop/src/app/state/EngineState.tsx"
click node_receive_routes "https://github.com/pratyush618/carrova/blob/main/apps/desktop/src/app/shell/routes/ReceiveRoutes.tsx"
click node_scan "https://github.com/pratyush618/carrova/blob/main/crates/carrova-core/src/scan/apps.rs"
click node_planning "https://github.com/pratyush618/carrova/blob/main/crates/carrova-core/src/plan/mod.rs"
click node_apply "https://github.com/pratyush618/carrova/blob/main/crates/carrova-core/src/apply/handlers.rs"
click node_rollback "https://github.com/pratyush618/carrova/blob/main/crates/carrova-core/src/rollback/preview.rs"
click node_sessions "https://github.com/pratyush618/carrova/blob/main/crates/carrova-core/src/engine/sessions.rs"
click node_archive "https://github.com/pratyush618/carrova/tree/main/crates/carrova-archive/src"
click node_lan "https://github.com/pratyush618/carrova/tree/main/crates/carrova-transport/src"
click node_pairing "https://github.com/pratyush618/carrova/blob/main/crates/carrova-crypto/src/pairing/mod.rs"
click node_bundle "https://github.com/pratyush618/carrova/tree/main/crates/carrova-bundle/src"
click node_recipe "https://github.com/pratyush618/carrova/tree/main/crates/carrova-recipe/src"
click node_reports "https://github.com/pratyush618/carrova/tree/main/crates/carrova-report/src"
click node_desktop_ipc "https://github.com/pratyush618/carrova/tree/main/apps/desktop/src/ipc"
click node_tauri_commands "https://github.com/pratyush618/carrova/tree/main/apps/desktop/src-tauri/src/commands"
click node_platform "https://github.com/pratyush618/carrova/tree/main/crates/carrova-platform/src"

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_cli,node_cli_review,node_user toneBlue
class node_desktop_app,node_controllers,node_engine_state,node_receive_routes,node_desktop_ipc,node_tauri_commands toneAmber
class node_scan,node_planning,node_apply,node_rollback,node_sessions,node_platform toneMint
class node_archive,node_lan,node_pairing toneRose
class node_bundle,node_recipe,node_reports toneIndigo
```

## Components

### User clients

- [CLI commands](https://github.com/pratyush618/carrova/blob/main/apps/cli/src/main.rs): `apps/cli/src/main.rs`
- [CLI review](https://github.com/pratyush618/carrova/blob/main/apps/cli/src/session/review.rs): `apps/cli/src/session/review.rs`

### Desktop experience

- [Desktop app](https://github.com/pratyush618/carrova/blob/main/apps/desktop/src/app/App.tsx): `apps/desktop/src/app/App.tsx`
- [Flow controllers](https://github.com/pratyush618/carrova/blob/main/apps/desktop/src/app/controllers/Controllers.tsx): `apps/desktop/src/app/controllers/Controllers.tsx`
- [Engine event state](https://github.com/pratyush618/carrova/blob/main/apps/desktop/src/app/state/EngineState.tsx): `apps/desktop/src/app/state/EngineState.tsx`
- [Receive routes](https://github.com/pratyush618/carrova/blob/main/apps/desktop/src/app/shell/routes/ReceiveRoutes.tsx): `apps/desktop/src/app/shell/routes/ReceiveRoutes.tsx`
- [Desktop IPC](https://github.com/pratyush618/carrova/tree/main/apps/desktop/src/ipc): `apps/desktop/src/ipc`
- [Desktop commands](https://github.com/pratyush618/carrova/tree/main/apps/desktop/src-tauri/src/commands): `apps/desktop/src-tauri/src/commands`

### Migration engine

- [App scanning](https://github.com/pratyush618/carrova/blob/main/crates/carrova-core/src/scan/apps.rs): `crates/carrova-core/src/scan/apps.rs`
- [Import planning](https://github.com/pratyush618/carrova/blob/main/crates/carrova-core/src/plan/mod.rs): `crates/carrova-core/src/plan/mod.rs`
- [Apply and journal](https://github.com/pratyush618/carrova/blob/main/crates/carrova-core/src/apply/handlers.rs): `crates/carrova-core/src/apply/handlers.rs`
- [Rollback](https://github.com/pratyush618/carrova/blob/main/crates/carrova-core/src/rollback/preview.rs): `crates/carrova-core/src/rollback/preview.rs`
- [Session lifecycle](https://github.com/pratyush618/carrova/blob/main/crates/carrova-core/src/engine/sessions.rs): `crates/carrova-core/src/engine/sessions.rs`
- [Platform adapters](https://github.com/pratyush618/carrova/tree/main/crates/carrova-platform/src): `crates/carrova-platform/src`

### Transfer and storage

- [Encrypted archives](https://github.com/pratyush618/carrova/tree/main/crates/carrova-archive/src): `crates/carrova-archive/src`
- [LAN transport](https://github.com/pratyush618/carrova/tree/main/crates/carrova-transport/src): `crates/carrova-transport/src`
- [Secure pairing](https://github.com/pratyush618/carrova/blob/main/crates/carrova-crypto/src/pairing/mod.rs): `crates/carrova-crypto/src/pairing/mod.rs`

### Recipes and support

- [Recipe bundles](https://github.com/pratyush618/carrova/tree/main/crates/carrova-bundle/src): `crates/carrova-bundle/src`
- [Recipe resolution](https://github.com/pratyush618/carrova/tree/main/crates/carrova-recipe/src): `crates/carrova-recipe/src`
- [Error reports](https://github.com/pratyush618/carrova/tree/main/crates/carrova-report/src): `crates/carrova-report/src`

### Other components

- **User**

## Connections

- User → CLI commands: runs commands (evidence: `apps/cli/src/main.rs`)
- CLI commands → CLI review: dispatches import (evidence: `apps/cli/src/main.rs`)
- CLI review → Import planning: prepares plan
- CLI review → Apply and journal: approves and applies (evidence: `apps/cli/src/session/review.rs`)
- User → Desktop app: uses app
- Desktop app → Flow controllers: creates flows (evidence: `apps/desktop/src/app/App.tsx`)
- Desktop app → Engine event state: subscribes events (evidence: `apps/desktop/src/app/App.tsx`)
- Flow controllers → Receive routes: supplies receive flow (evidence: `apps/desktop/src/app/shell/routes/ReceiveRoutes.tsx`)
- Receive routes → Engine event state: reads session progress (evidence: `apps/desktop/src/app/shell/routes/ReceiveRoutes.tsx`)
- App scanning → Platform adapters: detects on (evidence: `crates/carrova-core/src/scan/apps.rs`)
- App scanning → Recipe resolution: resolves recipe items (evidence: `crates/carrova-core/src/scan/apps.rs`)
- CLI review → Apply and journal: runs handler apply
- Apply and journal → Session lifecycle: emits action events
- Rollback → Session lifecycle: uses session state
- CLI commands → Encrypted archives: imports and exports
- CLI commands → LAN transport: sends and receives
- LAN transport → Secure pairing: secures pairing
- Recipe bundles → Recipe resolution: supplies recipes
- Desktop app → Desktop IPC: selects runtime port (evidence: `apps/desktop/src/main.tsx`)
- Desktop commands → Session lifecycle: dispatches engine work
- CLI commands → Error reports: records errors
