The Ultimate AI-Powered Nutrition Assistant
TruthLens isn't just a calorie counter. It's an intelligent nutrition companion that helps you "see the truth" behind the food you eat.
Built as a modern Progressive Web App (PWA), it combines the power of cloud AI (Groq, Gemini) with self-hosted privacy (Ollama, SearXNG) to instantly analyze products, decode ingredients, and generate personalized health quests.
- ๐ Instant Grading: Our proprietary Smart Grade algorithm evaluates products from A (Excellent) to E (Avoid) based on ingredients, processing, and nutrition.
- ๐งช Ingredient Decoder: Instantly identifies harmful additives, allergens, and hidden sugars.
- ๐ท Scanner v2: Built on Native Barcode Detection API (Android/iOS) for instant, 60fps scanning. Features zero-lag redirection, continuous focus, and offline-first detection.
TruthLens uses a unique AI Swarm architecture to race multiple AI providers:
- Self-Hosted Power: Defaults to your own Azure VM (Llama 3.2) for fast, private, and unlimited inference.
- Cloud Fallback: Seamlessly switches to Groq (Llama 3) or Gemini 1.5 for complex reasoning.
- Context-Aware: The
/ai-chatremembers your dietary preferences and health goals.
- Fair Pricing: Monthly subscriptions or a unique Lifetime Deal.
- Tiered Features:
- Explorer (Free):
- Basic AI (Azure Ollama - completely free, no key needed)
- AI Chat: Available with Bring Your Own Key (BYOK) for Groq/Gemini
- 10 messages/day with your own API key
- Basic product scanner (5 scans/day)
- Limited history (10 items)
- Plus ($4.99/mo):
- Everything in Free
- Platform AI keys included (no BYOK needed)
- 20 scans/day
- Global search enabled
- Pro ($9.99/mo):
- Unlimited scans & AI chat
- All premium AI models included
- Visual search & meal planning
- PC Builder access
- Priority support
- Ultimate ($19.99/mo):
- All Pro features
- White label reports
- Beta access to new features
- Explorer (Free):
๐ก Tip for Free Users: You can use AI Chat by adding your own free API keys from Groq or Google AI Studio. Or upgrade to Plus to get platform keys included!
- Control Center: Manage users, subscriptions, and app config in real-time.
- Dynamic Logic: Toggle maintenance mode or adjust pricing without redeploying.
- Infrastructure Config: Configure your self-hosted AI endpoints directly from the UI.
TruthLens is designed to run its own AI infrastructure for zero API costs and unlimited usage.
| Service | Purpose | Model/Engine | Status |
|---|---|---|---|
| Ollama | LLM Inference | tinyllama (1.1B) |
โ Integrated |
| SearXNG | Web Search | Metasearch | โ Integrated |
- ๐ Privacy First: Your queries stay on your server when using self-hosted models.
- ๐ฐ Zero Recurring Costs: No per-token billing.
- ๐ Configurable: Update URLs in
Admin > Settings.
TruthLens exposes a modular service architecture. Here's how to interact with the core systems:
The central hub for all intelligence.
import { getSwarmResponse } from '@/services/aiService';
// Races Ollama, Groq, and Gemini to answer
const response = await getSwarmResponse("Is Red Dye 40 bad for kids?");Unified interface for OpenFoodFacts + External Search.
import { getProductAction } from '@/app/actions';
// Fetches from DB or scrapes web via SearXNG
const product = await getProductAction("barcode_or_name");Dynamic configuration engine backed by Firestore.
import { getSystemSettings } from '@/services/systemService';
// Get dynamic API keys (including self-hosted URLs)
const settings = await getSystemSettings();
console.log(settings.apiKeys.ollamaUrl);-
Clone the Repo:
git clone https://github.com/boubli/TruthLens.git cd TruthLens -
Install Dependencies:
npm install
-
Environment Setup: Create
.env.local:NEXT_PUBLIC_FIREBASE_API_KEY=... NEXT_PUBLIC_GEMINI_API_KEY=... NEXT_PUBLIC_GROQ_API_KEY=...
-
Run Development Server:
npm run dev
Copyright ยฉ 2025 Youssef Boubli. Licensed under the AGPL-3.0.
This project is open source for collaboration. You are welcome to:
- โ Use, study, and modify the code
- โ Contribute via pull requests
- โ Fork for personal/educational use
You may NOT:
- โ Rebrand and redistribute as your own product
- โ Use commercially without open-sourcing your modifications
We're building TruthLens to be the most comprehensive nutrition assistant. Here's what's plannedโcontributions welcome!
| Feature | Description | Difficulty |
|---|---|---|
| ๐ Multi-language Support | i18n for Arabic, French, Spanish, German | Medium |
| ๐ Nutrition Dashboard | Weekly/monthly intake charts & insights | Medium |
| ๐ฝ๏ธ Meal Planning AI | Generate personalized meal plans based on goals | Hard |
| ๐๏ธ Fitness Integration | Sync with Apple Health / Google Fit | Hard |
| Feature | Description | Difficulty |
|---|---|---|
| ๐ธ Visual Food Recognition | AI to identify food from photos | Hard |
| ๐ Shopping List Generator | Auto-generate lists from meal plans | Medium |
| ๐ฅ Family Profiles | Track nutrition for multiple users | Medium |
| ๐ฎ Gamification | Achievements, streaks, health quests | Easy |
| ๐ฑ Native Mobile Apps | React Native iOS/Android apps | Hard |
| ๐ Smart Reminders | Hydration, meal timing notifications | Easy |
- Unit tests & E2E testing (Jest, Playwright)
- CI/CD pipeline improvements
- Performance optimization
- Offline-first PWA enhancements
- API documentation (OpenAPI/Swagger)
๐ก Want to work on something? Open an issue first to discuss your approach!
Contributions are welcome! Here's how to get started:
- Fork the repository
- Create a branch:
git checkout -b feature/your-feature-name - Make changes and commit:
git commit -m "feat: add your feature" - Push to your fork:
git push origin feature/your-feature-name - Open a Pull Request to
main
- ๐ Open an issue first for major changes
- โ Follow existing code style (TypeScript, ESLint)
- ๐งช Test your changes before submitting
- ๐ Update docs if needed
- ๐ Never commit secrets or API keys
Look for issues labeled good first issue or help wanted to get started!
Empowering healthier choices, one scan at a time.
