# redpangilinan/crikket architecture

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

- Interactive diagram: https://gitdiagram.com/redpangilinan/crikket
- Repository: https://github.com/redpangilinan/crikket

## Overview

Crikket is a browser-based bug-reporting product: users capture a screenshot or recording, add report details, and submit it with reproduction and technical context; teams manage reports and share links. The repository also provides an embeddable capture SDK, a browser extension, and organization, collaboration, and billing features. The graph combines documented product capabilities with relationships visible in the supplied excerpts and SOURCE INDEX; unsampled feature internals and connections are not inferred.

Main entry points: [`packages/bug-reports/src/lib/ingestion-jobs.ts`](https://github.com/redpangilinan/crikket/blob/master/packages/bug-reports/src/lib/ingestion-jobs.ts) (Report ingestion), [`apps/server/src/capture/upload-session-route.ts`](https://github.com/redpangilinan/crikket/blob/master/apps/server/src/capture/upload-session-route.ts) (Capture API routes), [`apps/extension/entrypoints/recorder/App.tsx`](https://github.com/redpangilinan/crikket/blob/master/apps/extension/entrypoints/recorder/App.tsx) (Capture recorder), [`sdks/capture/src/ui/capture-widget`](https://github.com/redpangilinan/crikket/tree/master/sdks/capture/src/ui/capture-widget) (Embed capture SDK)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture clients"]
  node_extension["Browser extension<br/>[App.tsx]"]
  node_recorder["Capture recorder<br/>[App.tsx]"]
  node_capture_core["Debugger capture"]
  node_sdk["Embed capture SDK"]
  node_sdk_review["Review and annotate"]
end

subgraph group_ingest["Capture ingestion"]
  node_capture_api["Capture API routes"]
  node_capture_protection["Upload protection<br/>[protection.ts]"]
  node_report_ingest["Report ingestion<br/>[ingestion-jobs.ts]"]
  node_artifact_storage[("Artifact storage<br/>[storage.ts]")]
end

subgraph group_reports["Reports and sharing"]
  node_debugger_data["Debugger context<br/>[debugger.ts]"]
  node_report_api["Report operations"]
  node_dashboard["Report dashboard"]
  node_share_view["Shared report view"]
end

subgraph group_workspace["Team workspace"]
  node_auth["Authentication"]
  node_team_settings["Team and settings"]
end

subgraph group_billing["Billing"]
  node_billing_api["Billing procedures"]
  node_billing_webhooks["Payment webhooks"]
  node_billing_projection[("Entitlement projection<br/>[projection.ts]")]
end

node_reporter(("Browser user"))
node_polar["Polar payments"]
node_database[("Application database<br/>[bug-report.ts]")]

node_reporter -->|"starts capture"| node_extension
node_extension -.->|"opens recorder"| node_recorder
node_recorder -->|"loads debugger snapshot"| node_capture_core
node_reporter -->|"starts embedded capture"| node_sdk
node_sdk -->|"reviews capture"| node_sdk_review
node_sdk -.->|"submits report"| node_capture_api
node_recorder -.->|"uploads report"| node_capture_api
node_capture_api -->|"checks upload"| node_capture_protection
node_capture_api -->|"starts ingestion"| node_report_ingest
node_report_ingest -->|"persists debugger data"| node_debugger_data
node_report_ingest -->|"updates ingestion state"| node_database
node_report_ingest -->|"reads artifacts"| node_artifact_storage
node_report_api -.->|"reads reports"| node_database
node_dashboard -.->|"manages reports"| node_report_api
node_reporter -->|"opens report link"| node_share_view
node_reporter -->|"signs in"| node_auth
node_auth -.->|"enables workspace"| node_team_settings
node_team_settings -.->|"manages plan"| node_billing_api
node_polar -.->|"sends events"| node_billing_webhooks
node_billing_webhooks -->|"upserts projection"| node_billing_projection
node_billing_webhooks -->|"records event state"| node_database

click node_extension "https://github.com/redpangilinan/crikket/blob/master/apps/extension/entrypoints/popup/App.tsx"
click node_recorder "https://github.com/redpangilinan/crikket/blob/master/apps/extension/entrypoints/recorder/App.tsx"
click node_capture_core "https://github.com/redpangilinan/crikket/tree/master/packages/capture-core/src/debugger/engine/page"
click node_sdk "https://github.com/redpangilinan/crikket/tree/master/sdks/capture/src/ui/capture-widget"
click node_sdk_review "https://github.com/redpangilinan/crikket/blob/master/sdks/capture/src/ui/capture-widget/sections/review-form-section.tsx"
click node_capture_api "https://github.com/redpangilinan/crikket/blob/master/apps/server/src/capture/upload-session-route.ts"
click node_capture_protection "https://github.com/redpangilinan/crikket/blob/master/apps/server/src/capture/protection.ts"
click node_report_ingest "https://github.com/redpangilinan/crikket/blob/master/packages/bug-reports/src/lib/ingestion-jobs.ts"
click node_artifact_storage "https://github.com/redpangilinan/crikket/blob/master/packages/bug-reports/src/lib/storage.ts"
click node_debugger_data "https://github.com/redpangilinan/crikket/blob/master/packages/bug-reports/src/lib/debugger.ts"
click node_report_api "https://github.com/redpangilinan/crikket/tree/master/packages/bug-reports/src/procedures"
click node_dashboard "https://github.com/redpangilinan/crikket/tree/master/apps/web/src/app/(protected)/(dashboard)/_components/bug-reports"
click node_share_view "https://github.com/redpangilinan/crikket/tree/master/apps/web/src/app/s/%5Bid%5D"
click node_auth "https://github.com/redpangilinan/crikket/tree/master/packages/auth/src"
click node_team_settings "https://github.com/redpangilinan/crikket/tree/master/apps/web/src/app/(protected)/(dashboard)/settings"
click node_billing_api "https://github.com/redpangilinan/crikket/tree/master/packages/billing/src/procedures"
click node_billing_webhooks "https://github.com/redpangilinan/crikket/blob/master/packages/billing/src/service/webhooks/process-polar-webhook-payload.ts"
click node_billing_projection "https://github.com/redpangilinan/crikket/blob/master/packages/billing/src/service/entitlements/projection.ts"
click node_database "https://github.com/redpangilinan/crikket/blob/master/packages/db/src/schema/bug-report.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_extension,node_recorder,node_capture_core,node_sdk,node_sdk_review,node_reporter toneBlue
class node_capture_api,node_capture_protection,node_report_ingest,node_artifact_storage,node_database toneAmber
class node_debugger_data,node_report_api,node_dashboard,node_share_view toneMint
class node_auth,node_team_settings toneRose
class node_billing_api,node_billing_webhooks,node_billing_projection,node_polar toneIndigo
```

## Components

### Capture clients

- [Browser extension](https://github.com/redpangilinan/crikket/blob/master/apps/extension/entrypoints/popup/App.tsx): `apps/extension/entrypoints/popup/App.tsx`
- [Capture recorder](https://github.com/redpangilinan/crikket/blob/master/apps/extension/entrypoints/recorder/App.tsx): `apps/extension/entrypoints/recorder/App.tsx`
- [Debugger capture](https://github.com/redpangilinan/crikket/tree/master/packages/capture-core/src/debugger/engine/page): `packages/capture-core/src/debugger/engine/page`
- [Embed capture SDK](https://github.com/redpangilinan/crikket/tree/master/sdks/capture/src/ui/capture-widget): `sdks/capture/src/ui/capture-widget`
- [Review and annotate](https://github.com/redpangilinan/crikket/blob/master/sdks/capture/src/ui/capture-widget/sections/review-form-section.tsx): `sdks/capture/src/ui/capture-widget/sections/review-form-section.tsx`

### Capture ingestion

- [Capture API routes](https://github.com/redpangilinan/crikket/blob/master/apps/server/src/capture/upload-session-route.ts): `apps/server/src/capture/upload-session-route.ts`
- [Upload protection](https://github.com/redpangilinan/crikket/blob/master/apps/server/src/capture/protection.ts): `apps/server/src/capture/protection.ts`
- [Report ingestion](https://github.com/redpangilinan/crikket/blob/master/packages/bug-reports/src/lib/ingestion-jobs.ts): `packages/bug-reports/src/lib/ingestion-jobs.ts`
- [Artifact storage](https://github.com/redpangilinan/crikket/blob/master/packages/bug-reports/src/lib/storage.ts): `packages/bug-reports/src/lib/storage.ts`

### Reports and sharing

- [Debugger context](https://github.com/redpangilinan/crikket/blob/master/packages/bug-reports/src/lib/debugger.ts): `packages/bug-reports/src/lib/debugger.ts`
- [Report operations](https://github.com/redpangilinan/crikket/tree/master/packages/bug-reports/src/procedures): `packages/bug-reports/src/procedures`
- [Report dashboard](https://github.com/redpangilinan/crikket/tree/master/apps/web/src/app/(protected)/(dashboard)/_components/bug-reports): `apps/web/src/app/(protected)/(dashboard)/_components/bug-reports`
- [Shared report view](https://github.com/redpangilinan/crikket/tree/master/apps/web/src/app/s/%5Bid%5D): `apps/web/src/app/s/[id]`

### Team workspace

- [Authentication](https://github.com/redpangilinan/crikket/tree/master/packages/auth/src): `packages/auth/src`
- [Team and settings](https://github.com/redpangilinan/crikket/tree/master/apps/web/src/app/(protected)/(dashboard)/settings): `apps/web/src/app/(protected)/(dashboard)/settings`

### Billing

- [Billing procedures](https://github.com/redpangilinan/crikket/tree/master/packages/billing/src/procedures): `packages/billing/src/procedures`
- [Payment webhooks](https://github.com/redpangilinan/crikket/blob/master/packages/billing/src/service/webhooks/process-polar-webhook-payload.ts): `packages/billing/src/service/webhooks/process-polar-webhook-payload.ts`
- [Entitlement projection](https://github.com/redpangilinan/crikket/blob/master/packages/billing/src/service/entitlements/projection.ts): `packages/billing/src/service/entitlements/projection.ts`

### Other components

- **Browser user**
- **Polar payments**
- [Application database](https://github.com/redpangilinan/crikket/blob/master/packages/db/src/schema/bug-report.ts): `packages/db/src/schema/bug-report.ts`

## Connections

- Browser user → Browser extension: starts capture (evidence: `README.md`)
- Browser extension → Capture recorder: opens recorder
- Capture recorder → Debugger capture: loads debugger snapshot (evidence: `apps/extension/entrypoints/recorder/App.tsx`)
- Browser user → Embed capture SDK: starts embedded capture (evidence: `README.md`)
- Embed capture SDK → Review and annotate: reviews capture (evidence: `sdks/capture/src/ui/capture-widget/sections/review-form-section.tsx`)
- Embed capture SDK → Capture API routes: submits report
- Capture recorder → Capture API routes: uploads report
- Capture API routes → Upload protection: checks upload (evidence: `apps/server/src/capture/upload-session-route.ts`)
- Capture API routes → Report ingestion: starts ingestion (evidence: `apps/server/src/capture/upload-session-route.ts`)
- Report ingestion → Debugger context: persists debugger data (evidence: `packages/bug-reports/src/lib/ingestion-jobs.ts`)
- Report ingestion → Application database: updates ingestion state (evidence: `packages/bug-reports/src/lib/ingestion-jobs.ts`)
- Report ingestion → Artifact storage: reads artifacts (evidence: `packages/bug-reports/src/lib/ingestion-jobs.ts`)
- Report operations → Application database: reads reports
- Report dashboard → Report operations: manages reports
- Browser user → Shared report view: opens report link (evidence: `README.md`)
- Browser user → Authentication: signs in (evidence: `README.md`)
- Authentication → Team and settings: enables workspace
- Team and settings → Billing procedures: manages plan
- Polar payments → Payment webhooks: sends events
- Payment webhooks → Entitlement projection: upserts projection (evidence: `packages/billing/src/service/webhooks/process-polar-webhook-payload.ts`)
- Payment webhooks → Application database: records event state (evidence: `packages/billing/src/service/webhooks/process-polar-webhook-payload.ts`)
