Private
Tucket
Personal document vault that reads invoices and warranty cards for you, with tenant isolation enforced in the database.
Next.js 16 / React 19 / TypeScript / Supabase / Tailwind CSS v4
How a file gets into the vault
Tucket is a personal vault for invoices, receipts, warranty cards and contracts, with a Next.js 16 web app and a Flutter client for iOS and Android over the same Supabase project. In the web app, the browser hashes each file with SHA-256 and requests a signed upload URL from a route that checks the session, file type and size and picks the storage path under the user's id. The file goes straight to a private storage bucket, and a unique constraint on user and file hash turns a repeat upload into the existing record.
Tenant isolation enforced by Postgres
Every table has row-level security with a policy matching the row's user id to the signed-in user, so isolation is enforced by the database rather than by application code. Storage policies apply the same rule to object paths, which must begin with the user's id. No file has a public link: each request mints a signed URL that expires after an hour, and deleting a document sets a timestamp rather than removing the row.
How extraction is designed, and what runs today
Extraction is designed as a durable multi-step workflow rather than a request handler, because OCR plus structured extraction on a multi-page PDF can outlive a serverless timeout. Its steps (deduplication, preview, extraction, persistence, a confidence gate, embedding and finalisation) are each retried on their own.
In the current code, extraction runs as a Supabase Edge Function that sends the stored file to Claude Sonnet and asks for JSON matching a schema of document type, vendor, dates, amounts, line items and warranty terms. If the model reports a confidence of 0.85 or above, the document is marked processed; anything lower flags it for review, and each completed extraction is logged to an audit table.
A data model ready for email intake and long-lived reminders
The documents table has carried a source field, upload or email, since the first migration, so an email intake channel becomes another value on the same record rather than a change to storage, extraction or schema. Reminders are rows with a scheduled time and a unique key per subject and offset, which the design prefers to delayed queue jobs because a warranty can run for years.