# kirinccchang/citereview architecture

> Architecture diagram of the GitHub repository kirinccchang/citereview, 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/kirinccchang/citereview
- Repository: https://github.com/kirinccchang/citereview

## Overview

cite.review is a browser-based legal-citation checker. Users provide documents or pasted text; the browser parses and queues files, extracts citations, verifies them against legal sources, optionally checks whether verified cases support memo propositions, and exports reports. The README documents broad format and citation-type support, while sampled source mainly establishes worker proxy behavior and settings; the principal UI workflow is therefore represented at the documented level using index.html, without claiming sampled implementation details.

Main entry points: [`worker/index.js`](https://github.com/kirinccchang/citereview/blob/main/worker/index.js) (Proxy routes), [`index.html`](https://github.com/kirinccchang/citereview/blob/main/index.html) (Memo support check), [`embed-worker.js`](https://github.com/kirinccchang/citereview/blob/main/embed-worker.js) (Semantic matching)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser workflow"]
  node_app["cite.review app<br/>[index.html]"]
  node_parse["Document parsing<br/>[index.html]"]
  node_queue["File queue<br/>[index.html]"]
  node_extract["Citation extraction<br/>[index.html]"]
end

subgraph group_verify["Citation verification"]
  node_verify["Citation matching<br/>[index.html]"]
  node_courtlistener["CourtListener"]
  node_cornell["Cornell LII"]
  node_govinfo["GovInfo"]
  node_otherchecks["Other citation checks<br/>[index.html]"]
end

subgraph group_support["Support and reports"]
  node_supportcheck["Memo support check<br/>[index.html]"]
  node_opinion["Opinion text<br/>[index.html]"]
  node_embedding["Semantic matching<br/>[embed-worker.js]"]
  node_ai["AI provider"]
  node_reports["HTML and CSV reports<br/>[index.html]"]
  node_zip["Batch ZIP export<br/>[index.html]"]
end

subgraph group_edge["Edge proxy"]
  node_worker["Proxy routes<br/>[index.js]"]
  node_cache[("KV cache<br/>[index.js]")]
end

node_user(("Legal researcher"))

node_user -->|"provides files"| node_app
node_app -->|"parses locally"| node_parse
node_app -->|"queues files"| node_queue
node_queue -->|"supplies text"| node_extract
node_extract -->|"submits citations"| node_verify
node_verify -->|"requests checks"| node_worker
node_worker -->|"proxies queries"| node_courtlistener
node_worker -->|"checks URLs"| node_cornell
node_worker -->|"checks URLs"| node_govinfo
node_worker -->|"reads/writes"| node_cache
node_verify -->|"handles citations"| node_otherchecks
node_verify -->|"offers verified cases"| node_supportcheck
node_supportcheck -->|"retrieves opinions"| node_worker
node_worker -->|"fetches opinions"| node_courtlistener
node_supportcheck -->|"uses text"| node_opinion
node_supportcheck -->|"ranks passages"| node_embedding
node_embedding -.->|"loads model"| node_ai
node_supportcheck -.->|"sends excerpts"| node_ai
node_verify -->|"produces results"| node_reports
node_supportcheck -->|"adds analysis"| node_reports
node_reports -->|"exports reports"| node_user
node_queue -->|"bundles reports"| node_zip
node_zip -->|"downloads batch"| node_user

click node_app "https://github.com/kirinccchang/citereview/blob/main/index.html"
click node_parse "https://github.com/kirinccchang/citereview/blob/main/index.html"
click node_queue "https://github.com/kirinccchang/citereview/blob/main/index.html"
click node_extract "https://github.com/kirinccchang/citereview/blob/main/index.html"
click node_verify "https://github.com/kirinccchang/citereview/blob/main/index.html"
click node_otherchecks "https://github.com/kirinccchang/citereview/blob/main/index.html"
click node_worker "https://github.com/kirinccchang/citereview/blob/main/worker/index.js"
click node_cache "https://github.com/kirinccchang/citereview/blob/main/worker/index.js"
click node_supportcheck "https://github.com/kirinccchang/citereview/blob/main/index.html"
click node_opinion "https://github.com/kirinccchang/citereview/blob/main/index.html"
click node_embedding "https://github.com/kirinccchang/citereview/blob/main/embed-worker.js"
click node_reports "https://github.com/kirinccchang/citereview/blob/main/index.html"
click node_zip "https://github.com/kirinccchang/citereview/blob/main/index.html"

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_app,node_parse,node_queue,node_extract toneBlue
class node_verify,node_courtlistener,node_cornell,node_govinfo,node_otherchecks toneAmber
class node_supportcheck,node_opinion,node_embedding,node_ai,node_reports,node_zip toneMint
class node_worker,node_cache toneRose
class node_user toneIndigo
```

## Components

### Browser workflow

- [cite.review app](https://github.com/kirinccchang/citereview/blob/main/index.html): `index.html`
- [Document parsing](https://github.com/kirinccchang/citereview/blob/main/index.html): `index.html`
- [File queue](https://github.com/kirinccchang/citereview/blob/main/index.html): `index.html`
- [Citation extraction](https://github.com/kirinccchang/citereview/blob/main/index.html): `index.html`

### Citation verification

- [Citation matching](https://github.com/kirinccchang/citereview/blob/main/index.html): `index.html`
- **CourtListener**
- **Cornell LII**
- **GovInfo**
- [Other citation checks](https://github.com/kirinccchang/citereview/blob/main/index.html): `index.html`

### Support and reports

- [Memo support check](https://github.com/kirinccchang/citereview/blob/main/index.html): `index.html`
- [Opinion text](https://github.com/kirinccchang/citereview/blob/main/index.html): `index.html`
- [Semantic matching](https://github.com/kirinccchang/citereview/blob/main/embed-worker.js): `embed-worker.js`
- **AI provider**
- [HTML and CSV reports](https://github.com/kirinccchang/citereview/blob/main/index.html): `index.html`
- [Batch ZIP export](https://github.com/kirinccchang/citereview/blob/main/index.html): `index.html`

### Edge proxy

- [Proxy routes](https://github.com/kirinccchang/citereview/blob/main/worker/index.js): `worker/index.js`
- [KV cache](https://github.com/kirinccchang/citereview/blob/main/worker/index.js): `worker/index.js`

### Other components

- **Legal researcher**

## Connections

- Legal researcher → cite.review app: provides files
- cite.review app → Document parsing: parses locally
- cite.review app → File queue: queues files
- File queue → Citation extraction: supplies text
- Citation extraction → Citation matching: submits citations
- Citation matching → Proxy routes: requests checks
- Proxy routes → CourtListener: proxies queries
- Proxy routes → Cornell LII: checks URLs
- Proxy routes → GovInfo: checks URLs
- Proxy routes → KV cache: reads/writes
- Citation matching → Other citation checks: handles citations
- Citation matching → Memo support check: offers verified cases
- Memo support check → Proxy routes: retrieves opinions
- Proxy routes → CourtListener: fetches opinions
- Memo support check → Opinion text: uses text
- Memo support check → Semantic matching: ranks passages
- Semantic matching → AI provider: loads model
- Memo support check → AI provider: sends excerpts
- Citation matching → HTML and CSV reports: produces results
- Memo support check → HTML and CSV reports: adds analysis
- HTML and CSV reports → Legal researcher: exports reports
- File queue → Batch ZIP export: bundles reports
- Batch ZIP export → Legal researcher: downloads batch
