Instantly determine if any packaged food product is HALAL or NOT HALAL from a single photo using AI logo detection, OCR text analysis, and product databases.
The AI Halal Product Detector is designed to operate without barcodes. Users just snap a photo of the product's front packaging, and the system extracts exactly what it needs:
- Brand & Product Name Detection: Tesseract OCR extracts the text, normalizes it, and matches it against Indian brand dictionaries.
- AI Logo Detection: YOLOv8 scans for halal certification logos.
- Database Lookups: The extracted brand/product name is queried against a local Supabase database and the OpenFoodFacts Search API.
The decision engine combines multiple AI signals to produce a reliable certainty score, ranging from 40% (Unknown) to 95% (Highly Confident).
| Evidence | Confidence Score | Result |
|---|---|---|
| Local Database Match | 90–95% | DB Result (HALAL/NOT HALAL) |
| Halal Certification Logo detected via YOLOv8 | 90% | HALAL |
| "Halal" text detected via Tesseract OCR | 80% | HALAL |
| AI API Match (OpenFoodFacts fallback) | 70–85% | API Result |
| No definitive signals found | 40% | UNKNOWN (Conservative) |
(Note: The system defaults to UNKNOWN rather than "NOT HALAL" if there isn't enough evidence, ensuring users aren't misled by poor photo quality).
AHPD/
├── frontend/ # Next.js 14 app (Deployed to Vercel)
├── backend/ # FastAPI service (Deployed to Render)
├── supabase/ # PostgreSQL database schema + seed SQL
└── docs/ # GitHub media and documentation
cd backend
# Install system dependencies (ex. Tesseract)
# macOS:
brew install tesseract tesseract-lang
# Ubuntu/Debian:
# sudo apt install tesseract-ocr tesseract-ocr-eng tesseract-ocr-ara
# Python environment
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
# Configure environment variables
cp .env.example .env
# Edit .env → add SUPABASE_URL and SUPABASE_ANON_KEY (Provided via Supabase Project)
# Start server
uvicorn main:app --reload --port 8000cd frontend
# Set up environment variables
cp .env.local.example .env.local
# .env.local is pre-configured for localhost:8000
# Install & Run
npm install
npm run dev
# Open http://localhost:3000- Create a free project at supabase.com.
- Go to SQL Editor → New Query.
- Run
supabase/schema.sqlto create tables and RLS policies. - Run
supabase/seed.sqlto seed the database with 40+ Indian brand records. - Copy the Project URL and Publishable (anon) API Key from the Supabase dashboard.
- Paste them into
backend/.env.
- Push the
AHPDrepository to GitHub. - Go to render.com → New Web Service.
- Connect your GitHub repo and set the Root Directory to
backend/. - Render automatically detects the provided
Dockerfile. - Add environment variables:
SUPABASE_URLandSUPABASE_ANON_KEY. - Deploy (Docker build takes ~5 mins).
- Copy the deployed service URL (e.g.
https://ahpd-backend.onrender.com).
- Go to vercel.com → Add New Project.
- Import the
AHPDrepository and set the Root Directory tofrontend/. - Add the environment variable:
NEXT_PUBLIC_API_URL=https://ahpd-backend.onrender.com(Your Render URL). - Deploy! ✅
Balaji · Haldirams · Bikaji · Lays · Kurkure · Bingo · Parle · Britannia · Amul · Nestle · MTR · Patanjali · Tata · Sunfeast · Act II · Too Yumm · Prataap · Gopal · and more (via OpenFoodFacts expanding lookup).
This tool provides AI-assisted guidance only. For definitive halal certification, always consult the product manufacturer or a recognized halal certifying authority.


