Paperless: AI Invoice Extraction with Gemini and Supabase
A small web app that extracts structured data from invoices using Gemini AI — upload a document, review the extracted fields, and manage everything in a clean dashboard.
Invoices are a pain to deal with manually. This is a small web app that takes care of the data entry part — you upload a document, AI reads it, and the structured data lands in a table you can actually manage.
What It Does
The core loop is simple: upload a document, get structured data back, review and approve it, mark it paid when done.
The dashboard gives you a live summary — total outstanding, overdue amounts, what's been paid this month, and how many invoices are sitting in the approval queue. The invoices page has filters for approval status, payment status, and date range, plus a CSV export if you need to pull things into a spreadsheet.
For each invoice, it pulls out the vendor, invoice number, date, due date, category, line items, and totals. If it can't find something, it leaves it blank rather than guessing.
The Stack
- Next.js for the frontend
- Supabase for the database, login, and file storage
- Gemini for reading the documents
- Tailwind CSS for the UI
How It Works
You drop in a file — an image or a PDF — and it gets sent off to Gemini, which reads it and returns the data in a structured format. Multi-page PDFs get split into individual pages first and processed one at a time, then the results are merged back together. This tends to be more accurate than throwing the whole document at the model at once.
Everything comes back as a draft. You review it, fix anything that looks off, and approve it before it counts. That step is intentional — AI extraction is good but not perfect, and it's better to catch mistakes before they're in your records.
Each user's data is kept completely separate at the database level, so there's no risk of seeing someone else's invoices.
What I'd Add
A few things I'd build out if I kept going:
- Email ingestion — forward invoices to an address and have them show up automatically
- Recurring vendors — flag when an expected invoice hasn't arrived
- Approval workflows — for teams where more than one person needs to sign off