Skip to content

About

Frontend AI for your documents — OCR & metadata in the browser, your S3, nothing sent to a model API.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Documents Manager

Take a photo of a bill or letter. Your browser reads it, names it, and finds it later by meaning.

  • No cloud AI — OCR and language models run in your browser tab
  • No app server — just a static web app
  • Your files stay yours — stored in an S3-compatible bucket you control

Demo: unlock, list, open a document, meaning search

What it does

  1. Scan or upload photos and PDFs
  2. Crop and straighten pages (colours stay as photographed)
  3. Auto-fill filing info — title, sender, date, and your labels
  4. Search by meaning — e.g. “utility power charge” finds the electricity bill
  5. Install as an app (Add to Home Screen / Install)

Document list Open document

Unlock screen Meaning search

Privacy, simply

Your data Where it lives
Documents Your S3 / R2 / MinIO / … bucket (browser talks to it directly)
AI processing On your device — nothing is sent to OpenAI, Google, etc.
Access keys Encrypted with your password, on this device only
Sensitive numbers (IBAN, IDs, …) Kept in full text only — not in titles or list previews

The app locks after 15 minutes idle. Forgot your password? Re-enter the keys — documents in the bucket are untouched.

Quick start

You need Node.js 20+.

npm install
npm run dev            # open http://localhost:5173

Then:

  1. Open Settings → Storage
  2. Point it at your bucket (see below)
  3. Save keys, test the connection, and scan something

Models download on first use from Hugging Face / WebLLM and stay cached in the browser (not in your document bucket).

npm run build && npm run preview   # production files in dist/
npm run test:unit                  # Vitest
npm run test:e2e                   # Playwright (fake S3, no real bucket)

Host dist/ on any HTTPS static host. Camera, WebGPU, service worker, and crypto need a secure context.

Tip: Filling titles/dates is fastest with WebGPU (recent Chrome / Edge, or Safari 26 / iOS 26). Granite Nano can fall back to WASM without it; Qwen still needs WebGPU. OCR and meaning search work either way.

Set up your bucket

One-time setup:

  1. Create a bucket (e.g. documents) at your provider.
  2. Create a limited access key that can only read/write/list that bucket — not an admin key (it will live in the browser).
    • Cloudflare R2: Manage API tokens → Object Read & Write → specific bucket
    • AWS: IAM with s3:ListBucket, GetObject, PutObject, DeleteObject on that bucket only
  3. Add CORS so your app origin can call the bucket (include http://localhost:5173 while developing):
[
  {
    "AllowedOrigins": ["https://docs.example.com", "http://localhost:5173"],
    "AllowedMethods": ["GET", "PUT", "DELETE", "HEAD"],
    "AllowedHeaders": ["*"],
    "ExposeHeaders": ["ETag"],
    "MaxAgeSeconds": 3600
  }
]
  1. In the app (Settings → Storage), fill in:
Field AWS S3 Cloudflare R2 MinIO
Endpoint https://s3.<region>.amazonaws.com https://<account-id>.r2.cloudflarestorage.com https://minio.example.com
Region e.g. eu-central-1 auto us-east-1
Path-style URLs off (or on) on on

Enter access key, secret, and a password → Save keys → Test.

How storage works

Your bucket is the source of truth. Unlock / Refresh loads the list from the bucket; opening a document fetches its pages. What stays on the device: settings, encrypted keys, and downloaded AI models.

Bucket layout details (for developers sharing a bucket with other tools): docs/storage.md.

On-device AI

When you add a document, models download once (then stay cached) and run locally in the page — WebGPU / WebAssembly, not a remote API.

Step What it does Model
Read the page Photo/PDF → text PP-OCRv6 (tiny by default; medium optional)
Fill the filing card Suggests title, sender, date, labels IBM Granite 4.0 Nano (transformers.js); Qwen via WebLLM still available
Search by meaning Finds docs by idea, not exact words IBM Granite Embedding 311M Multilingual R2

Only one engine is in memory at a time (so phones stay stable). While models are downloading, new documents wait with a clear banner.

Model choices

OCR (read text)

Model Size Notes
PP-OCRv6 tiny ~12 MB Default; good on phones
PP-OCRv6 medium ~107 MB Same family, more accurate

Metadata (title / from / date / labels)

Model Size Notes
Granite 4.0 350M ~334 MB Default; IBM Nano via transformers.js (WebGPU / WASM)
Granite 4.0 1B ~1.2 GB Stronger instruct; heavier
Qwen2.5 0.5B ~295 MB WebLLM; needs WebGPU
Qwen3.5 0.8B ~454 MB WebLLM; needs WebGPU
Qwen2.5 1.5B ~887 MB WebLLM; needs WebGPU

You can pick a different model per field. Labels only come from your list — the model does not invent categories.

Meaning search

Licenses

Weights are not in git. They download on first use and cache on the device.

Model Job License
PP-OCRv6 tiny / medium OCR Apache-2.0
Granite 4.0 Nano 350M / 1B Metadata Apache-2.0
Qwen2.5 / Qwen3.5 (above) Metadata (optional) Apache-2.0
Granite Embedding 311M R2 Meaning search Apache-2.0

Libraries and attribution: NOTICE.

How it works

flowchart LR
  subgraph Device["Your browser"]
    UI[App UI] --> Q[Processing queue]
    Q --> OCR["OCR"]
    Q --> LLM["Granite / Qwen metadata"]
    Q --> EMB["Granite Embedding"]
    UI --> IDB[("Encrypted keys + settings")]
    UI --> ST["S3 client"]
    Q --> ST
  end
  ST <-->|"HTTPS + CORS"| S3[("Your bucket")]
Loading

More detail: docs/architecture.md · ADR 0001

Known limitations

  • First release — not fully tested on every real device yet; please open issues
  • Needs the bucket + a connection (no offline document mode)
  • Closing the tab while a document is still being read loses that upload
  • Trash can be restored here; “delete forever” is left to whatever manages the bucket
  • Large documents use a single PUT (no multipart upload)
  • PP-OCRv6 has no Arabic or Japanese
  • After changing embedding models, rebuild the search index in Settings → Search

Contributing & license

Development setup, layout, and PR checks: CONTRIBUTING.md
Security reports: SECURITY.md
License: Apache License 2.0

About

Frontend AI for your documents — OCR & metadata in the browser, your S3, nothing sent to a model API.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages