InstaScan

Try it: https://project-instascan.web.app (use desktop Chrome) Code: https://github.com/CodeMaster207/Project-InstaScan (there are sample receipts in the samples folder)

Inspiration

Warranties are easy to forget about. The proof is a paper receipt, and paper fades, gets lost, or ends up in a drawer. When something breaks, nobody remembers when they bought it or how long the warranty was. Typing every receipt into an app is boring, so most people don't bother.

AI can read a receipt for you, but then every receipt gets uploaded somewhere. A receipt shows what you buy, where, and when. That's a lot to hand over.

So I wanted to see if hybrid AI could do both: read the receipt on your own device first, and only use the cloud when the local model can't manage.

What it does

InstaScan reads a photo of a receipt and keeps track of it for you.

  • You scan with the camera or upload a photo. There's also a Manual mode if you don't want AI.
  • Chrome's built-in model reads it first, right on your device. It picks out the item, the date, the total and a category.
  • If that answer isn't good enough, say the date is missing, the app asks the cloud model instead. It tells you it did that, and why.
  • Every receipt has a badge, On-device or Cloud, so you always know where it was read.
  • You check everything before it's saved. Nothing is saved until you press Add.
  • Warranties are tracked with a countdown. The app never guesses one. It only works out an end date when the warranty length is actually printed on the receipt: purchase date plus warranty months.
  • Your receipts also show up as expenses (with a chart and a CSV export) and subscriptions (with what's due next).
  • If a receipt is in another currency, you choose: keep it as it is, or convert it. I always keep the original amount too.
  • Everything stays on your device by default. An account is optional, syncing is something you switch on yourself, and receipt photos are never uploaded.

How I built it

I used React, TypeScript and Vite, and hosted it on Firebase Hosting.

The AI part is Firebase AI Logic. I set up one model to try the on-device Gemini Nano first, and a second one that only uses the cloud, for the retry. Both return the same JSON shape, so I get clean data back, not loose text. A small check of my own decides if the on-device answer is good enough. The SDK also tells me which one answered, and that's what the badge shows.

Firebase App Check is required, so I set that up too. The optional account and sync use Firebase Authentication and Firestore, with rules so people can only read their own items. Exchange rates come from the free European Central Bank rates through Frankfurter. The app only sends the currency codes, never your amounts.

I wrote tests as I went: 43 unit tests, and browser tests that click through every screen. For sign-in and sync I used the Firebase emulators, so I could test them properly without touching real data.

I built this with help from an AI coding assistant (Claude Code). The design choices and decisions were mine. The repo was started during the contest period.

Challenges

The on-device model rejected a good receipt. One receipt had the date 03/10/26 11:08 and my check said "no valid date". The small model had just copied the date as printed. So I wrote something that reads normal receipt dates (day first, so that's 3 October 2026) and changed the prompt. After that the same receipt stayed on-device.

App Check took the longest. My first requests all failed with a 403 until I registered a debug token and set up reCAPTCHA Enterprise, which Google now calls Fraud Defense.

Not trusting the AI too much. At first I filled in the warranty provider with the store name. That made it look like there was a warranty when there wasn't one. Now the store is only shown as information, and the provider stays blank unless a warranty is printed.

Tests found real bugs. The reset-password screen told people when an email had no account, which isn't good. Now it answers the same either way. A phone-size test also caught a form that ran off the edge of small screens.

Colours. My first palette had dark blue text on purple at only 3.75:1 contrast, which is hard to read. I measured every colour pair and moved the text onto lighter backgrounds.

Scope. I built the scan and warranty flow first so the core worked well. Then I added expenses, subscriptions, currencies, accounts and sync near the end. I also switched from an Android prototype to the web along the way.

What I learned

  • Hybrid AI works best when my own code decides when to escalate, not just when the SDK falls back.
  • Small on-device models are quick and private, but they need forgiving parsing and a clear check.
  • Showing which path was used builds more trust than just saying "it's private".
  • Letting people choose (keep or convert, sync or not) feels better than deciding for them.
  • On the web, on-device AI needs desktop Chrome for now, so the cloud fallback has to work well for everyone else.

What's next

  • Read return policies printed on receipts and work out return deadlines.
  • Reminders when the app is closed.
  • Retry a receipt in the cloud later if there was no signal.
  • Finish the Android version (a starter is already in the repo).

Built With

Share this project:

Updates

Submission history