AI food-label scanner · 03 / 09
FoodScan
Scan a food barcode for a transparent 0–100 health score, and add missing local products through Arabic and English OCR.
- Role
- Solo developer · capstone
- Year
- 2026
- Status
- MVP complete
- Platform
- Android · iOS · Web admin

Overview
The project.
Shoppers in Libya can't quickly judge how healthy a packaged food is, local products are largely missing from global databases, and labels are often bilingual Arabic and English, which common on-device OCR can't read.
FoodScan is one product made of three services: a Flutter app, a Laravel API with a Filament admin panel, and a Python OCR microservice. A barcode scan returns a rule-based score with its reasons, and unknown products are crowdsourced from label photos and approved by an admin before they go live.
The problem
No quick, trustworthy way to judge packaged food in Libya: local products are missing from global databases and bilingual labels defeat on-device OCR.
My solution
A transparent scoring engine, Open Food Facts to fill catalogue gaps, and a contribution flow where server-side Arabic and English OCR pre-fills the nutrition panel for an admin to review before publishing.
What it does
Key features.
- 01
Barcode scan
Looks up approved products first, then falls back to Open Food Facts, importing, scoring and publishing what it finds.
- 02
Explainable health score
A seven-stage 0–100 score: penalties for sugar, sodium, saturated fat and calories, credits for protein and fibre, oil quality and capped additive penalties.
- 03
Additives guide
Around 145 EU E-numbers in low, medium and high risk tiers, parsed from ingredient text, with list and detail screens.
- 04
Contribute a product
A guided wizard for product info, label photos and a nutrition-panel crop, with draft saving and OCR prefill.
- 05
Bilingual OCR
A PaddleOCR microservice that reads Arabic and English labels and returns eight nutrition fields with confidence scores.
- 06
Scan history
Paginated history with score-band filters and safe deletion.
- 07
Admin review queue
A Filament panel to approve, edit then approve, or reject submissions, with the reviewer and time recorded.
- 08
Arabic and English app
Arabic right-to-left by default with English, and the chosen language persists without a layout flash on launch.
Interface
Screens from the real app.



Under the hood
How it's built.
Architecture and the engineering decisions behind it.
01
Three deployable services
A Flutter app, a Laravel 13 API with a Filament admin and a FastAPI OCR service live in separate repositories and deploy independently, documented by an OpenAPI 3.1 spec.
02
Score once, read many
A pure scoring service computes the score at approval or import time and stores it; the score band is derived from configuration when it's read.
03
OCR behind the API
The app never calls OCR directly. The backend forwards a cropped label to the internal service with a shared key and returns a prefill where low-confidence values come back empty.
04
Failure never blocks a user
OCR timeouts, errors or bad responses become an “OCR unavailable” notice, and the user simply types the values in.
05
JWT with safe refresh
Access and refresh tokens, refresh rotation under a row lock and an app interceptor that tells an expired session apart from a network blip.
Problems solved
Technical challenges.
Arabic and English OCR on a CPU
No single model reads both scripts well, so the service runs an Arabic and an English PaddleOCR model and merges their lines, pinned to a version that keeps CPU acceleration enabled.
Messy bilingual labels
More specific keywords win (“saturated fat” before “fat”), Arabic spelling variants and Arabic-Indic digits are normalized, and kilojoules convert only when no kcal value exists.
Image privacy
Label photos are never stored: they're purged on success, error or timeout, with upload size and decompression-bomb limits.
Races in a small app
History writes are single upserts, imports recover from unique-constraint races, and refresh rotation is locked so a double tap can't fork a session.
Development status · MVP complete
What's next.
Everything above is built and working. These parts are planned and not implemented yet:
- Brand and category on contributed products
- Email verification and password reset
- Notifying contributors when a submission is reviewed
- Healthier alternatives on the result screen