AI-powered nutrition analysis and recipe assistant specialized in Thai cuisine. Helping Thai people make informed food choices through evidence-based nutrition science.
เธญเนเธฒเธเธ เธฒเธฉเธฒเนเธเธข: README-TH.md
-
๐ AI Food Recognition: Snap a photo and instantly identify ingredients using Google Gemini Vision API
-
๐ 8-Dimension Nutrition Scoring: Comprehensive health analysis including:
- Blood Sugar Impact (crucial for Thai diet)
- Gut Health Score
- Inflammation Score
- Nutrient Density
- Processing Level
- Protein Quality
- Micronutrient Coverage
- Overall Health Score
-
๐ Thai Food Specialization:
- 1000+ Thai recipes with nutrition data
- Common Thai ingredients database
- Cultural context and traditional wisdom
- Thai measurement conversions
-
๐ฌ AI Nutrition Coach:
- Chat with AI nutritionist in Thai or English
- Evidence-based recommendations
- Personalized advice based on your goals
-
๐ฑ Mobile-First PWA:
- Works like a native app
- Offline mode for saved recipes
- Quick camera access
- Blood Sugar Management: Specialized for Thai rice-heavy diet
- Eating Sequence Education: Vegetables โ Protein โ Fat โ Carbs โ Sweets (70% blood sugar reduction)
- Thai Payment Integration: PromptPay, TrueMoney, Rabbit Line Pay
- Line Login: Popular Thai messaging app integration
- Thai Language AI: Natural Thai conversation with nutrition AI
Backend (Python)
- FastAPI - Modern async API framework
- PostgreSQL - Primary database
- Redis - Caching and sessions
- Google Gemini AI - Image recognition and chat
- SQLAlchemy - ORM
- Alembic - Database migrations
Frontend (TypeScript)
- Next.js 14 - React framework with App Router
- Tailwind CSS - Utility-first styling
- next-intl - Internationalization (Thai + English)
- TanStack Query - Server state management
- Zustand - Client state management
- Recharts - Data visualization
Infrastructure
- Docker & Docker Compose - Containerization
- Nginx - Reverse proxy
- GitHub Actions - CI/CD
- Docker and Docker Compose
- Node.js 18+ and npm 9+
- Git
- Google Gemini API key (Get one here)
- Clone the repository
git clone https://github.com/bejranonda/Nutri-Vision-AI.git
cd Nutri-Vision-AInpx degit bejranonda/Nutri-Vision-AI my-nutrivision-app
cd my-nutrivision-app
npm install- Set up environment variables
cp .env.example .envEdit .env and add your credentials:
GEMINI_API_KEY=your_gemini_api_key_here
SECRET_KEY=your_secret_key_here # Generate with: openssl rand -hex 32
JWT_SECRET_KEY=your_jwt_secret_here- Start the application
docker-compose up -d- Initialize database
# Run migrations
docker-compose exec backend alembic upgrade head
# Seed Thai food data
docker-compose exec backend python app/db/seed_data.py- Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
- Navigate to "เธชเนเธเธเธญเธฒเธซเธฒเธฃ" (Scan Food)
- Take a photo or upload an image
- Get instant nutrition analysis with 8-dimension scores
- View detailed ingredient breakdown
- Go to "เธเธฃเธถเธเธฉเธฒเธเธนเนเนเธเธตเนเธขเธงเธเธฒเธ" (Ask Expert)
- Type your question in Thai or English
- Get evidence-based answers
- Chat history is saved
- Visit "เธชเธนเธเธฃเธญเธฒเธซเธฒเธฃ" (Recipes)
- Filter by dietary needs
- View detailed nutrition scores
- Save favorites
- Access "เนเธเธเธเธญเธฃเนเธ" (Dashboard)
- View scan history
- Track nutrition trends
- Set health goals
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reloadcd frontend
npm install
npm run dev# Backend tests
docker-compose exec backend pytest
# Frontend tests
docker-compose exec frontend npm testOur proprietary 8-dimension scoring system evaluates food across multiple health aspects:
- Calculates Glycemic Load
- Accounts for fiber content
- Critical for Thai high-carb diet
- Higher score = Lower blood sugar spike
- Fiber content (soluble/insoluble)
- Prebiotic and probiotic presence
- Fermented foods bonus
- Higher score = Better gut health
- Omega-3 to Omega-6 ratio
- Antioxidant ORAC values
- Anti-inflammatory ingredients
- Higher score = Anti-inflammatory
- Nutrients per calorie (ANDI score)
- Protein and fiber density
- Vitamin/mineral richness
- Higher score = More nutrients per calorie
- NOVA classification (1-4)
- Additive detection
- Whole food percentage
- Higher score = Less processed
- Complete amino acid profile
- Protein quantity
- Source quality (PDCAAS)
- Higher score = Better protein
- % RDI for 12 key vitamins/minerals
- Breadth of nutrient variety
- Bioavailability factors
- Higher score = More complete nutrition
- Weighted average of all dimensions
- Personalized to user goals
- Thai dietary context adjustments
- Higher score = Healthier overall
POST /api/auth/register # Register new user
POST /api/auth/login # Login with email/password
GET /api/auth/me # Get current user
POST /api/auth/refresh # Refresh access tokenPOST /api/scan/analyze # Analyze food image
GET /api/scan/history # Get scan history
GET /api/scan/{id} # Get specific scanGET /api/recipes/ # List recipes with filters
GET /api/recipes/{id} # Get recipe details
GET /api/recipes/featured # Get featured recipes
POST /api/recipes/suggest # Generate recipe suggestionsPOST /api/chat/ask # Ask AI nutritionist
GET /api/chat/history # Get chat historyGET /api/user/profile # Get user profile
PUT /api/user/profile # Update profile
GET /api/user/stats # Get usage statisticsSee full API documentation at: http://localhost:8000/docs
users
โโโ id (PK)
โโโ email (unique)
โโโ hashed_password
โโโ subscription_tier (free/premium/family)
โโโ language (th/en)
โโโ health_info (age, weight, height, goals)
โโโ usage_tracking
food_scans
โโโ id (PK)
โโโ user_id (FK)
โโโ image_url
โโโ detected_items (JSON)
โโโ nutrition_summary (JSON)
โโโ 8 dimension scores
recipes
โโโ id (PK)
โโโ name_th, name_en
โโโ ingredients (JSON)
โโโ instructions_th, instructions_en
โโโ nutrition_per_serving
โโโ dietary_flags (vegetarian, halal, etc.)
โโโ 8 dimension scores
ingredients
โโโ id (PK)
โโโ name_th, name_en
โโโ category
โโโ nutrition_per_100g
โโโ glycemic_index
โโโ special_properties
chat_messages
โโโ id (PK)
โโโ user_id (FK)
โโโ role (user/assistant)
โโโ content
โโโ language
meal_plans
โโโ id (PK)
โโโ user_id (FK)
โโโ plan_date
โโโ breakfast, lunch, dinner (JSON)
โโโ daily_totals
- โ No API keys in code (environment variables only)
- โ Password hashing with bcrypt
- โ JWT token authentication
- โ CORS protection
- โ Rate limiting on all endpoints
- โ SQL injection prevention (parameterized queries)
- โ XSS protection
- โ CSRF tokens
- โ
GDPR compliant from day 1
- Data export functionality
- Right to be forgotten
- Consent management
- Data minimization
Supports Thai (default) and English:
// Access translations
const t = useTranslations('namespace');
// Thai
<h1>{t('title')}</h1> // "NutriVision AI"
// Language switch
<Link href="/en/dashboard">English</Link>
<Link href="/th/dashboard">เนเธเธข</Link>Translation files:
frontend/src/messages/th.jsonfrontend/src/messages/en.json
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Write tests
- Commit with descriptive messages
- Push to your fork
- Open a Pull Request
- Python: PEP 8 (use
blackformatter) - TypeScript: ESLint + Prettier
- Commits: Conventional Commits format
This project is licensed under the MIT License - see LICENSE file for details.
- Website: https://nutrivision.app
- Email: [email protected]
- Issues: https://github.com/bejranonda/Nutri-Vision-AI/issues
- Discussions: https://github.com/bejranonda/Nutri-Vision-AI/discussions
- npm Package: https://www.npmjs.com/package/@nutrivision/nutrivision-ai
- Line Official: @nutrivisionai
- Facebook: facebook.com/nutrivisionai
- Email (Thai): [email protected]
- Thalay Community - For nutrition education insights and content inspiration
- Google Gemini - For powerful AI capabilities
- Thai Food Community - For recipe contributions and cultural context
- Early Beta Testers - For valuable feedback
- Core food scanning
- 8-dimension scoring
- Thai/English support
- Basic recipe database
- AI chat
- Restaurant menu scanning
- Barcode scanner
- Fitness tracker integration
- Voice input
- Meal comparison
- AI meal coach
- Recipe creator
- Marketplace
- Nutritionist consultation
- Corporate wellness
- Smartwatch app
- AR food scanning
- Blood glucose integration
- DNA-based nutrition
- International expansion
If you find this project helpful, please consider giving it a star!
Made with โค๏ธ for the Thai community
"เธญเธขเธนเนเนเธเนเธเธฒเธเธเธฃเนเธญเธกเธเธฑเธเธเธดเธเธญเธฒเธซเธฒเธฃเธญเธฃเนเธญเธข" - Live long while eating well