Skip to content
VedSoni-devPublic

About

Scan any grocery barcode and see how healthy it really is

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Peel

Peel

Scan any grocery barcode and see how healthy it really is

Live app →  ·  Watch the demo  ·  Report a bug

MIT license Live Stars

Peel in action

What it does

A free, open-source alternative to Yuka (Premium is $10 to $20 a year). Inspired by it, not affiliated with it.

  • Scan a grocery barcode with your phone's camera (or type the number) and get a score out of 100: Excellent, Good, Poor or Bad.
  • See why: sugar, salt, saturated fat and calories per 100 g, with fibre and protein when they help.
  • Tap any additive (E-number) for its risk level and the reason, from EU warning labels to FDA bans.
  • Find a better swap from the same shelf: real products that score higher, sold where yours is sold.
  • Sign in with publik once to use it. Peel has no AI and nothing to pay.

Sign in with publik

The app at /app sits behind Sign in with publik (through Vedant's builds hub listing). Signing in is all it asks: Peel uses no AI, so there is no plan or key step. The landing page stays open.

Run it yourself

git clone https://github.com/VedSoni-dev/peel.git
cd peel
npm install
npm run dev

Open http://localhost:3000. Requires Node 20.9 or newer. Nothing to configure.

Screenshots

Sign in with publik

How it works

Product data comes from Open Food Facts, the open database of food labels (ODbL; product photos CC BY-SA). The barcode is read on your phone with the browser's BarcodeDetector, or the same API from zxing-wasm (served from this app, no CDN). Only the number goes to the server, which asks Open Food Facts and caches the answer for a day.

The score uses the split Yuka publishes, with Peel's own maths, all in lib/score.ts:

Part Points How
Nutrition 60 From the 2023 Nutri-Score number: food A ≤ 0 → about 50 points, E ≥ 19 → under 14 (drinks on their own scale)
Additives 30 Minus 8 per moderate-risk additive, minus 2 per limited one. A high-risk additive sets this to 0 and caps the whole score at 49
Organic 10 An official organic label (USDA, EU and others)

Bands: Excellent 75+, Good 50+, Poor 25+, Bad under 25. The additive table (lib/additives.ts, about 180 E-numbers) is Peel's own reading of public positions (EFSA re-evaluations, the EU's warning label for six colours, IARC classifications, FDA decisions); an additive not in it is shown as "not rated" and costs nothing. Swaps come from Open Food Facts' search: the same category, graded A or B, scoring higher than yours. Nothing in Peel uses AI.

Path What
app/route.ts, lib/landing.ts The landing page (static HTML on public/assets)
app/app/page.tsx, components/ The app: scanner, score, additives, swaps; components/Gate.tsx is the publik sign-in
lib/score.ts, lib/additives.ts The score and the additive table
lib/off.ts, app/api/product, app/api/swaps Open Food Facts lookups and swaps
lib/samples.json Six real products saved from Open Food Facts, for "Try a sample"
kit/ Shared studio kit: Sign in with publik, theme and motion tokens
studio.config.ts Name and links; publik is the sign-in

Privacy. The camera picture never leaves your phone; only the barcode number does. Your scan history is kept in your browser (localStorage). The app sends an anonymous usage count to Vedant's builds hub (this app's name, a random id per browser; no content, no IP, no account), and never for browsers with Do Not Track or Global Privacy Control.

Contributing

Issues and pull requests are welcome. For a bigger change, open an issue first so we can talk about it.

License

MIT © Vedant Soni

Built in public by @vedanttalksai. More builds at vedantsoni.com.

About

Scan any grocery barcode and see how healthy it really is

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages