About the Project: Fake Detector App
The Inspiration: Fighting a "Silent Epidemic" 💊
The primary inspiration for this project comes from the devastating reality of counterfeit pharmaceuticals in Nigeria. It is a crisis often referred to by health experts as a "silent epidemic."
Recent data reveals the horrific scale of this problem:
- A National Crisis: In sub-Saharan Africa, it is estimated that over 500,000 people die annually due to counterfeit drugs.
- Targeting the Vulnerable: In Nigeria specifically, substandard malaria drugs are linked to approximately 267,000 deaths every year, while fake antibiotics contribute to nearly 169,000 deaths among children suffering from pneumonia.
- A Deadlier Threat than War: Officials from NAFDAC (National Agency for Food and Drug Administration and Control) have noted that deaths caused by substandard medicines and unsafe foods in Nigeria often surpass the casualties from regional conflicts.
- The 2025 Reality: Economic hardships have unfortunately driven a surge in demand for cheaper medications, making the market more porous for unscrupulous peddlers.
Watching these statistics turn into real stories of illness and lost lives inspired the creation of this Fake Detector App—a tool designed to use cutting-edge technology to put the power of verification directly into the hands of every Nigerian citizen.
How I Built It 🛠️
To combat such a fast-moving threat, I built a high-performance hybrid platform that bridges the gap between official regulatory data and the person standing in a pharmacy.
- Hybrid Architecture: The app is built with Next.js 14 as the core engine and wrapped with Capacitor, allowing it to run as a high-performance native Android app with full access to camera hardware for high-resolution scans.
- The AI Multi-Provider Brain: Realizing that one AI might fail or be too slow, I implemented a custom AI Fallback Manager. It orchestrates Google Gemini 2.5 Flash, Anthropic Claude 3.5, and Amazon Bedrock (Nova AI) sequentially. If one provider hits a quota or fails to read a blurred batch number, the next one takes over automatically.
- Intelligent Safety Matching: I integrated Transformers.js to run semantic similarity models (
all-MiniLM-L6-v2) directly in the backend. This allows the app to compare the text extracted from a bottle against thousands of official NAFDAC "Recall & Alert" entries, identifying a match even if the manufacturer's name is misspelled on the package. - Real-time Regulatory Sync: A custom scraping engine monitors official safety feeds to ensure the app's internal "Watchlist" of dangerous products is always manually and automatically up to date.
The Challenges I Faced 🧠
Building a tool where a failure could mean a safety risk presented unique technical hurdles:
- Serverless Scaling with AI: Integrating heavy machine learning libraries like
@xenova/transformersinto a serverless environment required deep optimization of Webpack configurations to handle the complexities of ONNX runtimes. - OCR Reliability: Standard OCR often fails on metallic or curved medicine bottles. Solving this required a dedicated Image Preprocessing Service to sharpen images and adjust lighting before analysis.
- The "JSON.parse" Bottleneck: I faced a major challenge where Tesseract workers would crash in isolated server processes. This led to a "JSON.parse: unexpected character" error for users. I had to architect a robust bypass that prioritizes cloud-based vision models to ensure the app never crashes during a critical scan.
What I Learned 📖
Building the Fake Detector App was a journey in technical and social responsibility.
- Technology is a Guardian: I learned how to balance Latency vs. Accuracy, ensuring that a scan happens in seconds but never compromises on the correctness of the verification.
- Resilience is Key: If one AI model is down, the system must have a "plan B" and "plan C" to ensure the user is never left without an answer.
- Trust as a Feature: In the healthcare space, software isn't just about code—it's about building an interface that feels reliable and provides clear, actionable safety information.
This project stands as a testament to the belief that with the right tools, we can take a meaningful stand against counterfeit products and protect the health of our communities.
Built With
- admob
- amazon
- android
- anthropic
- axios
- chatgpt
- cheerio
- claude
- css3
- firebase
- flash
- gemini
- haiku
- html5
- javascript
- lite
- nextjs
- node.js
- nova
- openai
- orm
- postgresql
- prisma
- react
- transfomerjs
- typescript
- vercel
- zod
Log in or sign up for Devpost to join the conversation.