NutriChef is a comprehensive web application designed to help users manage recipes, understand nutritional information, cater to dietary restrictions and allergies, and discover new culinary ideas. It leverages AI for advanced features like food classification from images, natural language processing of recipes, and personalized recommendations.
NutriChef combines modern web technologies with AI-powered features to provide an intelligent cooking companion that adapts to your dietary needs and preferences.
| Feature | Desktop Screenshot | Mobile Screenshot |
|---|---|---|
| Home Page | ![]() |
![]() |
| Feature | Desktop Screenshot | Mobile Screenshot |
|---|---|---|
| Login & Registration | ![]() |
![]() |
- Browse & Search public recipe collection with advanced filters
- Detailed Recipe Views with ingredients, instructions, and images
- Multiple Upload Methods:
- Structured form submission
- Raw text parsing with AI (NLP Recipe Parser)
- Image upload support
- Recipe Rating System with user reviews
- Recipe Comments for community interaction
- Recipe Tagging System for better organization
| Feature | Screenshot |
|---|---|
| Recipe Browser | ![]() |
| Recipe Details | ![]() |
| Recipe Upload | ![]() |
- Personalized Recipe Feed filtered by dietary restrictions
- Allergy & Intolerance Management with comprehensive database
- Nutritional Target Setting for health goals
- Favorites System for saving preferred recipes
| Feature | Screenshot |
|---|---|
| Personalized Recipes | ![]() |
| Allergy Settings | ![]() |
- Smart Pantry Management with ingredient tracking
- Meal Planning with nutritional analysis and PDF export
- Shopping List Generation from recipes and meal plans
- Recipe Suggestions based on available ingredients
| Feature | Screenshot |
|---|---|
| Pantry Management | ![]() |
| Meal Planner | ![]() |
- Ingredient Classifier using computer vision for food identification
- Nutrition Lookup with comprehensive nutritional database
- Ingredient Substitution recommendations
- AI Chatbot for cooking and nutrition assistance
- Recipe Text Parser using natural language processing
| Feature | Screenshot |
|---|---|
| Ingredient Classifier | ![]() |
| Classification Results | ![]() |
| Nutrition Lookup | ![]() |
| AI Chatbot | ![]() |
- Forum System with recipe discussions and community posts
- Recipe Tagging with
#RecipeNamesyntax - User Comments on recipes and forum posts
- Like System for community engagement
- Contact Form for user feedback and support
| Feature | Screenshot |
|---|---|
| Contact Us | ![]() |
| Forum Discussions | ![]() |
| Recipe Suggestions | ![]() |
| Shopping Basket | ![]() |
| Nutritional Tracking | |
| User Favorites | ![]() |
- Comprehensive Admin Dashboard with system overview
- Real-time System Monitoring with performance metrics
- AI Model Performance Tracking for classification accuracy
- User Activity Analytics and engagement metrics
| Feature | Screenshot |
|---|---|
| Admin Dashboard | ![]() |
- User Management with role assignment and account control
- Recipe Moderation with approval and deletion capabilities
- Forum Management with post and comment moderation
- Content Analytics for platform insights
- Message Management for user inquiries and support
- Email Response System for customer service
- Notification System for user engagement
| Feature | Screenshot |
|---|---|
| Message Management | ![]() |
| System Logs Monitor | ![]() |
| User Management | ![]() |
| Recipe Management | ![]() |
| Forum Management | ![]() |
- Real-time Log Monitoring with filtering and search
- System Health Checks with automated alerts
- Database Management tools and utilities
- Performance Optimization monitoring
Note
Admin features require elevated permissions and are protected by role-based access control.
| Technology | Purpose |
|---|---|
| Containerization and deployment | |
| Docker Compose | Multi-container orchestration |
| Nginx | Reverse proxy and static file serving |
| Tool | Purpose |
|---|---|
| Primary development environment | |
| ESLint | JavaScript code linting |
| Git | Version control |
| Postman | API testing and documentation |
The application is designed with a microservices architecture in mind, making it easy to scale individual components as needed.
| Feature | Technology | Description |
|---|---|---|
| π Food Classification | TensorFlow + Computer Vision | Identifies ingredients and food items from uploaded images |
| π Recipe Text Parsing | Google Gemini + NLP | Converts raw recipe text into structured data |
| π€ Intelligent Chatbot | Google Gemini | Provides cooking advice and nutritional guidance |
| π Ingredient Substitution | Fuzzy Matching + Database | Suggests suitable ingredient alternatives |
| π Nutrition Analysis | External APIs + Database | Comprehensive nutritional information lookup |
| π― Allergy Detection | Pattern Matching | Identifies potential allergens in recipes |
Note
Food Classification Models:
- Core models are integrated within the
backend/ai_models/directory - Detailed implementation and training notebooks: Food Classification Repository
- Supports multiple food categories with high accuracy rates
- Smart Recipe Suggestions based on pantry contents and dietary preferences
- Nutritional Goal Tracking with intelligent meal planning
- Automated Recipe Categorization using machine learning
- Personalized Content Filtering based on user preferences and restrictions
- Real-time Ingredient Recognition through camera integration
NutriChef/
βββ ποΈ SQL/ # Database schema and migrations
β βββ schema_mysql.sql # Main database schema
β βββ migration_scripts/ # Database migration files
βββ π backend/ # Flask API server
β βββ π€ ai_models/ # Machine learning models
β β βββ classification/ # Food classification models
β β βββ nlp/ # Natural language processing
β β βββ nutrition/ # Nutrition analysis models
β βββ ποΈ dao/ # Data Access Objects
β βββ π models/ # SQLAlchemy database models
β βββ π£οΈ routes/ # API endpoints (Flask Blueprints)
β β βββ admin_routes.py # Admin management endpoints
β β βββ recipe_routes.py # Recipe CRUD operations
β β βββ user_routes.py # User authentication & profile
β β βββ forum_routes.py # Community forum features
β β βββ chatbot_routes.py # AI chatbot integration
β β βββ classification_routes.py # Image classification API
β β βββ nutrition_routes.py # Nutrition lookup services
β β βββ pantry_routes.py # Pantry management
β β βββ meal_planner_routes.py # Meal planning features
β β βββ contact_message_routes.py # User support system
β βββ π§ services/ # Business logic layer
β β βββ main/ # Core services
β β βββ ai/ # AI service integrations
β β βββ external/ # Third-party API services
β βββ π οΈ utils/ # Utility functions and helpers
β βββ π static/ # Uploaded files and assets
β βββ π§ͺ tests/ # Backend test suites
β βββ app.py # Flask application factory
β βββ config.py # Configuration management
β βββ requirements.txt # Python dependencies
βββ βοΈ frontend/ # React client application
β βββ π± src/
β β βββ π§© components/ # Reusable UI components
β β β βββ admin/ # Admin-specific components
β β β βββ auth/ # Authentication components
β β β βββ forum/ # Forum and community features
β β β βββ chatbot/ # AI chatbot interface
β β β βββ ui/ # Generic UI components
β β β βββ layout/ # Layout and navigation
β β βββ π pages/ # Route-level page components
β β β βββ admin/ # Admin dashboard pages
β β β βββ forum/ # Forum pages
β β β βββ recipes/ # Recipe-related pages
β β βββ π context/ # React Context providers
β β βββ π£ hooks/ # Custom React hooks
β β βββ π οΈ utils/ # Frontend utilities
β β βββ π¨ styles/ # CSS and styling
β βββ package.json # NPM dependencies
β βββ vite.config.js # Vite build configuration
βββ π deployment/ # Deployment configurations
β βββ VPS_DEPLOYMENT_GUIDE.md # VPS deployment instructions
β βββ EXTERNAL_ACCESS_GUIDE.md # External access setup
β βββ PUBLIC_ACCESS_GUIDE.md # Public deployment guide
β βββ vps-setup.sh # Automated VPS setup script
βββ π docs/ # Project documentation
β βββ πΌοΈ images/ # Screenshots and diagrams
β βββ π internal/ # Internal documentation
β βββ Project_Documentation.md # Technical documentation
β βββ User_Manual.md # End-user guide
β βββ Forum_Feature_Implementation.md
β βββ Meal_Suggestion_Implementation.md
β βββ Nutritional_Tracking_Feature.md
β βββ Session_Expiration_Management.md
β βββ Admin_Logs_Monitor.md
β βββ MobileModal_Animation_Updates.md
βββ π§ scripts/ # Development and deployment scripts
β βββ main.py # Cross-platform launcher
β βββ start_demo.bat # Windows demo launcher
β βββ LAUNCHER_README.md # Launcher documentation
βββ docker-compose.yml # Multi-container orchestration
βββ .env.example # Environment variables template
βββ README.md # This file
| Pattern | Implementation | Benefits |
|---|---|---|
| MVC Architecture | Models (SQLAlchemy), Views (React), Controllers (Flask Routes) | Clear separation of concerns |
| Service Layer | Business logic abstracted into service classes | Reusable and testable code |
| Repository Pattern | Data Access Objects (DAOs) for database operations | Database abstraction |
| Component-Based UI | React components with props and state management | Reusable and maintainable frontend |
| RESTful API Design | Consistent HTTP methods and resource naming | Standard API conventions |
The architecture follows modern web development best practices with clear separation between frontend, backend, and data layers.
The fastest way to get NutriChef running locally:
# Cross-platform Python launcher
python scripts/main.py
# Windows users can also use:
scripts/start_demo.batThe automated launcher handles all dependencies, environment setup, and service orchestration automatically.
Tip
This is the fastest way to get started with NutriChef. The launcher automatically detects your system configuration and sets up everything needed for development.
# Clone the repository
git clone https://github.com/HimanM/nutrichef.git
cd nutrichef
# Configure environment variables
cp .env.example .env
# Edit .env with your specific configurations
# Start all services
docker-compose up --buildFor developers who want full control over the setup process:
# Backend setup
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
flask run
# Frontend setup (new terminal)
cd frontend
npm install
npm run devImportant
For production deployment, please refer to our comprehensive deployment guides which cover VPS setup, security configurations, and scaling considerations.
| Requirement | Version | Purpose |
|---|---|---|
| Python | 3.9+ | Backend API server |
| Node.js | 16+ | Frontend development and build |
| npm/yarn | Latest | Package management |
| MySQL | 8.0+ | Database server |
| Docker | 20+ (optional) | Containerized deployment |
| Git | Latest | Version control |
Warning
Ensure all prerequisites are installed and properly configured before proceeding with the setup.
# Navigate to backend directory
cd backend
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install Python dependencies
pip install -r requirements.txtCreate and configure your environment variables:
# Copy environment template
cp backend/.env.example backend/.envEdit backend/.env with your configurations:
# Database Configuration
DATABASE_URL=mysql+mysqlconnector://user:password@localhost/nutrichef
DB_HOST=localhost
DB_NAME=nutrichef
DB_USER=your_username
DB_PASS=your_password
# Security
JWT_SECRET_KEY=your-super-secret-jwt-key-here
# AI Services
GEMINI_API_KEY=your-google-gemini-api-key
# Email Configuration (for notifications)
MAIL_SERVER=smtp.gmail.com
MAIL_PORT=587
MAIL_USE_TLS=True
MAIL_USERNAME=your-email@gmail.com
MAIL_PASSWORD=your-app-password
MAIL_DEFAULT_SENDER=your-email@gmail.com
# Frontend URL
FRONTEND_URL=http://localhost:5173Important
Required API Keys:
- Google Gemini API: Required for AI chatbot and recipe parsing
- Email Service: Required for user verification and notifications
# Ensure MySQL is running and database exists
mysql -u root -p -e "CREATE DATABASE IF NOT EXISTS nutrichef;"
# Initialize database schema
flask init-db
# Start the Flask development server
flask runThe backend API will be available at http://127.0.0.1:5000/
# Navigate to frontend directory (new terminal)
cd frontend
# Install Node.js dependencies
npm install
# Start the Vite development server
npm run devThe frontend will be available at http://localhost:5173/
- Backend Health Check: Visit
http://127.0.0.1:5000/api/health/ping - Frontend Access: Visit
http://localhost:5173 - Database Connection: Check backend logs for successful database connection
Tip
Development Workflow:
- Backend auto-reloads on Python file changes
- Frontend supports hot module replacement (HMR)
- Use browser developer tools for debugging
This section explains how to run the application using Docker and Docker Compose, which simplifies deployment and environment management.
Before you begin, ensure you have the following installed on your system:
- Docker Engine
- Docker Compose (Usually included with Docker Desktop for Windows and Mac)
The docker-compose.yml file defines environment variables to configure the services. For sensitive data and local development, it's highly recommended to use a .env file in the project's root directory (the same directory as docker-compose.yml). Docker Compose automatically loads variables from a file named .env in this location.
- Create a root
.envfile: Copy the example configuration frombackend/.env.exampleto a new file named.envin the project root:(If a more generalcp backend/.env.example .env
.env.exampleexists in the root, prefer that one.) - Update the root
.envwith your credentials: Open the newly created root.envfile and replace the placeholder values. This file will configure all services for Docker, including database credentials that the backend service will use.- Database Connection (for Backend Service within Docker):
DB_HOST: Set todb(this is the service name defined indocker-compose.yml).DB_NAME: e.g.,NutriChef(to matchMYSQL_DATABASEbelow).DB_USER: e.g.,rootor a dedicated app user (to match MySQL setup).DB_PASS: e.g.,nutrichef(to matchMYSQL_ROOT_PASSWORDor the dedicated user's password).DATABASE_URL: If your backend uses a full URL, construct it like:mysql+mysqlconnector://root:nutrichef@db/NutriChef
- Database Service (
dbservice indocker-compose.yml):MYSQL_ROOT_PASSWORD: e.g.,nutrichef(Root password for the MySQL instance).MYSQL_DATABASE: e.g.,NutriChef(The database that will be automatically created).MYSQL_USER,MYSQL_PASSWORD: (Optional) If you want to create a dedicated user for the application.
- Flask Specific (for Backend Service):
FLASK_APP:app.pyFLASK_RUN_HOST:0.0.0.0JWT_SECRET_KEY: A strong, unique secret.
- Mail Server (for Backend Service):
MAIL_SERVER,MAIL_PORT,MAIL_USE_TLS,MAIL_USERNAME,MAIL_PASSWORD,MAIL_DEFAULT_SENDER
- Gemini NLP Configuration (for Backend Service):
GEMINI_API_KEYPROJECT_NUMBER(if applicable)
- Frontend URL (for Backend Service, if it needs to generate frontend links):
FRONTEND_URL(e.g.,http://localhost:3000if accessing frontend directly on host, or could be different in other setups)
- Database Connection (for Backend Service within Docker):
Important
Important Notes on Docker .env:
- The
docker-compose.ymlfile is configured to pass these environment variables from the root.envfile to the respective services. - The
backend/.envfile (used for local Python development) is not directly used by the Dockerized backend service. Its settings must be consolidated into the root.envfile for Docker Compose. - Do not commit your actual root
.envfile (containing secrets) to version control. Ensure.envis listed in your.gitignorefile.
-
Clone the Repository (if you haven't already):
git clone https://github.com/HimanM/nutrichef.git cd nutrichef -
Ensure your root
.envfile is configured as described above. -
Build and Start Services: Open a terminal in the project's root directory (where
docker-compose.ymlis located) and run:docker-compose up --build
--build: This flag tells Docker Compose to build the images before starting the containers. Use it the first time or when you've made changes to Dockerfiles or application code that requires a rebuild.-d: (Optional) To run the containers in detached mode (in the background):docker-compose up --build -d.
- Frontend: Open your web browser and navigate to
http://localhost:3000(or the port you've mapped for the frontend service indocker-compose.yml). - Backend API & Static Content: The backend service will be running, typically not accessed directly from the browser but through the frontend. The frontend's Nginx (within its Docker container) is usually configured to proxy requests starting with
/api/and/static/to the backend service (e.g.,http://backend:5000). - Database (MySQL -
dbservice): The MySQL database (e.g.,NutriChef) is accessible on the port mapped indocker-compose.yml(e.g.,3307on your host machine).- Host:
localhostor127.0.0.1 - Port: e.g.,
3308 - Username:
root(or your configured user) - Password: The value from your root
.envforMYSQL_ROOT_PASSWORD(or your configured user's password) - Database Name: e.g.,
NutriChef
- Host:
- Initialization: The
dbservice indocker-compose.ymlmay be configured to run initialization scripts (e.g.,SQL/schema_mysql_clean.sql) the first time thedbcontainer is created. This sets up the database schema. - Persistence: Database files are typically stored in a Docker named volume (e.g.,
mysql_data, defined indocker-compose.yml). This ensures your data persists even if you stop or remove the containers.
After running docker-compose up, verify that all services are running correctly:
- Check container status:
Ensure
docker-compose ps # or docker psdb,backend, andfrontendcontainers are up and running. - MySQL/Database (
dbservice):- Connect using a MySQL client (details above).
- Verify schema:
SHOW DATABASES; USE NutriChef; SHOW TABLES; - Check logs:
docker-compose logs db.
- Backend (
backendservice):- Check logs:
docker-compose logs backend. Look for database connection success and Flask server startup messages.
- Check logs:
- Frontend (
frontendservice):- Access
http://localhost:3000in your browser. - Test API interaction (e.g., login) and check browser developer console (Network tab) for successful API calls to the backend.
- Check logs:
docker-compose logs frontend.
- Access
To view the logs for all services:
docker-compose logsTo view logs for a specific service (e.g., backend):
docker-compose logs backendTo follow the logs in real-time:
docker-compose logs -f backend- Stop Services:
If running in the foreground, press
Ctrl+C. If in detached mode (-d), use:docker-compose down
- Stop Services and Remove Containers, Networks, and Volumes:
To also remove the named volume for the database (e.g.,
mysql_data, which deletes all database data), use:docker-compose down -v
Caution
Using -v with down permanently deletes data stored in Docker volumes.
- Live Reloading:
docker-compose.ymlis often configured with volume mounts mapping your local code directories into the containers (e.g.,./backend:/app,./frontend_tailwind/src:/app/src).- Backend (Flask): Flask's development server usually reloads on Python code changes.
- Frontend (Vite): Vite's dev server supports Hot Module Replacement (HMR) for automatic browser updates on code changes.
- Rebuilding Images: If you change dependencies (
requirements.txt,package.json) or modify Dockerfiles, rebuild the images:docker-compose build # or incorporate with up docker-compose up --build
- Port Conflicts: If ports
3000,5000, or3308are in use, change host-side port mappings indocker-compose.yml(e.g.,"3001:3000"). - Database Connection Issues (Backend in Docker):
- Verify
DB_HOST=db,DB_USER,DB_PASS,DB_NAMEin the root.envfile. - Ensure the
backendservicedepends_onthedbservice indocker-compose.yml. - Check
docker-compose logs backendfor errors.
- Verify
- Frontend API Proxy Issues:
- Ensure
nginx.conf(for frontend service) correctly proxies tohttp://backend:5000/api/andhttp://backend:5000/static/. - Check browser console and
docker-compose logs frontend.
- Ensure
- "No space left on device" errors: Prune unused Docker resources:
docker system prune -a --volumes
Caution
The docker system prune -a --volumes command removes unused data and can delete important information.
| Document | Description | Audience |
|---|---|---|
| Project Documentation | Complete technical overview, architecture, and API reference | Developers, Architects |
| User Manual | End-user guide for all application features | End Users, Admins |
| Email Template System | Email notification system documentation | Developers |
| Nutritional Tracking Feature | Nutritional analysis and tracking guide | Users, Developers |
| Guide | Purpose | Environment |
|---|---|---|
| VPS Deployment Guide | Complete VPS deployment instructions | Production |
| External Access Guide | External network access configuration | Production |
| Public Access Guide | Public internet deployment setup | Production |
| VPS Setup Script | Automated deployment script | Production |
| Feature | Documentation | Status |
|---|---|---|
| Forum System | Forum Implementation | β Complete |
| Meal Suggestions | Meal Suggestions | β Complete |
| Session Management | Session Expiration | β Complete |
| Admin Monitoring | Admin Logs Monitor | β Complete |
| Mobile Animations | Mobile Modal Updates | β Complete |
| Tool | Documentation | Purpose |
|---|---|---|
| Demo Launcher | Local development setup | Development |
| Scripts Guide | Automation and utility scripts | Development |
| API Documentation | Interactive API docs at /api/docs |
Development |
Tip
All documentation is kept up-to-date with the latest features and includes code examples, screenshots, and troubleshooting guides.
# Navigate to backend directory
cd backend
# Activate virtual environment
source venv/bin/activate # Windows: venv\Scripts\activate
# Run all tests
pytest
# Run with coverage report
pytest --cov=. --cov-report=html
# Run specific test categories
pytest tests/test_routes/ # API endpoint tests
pytest tests/test_services/ # Business logic tests
pytest tests/test_models/ # Database model tests# Navigate to frontend directory
cd frontend
# Run unit tests
npm test
# Run tests with coverage
npm run test:coverage
# Run end-to-end tests
npm run test:e2e# Run tests in Docker environment
docker-compose exec backend pytest
docker-compose exec frontend npm testTest databases are automatically configured and isolated from development data.
We welcome contributions from the community! Here's how you can help:
- Use the GitHub Issues page
- Include detailed reproduction steps
- Provide system information and error logs
- Submit feature requests via GitHub Issues
- Describe the use case and expected behavior
- Include mockups or examples if applicable
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Help improve documentation
- Add code examples and tutorials
- Translate documentation to other languages
Note
Please read our contributing guidelines and code of conduct before submitting contributions.
This project is licensed under the MIT License - see the LICENSE file for details.
| Platform | Link | Purpose |
|---|---|---|
| HimanM | Source code, issues, contributions | |
| Developer Profile | Updates and community |
- Google Gemini for AI-powered features
- TensorFlow community for machine learning models
- React and Flask communities for excellent frameworks
- Open Source Contributors who made this project possible
Built with β€οΈ for the cooking community
Making healthy cooking accessible through technology

























