# aditya-180404/jockey architecture

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

- Interactive diagram: https://gitdiagram.com/aditya-180404/jockey
- Repository: https://github.com/aditya-180404/jockey

## Overview

Jockey is a local-first digital-forensics platform: investigators author `.jy` investigations in the web IDE or CLI, validate and compile them, run tools to collect evidence, and verify and review results. The graph preserves the documented compiler stages, tool repository, authentication, and evidence workflow. Compiler-service implementation and several management routes were only partially sampled, so uncertain links are omitted; the worker’s Redis/S3/Postgres responsibilities come from its source comments and sampled code.

Main entry points: [`apps/api/src/main.rs`](https://github.com/aditya-180404/jockey/blob/main/apps/api/src/main.rs) (REST API), [`apps/web/src/services/api.ts`](https://github.com/aditya-180404/jockey/blob/main/apps/web/src/services/api.ts) (API client), [`compiler/cli/src/main.rs`](https://github.com/aditya-180404/jockey/blob/main/compiler/cli/src/main.rs) (CLI), [`services/compiler-worker/src/main.rs`](https://github.com/aditya-180404/jockey/blob/main/services/compiler-worker/src/main.rs) (Compiler worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Investigator experience"]
  node_web["Web application<br/>[App.tsx]"]
  node_ide["Web IDE<br/>[WebIDE.tsx]"]
  node_evidence_ui["Evidence views<br/>[Evidence.tsx]"]
  node_repo_ui["Tool repository UI<br/>[Repository.tsx]"]
  node_auth_ui["Auth context<br/>[AuthContext.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_api["Platform API"]
  node_api_server["REST API<br/>[main.rs]"]
  node_compiler_service["Compiler service"]
  node_tools_service["Auth and tools<br/>[tools_service.rs]"]
end

subgraph group_compiler["Language compiler"]
  node_lexer["Lexer<br/>[lib.rs]"]
  node_parser["Parser and AST<br/>[lib.rs]"]
  node_semantic["Semantic analysis<br/>[lib.rs]"]
  node_ir["Intermediate representations<br/>[lib.rs]"]
  node_backend["Code generation<br/>[lib.rs]"]
  node_cli["CLI<br/>[main.rs]"]
end

subgraph group_runtime["Forensic runtime"]
  node_runtime_entry["Runtime facade<br/>[lib.rs]"]
  node_collectors["Forensic collectors<br/>[lib.rs]"]
  node_evidence["Evidence integrity<br/>[lib.rs]"]
end

subgraph group_build["Build and artifacts"]
  node_worker["Compiler worker<br/>[main.rs]"]
  node_queue["Build queue"]
  node_artifact_store[("Artifact storage")]
end

node_investigator(("Investigator"))

node_investigator -->|"uses"| node_web
node_web -->|"opens"| node_ide
node_ide -->|"sends requests"| node_api_client
node_auth_ui -->|"sends auth requests"| node_api_client
node_repo_ui -->|"loads tools"| node_api_client
node_evidence_ui -->|"requests evidence"| node_api_client
node_api_client -->|"calls REST API"| node_api_server
node_api_server -->|"routes compiler calls"| node_compiler_service
node_api_server -->|"routes auth and tools"| node_tools_service
node_compiler_service -->|"runs compiler"| node_cli
node_cli -->|"tokenizes"| node_lexer
node_lexer -->|"feeds tokens"| node_parser
node_parser -->|"passes syntax"| node_semantic
node_semantic -->|"produces IR"| node_ir
node_ir -->|"generates code"| node_backend
node_cli -->|"runs investigation"| node_runtime_entry
node_runtime_entry -->|"dispatches collection"| node_collectors
node_collectors -->|"records evidence"| node_evidence
node_evidence -->|"verifies evidence"| node_compiler_service
node_repo_ui -->|"lists and downloads"| node_api_server
node_api_server -.->|"submits builds"| node_queue
node_queue -.->|"dispatches jobs"| node_worker
node_worker -.->|"stores artifacts"| node_artifact_store
node_worker -.->|"streams build logs"| node_queue

click node_web "https://github.com/aditya-180404/jockey/blob/main/apps/web/src/App.tsx"
click node_ide "https://github.com/aditya-180404/jockey/blob/main/apps/web/src/pages/WebIDE.tsx"
click node_evidence_ui "https://github.com/aditya-180404/jockey/blob/main/apps/web/src/pages/Evidence.tsx"
click node_repo_ui "https://github.com/aditya-180404/jockey/blob/main/apps/web/src/pages/Repository.tsx"
click node_auth_ui "https://github.com/aditya-180404/jockey/blob/main/apps/web/src/contexts/AuthContext.tsx"
click node_api_client "https://github.com/aditya-180404/jockey/blob/main/apps/web/src/services/api.ts"
click node_api_server "https://github.com/aditya-180404/jockey/blob/main/apps/api/src/main.rs"
click node_compiler_service "https://github.com/aditya-180404/jockey/blob/main/apps/api/src/compiler_service.rs"
click node_tools_service "https://github.com/aditya-180404/jockey/blob/main/apps/api/src/tools_service.rs"
click node_lexer "https://github.com/aditya-180404/jockey/blob/main/compiler/lexer/src/lib.rs"
click node_parser "https://github.com/aditya-180404/jockey/blob/main/compiler/parser/src/lib.rs"
click node_semantic "https://github.com/aditya-180404/jockey/blob/main/compiler/semantic/src/lib.rs"
click node_ir "https://github.com/aditya-180404/jockey/blob/main/compiler/ir/src/lib.rs"
click node_backend "https://github.com/aditya-180404/jockey/blob/main/compiler/backend/src/lib.rs"
click node_cli "https://github.com/aditya-180404/jockey/blob/main/compiler/cli/src/main.rs"
click node_runtime_entry "https://github.com/aditya-180404/jockey/blob/main/runtime/src/lib.rs"
click node_collectors "https://github.com/aditya-180404/jockey/blob/main/runtime/process/src/lib.rs"
click node_evidence "https://github.com/aditya-180404/jockey/blob/main/runtime/evidence/src/lib.rs"
click node_worker "https://github.com/aditya-180404/jockey/blob/main/services/compiler-worker/src/main.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_web,node_ide,node_evidence_ui,node_repo_ui,node_auth_ui,node_api_client toneBlue
class node_api_server,node_compiler_service,node_tools_service toneAmber
class node_lexer,node_parser,node_semantic,node_ir,node_backend,node_cli toneMint
class node_runtime_entry,node_collectors,node_evidence toneRose
class node_worker,node_queue,node_artifact_store,node_investigator toneIndigo
```

## Components

### Investigator experience

- [Web application](https://github.com/aditya-180404/jockey/blob/main/apps/web/src/App.tsx): `apps/web/src/App.tsx`
- [Web IDE](https://github.com/aditya-180404/jockey/blob/main/apps/web/src/pages/WebIDE.tsx): `apps/web/src/pages/WebIDE.tsx`
- [Evidence views](https://github.com/aditya-180404/jockey/blob/main/apps/web/src/pages/Evidence.tsx): `apps/web/src/pages/Evidence.tsx`
- [Tool repository UI](https://github.com/aditya-180404/jockey/blob/main/apps/web/src/pages/Repository.tsx): `apps/web/src/pages/Repository.tsx`
- [Auth context](https://github.com/aditya-180404/jockey/blob/main/apps/web/src/contexts/AuthContext.tsx): `apps/web/src/contexts/AuthContext.tsx`
- [API client](https://github.com/aditya-180404/jockey/blob/main/apps/web/src/services/api.ts): `apps/web/src/services/api.ts`

### Platform API

- [REST API](https://github.com/aditya-180404/jockey/blob/main/apps/api/src/main.rs): `apps/api/src/main.rs`
- [Compiler service](https://github.com/aditya-180404/jockey/blob/main/apps/api/src/compiler_service.rs): `apps/api/src/compiler_service.rs`
- [Auth and tools](https://github.com/aditya-180404/jockey/blob/main/apps/api/src/tools_service.rs): `apps/api/src/tools_service.rs`

### Language compiler

- [Lexer](https://github.com/aditya-180404/jockey/blob/main/compiler/lexer/src/lib.rs): `compiler/lexer/src/lib.rs`
- [Parser and AST](https://github.com/aditya-180404/jockey/blob/main/compiler/parser/src/lib.rs): `compiler/parser/src/lib.rs`
- [Semantic analysis](https://github.com/aditya-180404/jockey/blob/main/compiler/semantic/src/lib.rs): `compiler/semantic/src/lib.rs`
- [Intermediate representations](https://github.com/aditya-180404/jockey/blob/main/compiler/ir/src/lib.rs): `compiler/ir/src/lib.rs`
- [Code generation](https://github.com/aditya-180404/jockey/blob/main/compiler/backend/src/lib.rs): `compiler/backend/src/lib.rs`
- [CLI](https://github.com/aditya-180404/jockey/blob/main/compiler/cli/src/main.rs): `compiler/cli/src/main.rs`

### Forensic runtime

- [Runtime facade](https://github.com/aditya-180404/jockey/blob/main/runtime/src/lib.rs): `runtime/src/lib.rs`
- [Forensic collectors](https://github.com/aditya-180404/jockey/blob/main/runtime/process/src/lib.rs): `runtime/process/src/lib.rs`
- [Evidence integrity](https://github.com/aditya-180404/jockey/blob/main/runtime/evidence/src/lib.rs): `runtime/evidence/src/lib.rs`

### Build and artifacts

- [Compiler worker](https://github.com/aditya-180404/jockey/blob/main/services/compiler-worker/src/main.rs): `services/compiler-worker/src/main.rs`
- **Build queue**
- **Artifact storage**

### Other components

- **Investigator**

## Connections

- Investigator → Web application: uses
- Web application → Web IDE: opens
- Web IDE → API client: sends requests
- Auth context → API client: sends auth requests
- Tool repository UI → API client: loads tools
- Evidence views → API client: requests evidence
- API client → REST API: calls REST API
- REST API → Compiler service: routes compiler calls
- REST API → Auth and tools: routes auth and tools
- Compiler service → CLI: runs compiler
- CLI → Lexer: tokenizes
- Lexer → Parser and AST: feeds tokens
- Parser and AST → Semantic analysis: passes syntax
- Semantic analysis → Intermediate representations: produces IR
- Intermediate representations → Code generation: generates code
- CLI → Runtime facade: runs investigation
- Runtime facade → Forensic collectors: dispatches collection
- Forensic collectors → Evidence integrity: records evidence
- Evidence integrity → Compiler service: verifies evidence
- Tool repository UI → REST API: lists and downloads
- REST API → Build queue: submits builds
- Build queue → Compiler worker: dispatches jobs
- Compiler worker → Artifact storage: stores artifacts
- Compiler worker → Build queue: streams build logs
