ENCODE 2026 Hackathon @ IIT Guwahati
AI-powered food ingredient analysis and health risk assessment platform
- Overview
- Features
- Architecture
- Technology Stack
- Prerequisites
- Quick Start
- Project Structure
- Development
- Deployment
- Contributing
- License
- Team
AI Health Ingredient Copilot is an intelligent health analysis platform that helps users make informed decisions about food products by analyzing ingredient labels using advanced AI. The system extracts ingredients from product images, assesses health risks based on user profiles, and provides personalized recommendations.
- πΈ OCR-based Label Extraction - Extract brand names and ingredient lists from food labels
- 𧬠Clinical Profile Mapping - Convert health conditions to biochemical triggers
- π¬ Evidence-based Analysis - Fetch clinical research and regulatory data for ingredients
β οΈ Risk Assessment - Identify potential health risks based on user profile- π‘ Smart Recommendations - Suggest healthier product alternatives
- π€ Conversational AI - Friendly expert insights with visual indicators (π’/π‘/π΄)
- π User Authentication - Secure JWT-based authentication system
- π€ Health Profiling - Personalized health condition tracking
- π Real-time Analysis - Instant AI-powered ingredient assessment
- π― Risk Scoring - NOVA classification and health risk indicators
- π± Responsive Design - Beautiful UI across all devices
- π Multi-modal Input - Support for image upload and URL analysis
- π History Tracking - Save and review past analyses
- LangGraph Workflow - Sophisticated AI agent pipeline
- Google Gemini Integration - State-of-the-art AI model
- Clinical Evidence Search - Real-time medical research lookup
- Regulatory Database - International food safety regulations
- Alternative Suggestions - Healthier product recommendations
graph TB
A[React Frontend<br/>Port 5173] --> B[Node.js Auth Server<br/>Port 8080]
A --> C[FastAPI AI Server<br/>Port 8000]
B --> D[(MongoDB<br/>User Data)]
C --> E[Google Gemini<br/>AI Model]
C --> F[Tesseract OCR]
C --> G[Web Scraper<br/>Clinical Data]
style A fill:#61dafb
style B fill:#68a063
style C fill:#009688
style D fill:#4db33d
style E fill:#4285f4
-
Frontend (React + Vite)
- User interface and interaction
- Authentication flow
- Health profile management
- Real-time analysis display
-
Node Server (Express + MongoDB)
- User authentication (JWT)
- Health profile storage
- Session management
- User data persistence
-
FastAPI Server (Python + LangGraph)
- AI health agent workflow
- Image OCR processing
- Ingredient analysis
- Clinical risk assessment
- Alternative recommendations
- Framework: React 19.2.0
- Build Tool: Vite 7.2.4
- Styling: TailwindCSS 4.1.18
- Animations: Framer Motion 12.23.26
- Routing: React Router DOM 7.11.0
- HTTP Client: Axios 1.13.2
- Icons: React Icons 5.5.0
- Runtime: Node.js 18+
- Framework: Express 5.2.1
- Database: MongoDB + Mongoose 9.1.1
- Authentication: JWT (jsonwebtoken 9.0.3)
- Security: Helmet 8.1.0, bcryptjs 3.0.3
- Logging: Morgan 1.10.1
- Framework: FastAPI 0.115.6
- Server: Uvicorn 0.34.0
- AI/ML: LangChain 0.3.14, LangGraph 0.2.64
- LLM: Google Generative AI 0.8.3
- OCR: Tesseract, OpenCV 4.10.0
- Image Processing: Pillow 11.0.0
- Web Scraping: BeautifulSoup4 4.12.3
- Node.js 18+ (Download)
- Python 3.10+ (Download)
- MongoDB (Download or use MongoDB Atlas)
- Tesseract OCR (Installation Guide)
# Install Homebrew (if not installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install required software
brew install node python tesseract mongodb-community- Google AI API Key - Get from Google AI Studio
git clone <repository-url>
cd "ENCODE 2026 HACKATHON IIT GUWAHATI"cd frontend
npm install
cp .env.example .env
# Edit .env and configure API URLs
npm run devFrontend will run at: http://localhost:5173
cd NodeServer
npm install
cp .env.example .env
# Edit .env and add MongoDB URI, JWT secrets
npm run devNode server will run at: http://localhost:8080
cd FASTAPISERVER
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
# Edit .env and add Google API key
python run.pyFastAPI server will run at: http://localhost:8000
- Frontend: http://localhost:5173
- Node API: http://localhost:8080/health
- FastAPI Docs: http://localhost:8000/docs
ENCODE 2026 HACKATHON IIT GUWAHATI/
βββ frontend/ # React + Vite frontend
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Route pages
β β βββ services/ # API integration
β β βββ context/ # React context (auth)
β β βββ assets/ # Static assets
β βββ .env.example
β βββ package.json
β
βββ NodeServer/ # Express + MongoDB backend
β βββ src/
β β βββ routes/ # API routes
β β βββ controllers/ # Request handlers
β β βββ models/ # Mongoose models
β β βββ middleware/ # Custom middleware
β β βββ config/ # Configuration
β β βββ utils/ # Utilities
β βββ .env.example
β βββ package.json
β
βββ FASTAPISERVER/ # FastAPI + AI backend
β βββ app/
β β βββ api/routes/ # API endpoints
β β βββ services/ # Business logic
β β β βββ health_agent/ # LangGraph AI agent
β β βββ models/ # Pydantic models
β β βββ middleware/ # Middleware
β β βββ config/ # Settings
β β βββ utils/ # Utilities
β βββ uploads/ # Temporary files
β βββ logs/ # Application logs
β βββ .env.example
β βββ requirements.txt
β
βββ .gitignore
βββ README.md # This file
cd frontend
npm run dev # Start dev server with HMR
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLintcd NodeServer
npm run dev # Start with nodemon (auto-restart)
npm start # Start production servercd FASTAPISERVER
source venv/bin/activate # Activate virtual environment
python run.py # Start with auto-reload
uvicorn app.main:app --reload # Alternative start methodEach service requires specific environment variables. Copy .env.example to .env in each directory and configure:
- Frontend: API URLs, feature flags
- Node Server: MongoDB URI, JWT secrets, CORS origins
- FastAPI Server: Google API key, server config, OCR settings
cd frontend
npm run build
# Deploy dist/ folder- Set environment variables in platform dashboard
- Ensure MongoDB connection string is configured
- Use start command:
npm start
- Set environment variables
- Install Tesseract in build script
- Use start command:
uvicorn app.main:app --host 0.0.0.0 --port $PORT
Build Script for FastAPI (Render):
#!/usr/bin/env bash
apt-get update && apt-get install -y tesseract-ocr
pip install -r requirements.txtThis project was built for the ENCODE 2026 Hackathon at IIT Guwahati.
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
- Frontend: ESLint rules defined in
eslint.config.js - Python: Follow PEP 8 guidelines
- JavaScript: ES6+ modern syntax
ISC License - See LICENSE file for details
ENCODE 2026 Team
IIT Guwahati
MongoDB Connection Failed
- Ensure MongoDB is running:
brew services start mongodb-community - Check connection string in
.env
Tesseract Not Found
- Install via Homebrew:
brew install tesseract - Verify installation:
tesseract --version
Port Already in Use
- Check running processes:
lsof -i :PORT - Kill process or change port in
.env
CORS Errors
- Verify CORS_ORIGINS in server
.envfiles - Ensure frontend URL is whitelisted
Built with β€οΈ for ENCODE 2026 Hackathon