8000 GitHub - Waqar53/NutriScan · GitHub
[go: up one dir, main page]

Skip to content
Waqar53Public

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🥗 NutriScan AI

The AI-Powered Calorie Tracking App That Makes Logging Effortless

📸 Snap a photo → Get nutrition instantly. No more manual typing.

License: MIT Python 3.11+ Next.js 14


✨ Features

Feature Description
📸 Photo Scanning AI recognizes food from photos using multiple ML models
📋 Label OCR Point camera at nutrition labels for instant scanning
🎤 Voice Logging "I had 2 eggs and toast" - natural language input
📊 Smart Analytics Trends, insights, and AI-powered recommendations
🔥 Gamification Streaks, XP, levels, achievements to keep you motivated
🆓 100% Free No premium tier, no ads, just results

🚀 Quick Start

Prerequisites

  • Python 3.11+
  • Node.js 20+
  • (Optional) Docker

Development Setup

# Clone the repository
git clone https://github.com/yourusername/NutriScan-ai.git
cd NutriScan-ai

# Backend setup
cd backend
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
python seed_foods.py  # Seed with 150+ foods
uvicorn main:app --reload

# Frontend setup (new terminal)
cd frontend
npm install
npm run dev

Visit:

Docker Setup (Production)

docker-compose up -d

This starts:

  • PostgreSQL database
  • Redis cache
  • FastAPI backend
  • Next.js frontend

📱 How It Works

1. Photo Recognition

User uploads photo → Multiple AI models analyze → Food detected → Nutrition from database

Models used:

  • nateraw/food (Food-101 trained)
  • Kaludi/food-category-classification-v2.0
  • Fallback to common foods database

2. Voice/Text Logging

"I had a chicken sandwich and a banana" 
→ NLP parses entities 
→ Matches to database 
→ Logged with nutrition

3. Gamification

Action XP
Log meal +10
Photo/Voice log +15
Hit calorie target +25
Hit protein target +20
7-day streak +100
30-day streak +500

🏗️ Tech Stack

Backend

  • Framework: FastAPI (Python 3.11)
  • Database: SQLite (dev) / PostgreSQL (prod)
  • AI APIs: Hugging Face (free tier)
  • Food Data: USDA + OpenFoodFacts

Frontend

  • Framework: Next.js 14 (App Router)
  • Styling: Tailwind CSS
  • Language: TypeScript

📁 Project Structure

NutriScan-ai/
├── backend/
│   ├── api/           # API routes
│   │   ├── auth.py    # Authentication
│   │   ├── meals.py   # Meal logging
│   │   ├── foods.py   # Food search
│   │   ├── scan.py    # AI scanning
│   │   └── analytics.py
│   ├── models/        # SQLAlchemy models
│   ├── schemas/       # Pydantic schemas
│   ├── main.py        # FastAPI app
│   └── seed_foods.py  # Database seeder
│
├── frontend/
│   ├── src/app/       # Next.js pages
│   ├── src/lib/       # API client, auth
│   └── src/components/
│
└── docker-compose.yml # Production deploy

🔌 API Endpoints

Endpoint Method Description
/auth/register POST Create account
/auth/login POST Get JWT token
/meals/ GET/POST List/create meals
/foods/search GET Search food database
/scan/photo POST AI photo recognition
/scan/voice POST Natural language log
/analytics/daily GET Daily summary
/analytics/trends GET Nutrition trends

Full docs: http://localhost:8000/docs


🤝 Contributing

  1. Fork the repository
  2. Create feature branch: git checkout -b feature/amazing
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing
  5. Open a Pull Request

📄 License

MIT License - see LICENSE for details.


🙏 Acknowledgments


Built with ❤️ for healthier eating

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0