HalalTrace AI is an AI-powered compliance platform designed to ensure Halal certification authenticity and supply chain integrity. The platform combines a React-based high-fidelity dashboard with a high-performance Python FastAPI backend to deliver enterprise-grade document verification and risk assessment capabilities.
Here are screenshots of the running HalalTrace AI platform:
-
Secure User Registration & Login Role-based access control with JWT authentication
-
User Session Management Persistent sessions with automatic token refresh
-
Password Security Industry-standard bcrypt hashing for secure credential storage
-
User Profile Management Personalized dashboards and analysis history
Leveraging a unified Python backend to access sophisticated models and specialized AI libraries:
-
High-Fidelity OCR Powered by pytesseract and Pillow, providing industrial-grade text extraction from complex certificate layouts.
-
Server-Side NLP Uses Hugging Face transformers with the BART-large-mnli model for Zero-Shot Classification, delivering significantly higher accuracy than browser-based mobile models.
-
LLM Integration Leverages Groq API with the Llama 3 70B model for advanced document analysis and field extraction.
-
Risk Modeling Modular classification pipeline to detect suspect ingredients and compliance anomalies in real time.
-
ML Operations ML health monitoring, performance tracking, and model retraining capabilities.
-
Database Integration Persistent storage of user credentials and analysis results using SQLAlchemy ORM.
-
Unified RESTful Endpoints Consolidated routes:
/analyze– Document Processing/analyze-document– LLM Analysis/api/ml-health– ML Monitoring/health– System Status
-
Performance Monitoring Server-side inference latency (ms) measured per request and displayed in the UI.
-
Protected Endpoints Authentication-secured routes for sensitive operations.
-
Analysis History User-specific storage and retrieval of document analysis results.
-
Hybrid Flow React handles file ingestion; Python handles intensive intelligence processing.
-
Entity Extraction Python-based heuristics and NER (Named Entity Recognition) to isolate suppliers, ingredients, and dates.
-
Dual Processing Supports both:
- Local AI processing (OCR, transformers)
- Cloud LLM processing (Groq API)
-
Accreditation Verification Automated extraction and validation of accreditation bodies, numbers, and validity periods.
-
Multi-Format Support PDFs, images (JPG, PNG), and text inputs.
-
Server Model Inspector Raw JSON metadata from the Python engine exposed in the Document Intelligence view.
-
Real-Time Backend Status Online/Offline indicators with auto-polling.
-
ML Health Monitoring Pipeline status and performance metrics.
-
Audit Trails Comprehensive audit logs for compliance verification.
-
JWT Authentication Secure token-based user authentication.
-
Encrypted Storage Passwords and sensitive data protected with industry-standard encryption.
-
Role-Based Access Control Differentiated access levels for administrators and users.
-
Session Management Automatic session expiration and secure logout.
- Challenge: Ensuring all ingredients meet Halal certification requirements
- Solution: Upload certificates to verify authenticity and trace ingredient origins
- Benefit: Reduced compliance risk and increased consumer trust
- Challenge: Validating Halal certificates from international suppliers
- Solution: Cross-reference accreditation bodies and verify certificate validity periods
- Benefit: Mitigated fraud risk and regulatory compliance
- Challenge: Managing large volumes of certification documents
- Solution: Automated document analysis and risk assessment
- Benefit: Streamlined verification and improved operational efficiency
- Challenge: Maintaining Halal integrity across supply chains
- Solution: Track and verify certification authenticity at multiple levels
- Benefit: Preserved product authenticity and customer confidence
- Problem: Fake or expired Halal certificates
- Solution: Automated accreditation and validity verification
- Impact: Eliminates counterfeit certifications and protects brand reputation
- Problem: Time-intensive manual reviews
- Solution: AI-powered automated analysis
- Impact: Verification reduced from hours to seconds
- Problem: Multi-tier compliance tracking difficulty
- Solution: End-to-end audit trails and historical analysis
- Impact: Full transparency and compliance assurance
- Problem: Disconnected systems and fragmented insights
- Solution: Centralized document intelligence platform
- Impact: Unified compliance management and better decisions
-
Backend: Python 3.10, FastAPI, Uvicorn, Pytesseract, Hugging Face Transformers, Groq API, SQLAlchemy, JWT
-
Frontend: React 19, TypeScript, Lucide Icons, Recharts, D3.js
-
Authentication: JWT-based authentication with bcrypt password hashing
-
Database: SQLite (extensible to PostgreSQL / MySQL)
Create a .env file in the root directory:
GROQ_API_KEY=your_groq_api_key_here
npm install
pip install -r requirements.txt
Ensure the tesseract binary is installed:
npm run start-backend
# or
python -m uvicorn backend.unified_backend:app --host 0.0.0.0 --port 8000
npm run dev
The frontend runs on port 3000 and automatically connects to the unified backend:
- API calls forwarded to
http://localhost:8000 - Authentication endpoints secured
- User-specific analysis history stored and retrieved





