# gokul-github/pathlock architecture

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

- Interactive diagram: https://gitdiagram.com/gokul-github/pathlock
- Repository: https://github.com/gokul-github/pathlock

## Overview

Pathlock is an interactive, simulated bench for understanding HDCP along a cockpit streaming path. A user opens the bench, selects a streaming service, sink, resolution, and rule, then runs, steps through, or replays a session to inspect its stages, keys, and outcome. The README and sampled UI establish the workflow and its purpose; the model implementation is indexed as read but not excerpted, so its internal stages and dependencies are not expanded here.

Main entry points: [`src/routes/__root.tsx`](https://github.com/gokul-github/pathlock/blob/main/src/routes/__root.tsx) (App shell), [`src/router.tsx`](https://github.com/gokul-github/pathlock/blob/main/src/router.tsx) (Route setup), [`src/routes/index.tsx`](https://github.com/gokul-github/pathlock/blob/main/src/routes/index.tsx) (Home route), [`src/components/pathlock/lab.tsx`](https://github.com/gokul-github/pathlock/blob/main/src/components/pathlock/lab.tsx) (Interactive lab)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Bench experience"]
  node_root["App shell<br/>[__root.tsx]"]
  node_router["Route setup<br/>[router.tsx]"]
  node_index["Home route<br/>[index.tsx]"]
  node_lab["Interactive lab<br/>[lab.tsx]"]
  node_preview["Preview host bridge"]
  node_bridge["Bridge messaging"]
end

subgraph group_simulation["HDCP simulation"]
  node_model["HDCP session model<br/>[model.ts]"]
end

node_user(("Bench user"))

node_user -->|"opens bench"| node_root
node_root -.->|"renders routes"| node_router
node_router -->|"loads route tree"| node_index
node_index -->|"renders"| node_lab
node_lab -->|"builds session"| node_model
node_root -->|"mounts bridge"| node_preview
node_preview -->|"installs bridge"| node_bridge

click node_root "https://github.com/gokul-github/pathlock/blob/main/src/routes/__root.tsx"
click node_router "https://github.com/gokul-github/pathlock/blob/main/src/router.tsx"
click node_index "https://github.com/gokul-github/pathlock/blob/main/src/routes/index.tsx"
click node_lab "https://github.com/gokul-github/pathlock/blob/main/src/components/pathlock/lab.tsx"
click node_model "https://github.com/gokul-github/pathlock/blob/main/src/lib/hdcp/model.ts"
click node_preview "https://github.com/gokul-github/pathlock/blob/main/src/components/preview-host-bridge.tsx"
click node_bridge "https://github.com/gokul-github/pathlock/blob/main/src/lib/preview-host-bridge.ts"

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_root,node_router,node_index,node_lab,node_preview,node_bridge,node_user toneBlue
class node_model toneAmber
```

## Components

### Bench experience

- [App shell](https://github.com/gokul-github/pathlock/blob/main/src/routes/__root.tsx): `src/routes/__root.tsx`
- [Route setup](https://github.com/gokul-github/pathlock/blob/main/src/router.tsx): `src/router.tsx`
- [Home route](https://github.com/gokul-github/pathlock/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Interactive lab](https://github.com/gokul-github/pathlock/blob/main/src/components/pathlock/lab.tsx): `src/components/pathlock/lab.tsx`
- [Preview host bridge](https://github.com/gokul-github/pathlock/blob/main/src/components/preview-host-bridge.tsx): `src/components/preview-host-bridge.tsx`
- [Bridge messaging](https://github.com/gokul-github/pathlock/blob/main/src/lib/preview-host-bridge.ts): `src/lib/preview-host-bridge.ts`

### HDCP simulation

- [HDCP session model](https://github.com/gokul-github/pathlock/blob/main/src/lib/hdcp/model.ts): `src/lib/hdcp/model.ts`

### Other components

- **Bench user**

## Connections

- Bench user → App shell: opens bench (evidence: `README.md`)
- App shell → Route setup: renders routes
- Route setup → Home route: loads route tree (evidence: `src/routeTree.gen.ts`)
- Home route → Interactive lab: renders (evidence: `src/routes/index.tsx`)
- Interactive lab → HDCP session model: builds session (evidence: `src/components/pathlock/lab.tsx`)
- App shell → Preview host bridge: mounts bridge (evidence: `src/routes/__root.tsx`)
- Preview host bridge → Bridge messaging: installs bridge (evidence: `src/components/preview-host-bridge.tsx`)
