{"id":24644900,"url":"https://github.com/samsoumyajitd/food_ai","last_synced_at":"2025-07-03T02:05:26.582Z","repository":{"id":273653904,"uuid":"919871219","full_name":"samSoumyajitD/food_ai","owner":"samSoumyajitD","description":"The AI Food Weather-Based Recommendation System provides personalized food and restaurant suggestions using AI. It uses GenAI and AI techniques like TF-IDF Vectorization, Cosine Similarity, and FuzzyWuzzy for tailored recommendations. ","archived":false,"fork":false,"pushed_at":"2025-01-23T12:23:50.000Z","size":216,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-03T02:02:55.265Z","etag":null,"topics":["axios","cosine-similarity","flask","flask-cors","fuzzywuzzy","generative-ai","google-generativeai","json","nlp","python-dotenv","python3","reactjs","scikit-learn","sklearn","tf-idf","vanilla-css","weather-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samSoumyajitD.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-21T06:56:06.000Z","updated_at":"2025-07-01T19:39:34.000Z","dependencies_parsed_at":"2025-07-03T02:02:49.902Z","dependency_job_id":null,"html_url":"https://github.com/samSoumyajitD/food_ai","commit_stats":null,"previous_names":["samsoumyajitd/food_ai"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/samSoumyajitD/food_ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samSoumyajitD%2Ffood_ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samSoumyajitD%2Ffood_ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samSoumyajitD%2Ffood_ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samSoumyajitD%2Ffood_ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samSoumyajitD","download_url":"https://codeload.github.com/samSoumyajitD/food_ai/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samSoumyajitD%2Ffood_ai/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263245308,"owners_count":23436513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["axios","cosine-similarity","flask","flask-cors","fuzzywuzzy","generative-ai","google-generativeai","json","nlp","python-dotenv","python3","reactjs","scikit-learn","sklearn","tf-idf","vanilla-css","weather-api"],"created_at":"2025-01-25T14:13:35.038Z","updated_at":"2025-07-03T02:05:26.544Z","avatar_url":"https://github.com/samSoumyajitD.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI Food Weather-Based Recommendation System\n\nThis project is a web-based application that provides food recommendations based on weather conditions, user preferences (vegetarian, non-vegetarian, or any), and cuisine type. Additionally, the app suggests popular restaurants known for specific food items in the user's locality. The backend is built with Flask and integrates AI-based recommendation logic, while the frontend is developed using React.\n\n---\n\n## Features\n1. **Weather-Based Food Recommendations**: Fetches weather data for a given city and suggests food items suited to the current weather.\n2. **User Preferences**: Allows users to specify dietary preferences (vegetarian, non-vegetarian, or any) and cuisine type.\n3. **AI-Enhanced Recommendations**: Filters and refines recommendations using trained models and AI-based logic.\n4. **Restaurant Suggestions**: Displays a list of well-known restaurants for the recommended food items in the user's locality.\n5. **Responsive Frontend**: Provides a clean and interactive UI for users to input their preferences and view recommendations.\n\n---\n\n## Technologies Used\n### Backend\n- **Flask**: A lightweight Python web framework.\n- **scikit-learn**: For AI-based filtering and recommendation logic.\n- **Google Generative AI API**: To enhance food suggestions based on weather and user inputs.\n- **OpenWeatherMap API**: For fetching real-time weather data.\n- **Google Places API**: To find popular restaurants for the recommended food items in the user's locality.\n- **Flask-CORS**: To handle cross-origin requests.\n- **FuzzyWuzzy**: For fuzzy matching of inputs (e.g., city names, cuisine types).\n\n### Frontend\n- **React**: For building a responsive user interface.\n- **Axios**: For making API calls to the Flask backend.\n- **CSS**: Custom styles for a clean UI.\n\n---\n\n## Application Structure\n```\nproject-root/\n│\n├── backend/\n│   ├── ai_recommendations.py\n│   ├── app.py\n│   ├── config.py\n│   ├── cuisines.json\n│   ├── myFood.json\n│   ├── recommendations.py\n│   ├── requirements.txt\n│   └── .env\n│\n├── frontend/\n│   ├── public/\n│   │   └── index.html\n│   ├── src/\n│   │   ├── components/\n│   │   │   ├── FoodRecommendation.jsx\n│   │   │   └── FoodRecom.css\n│   │   ├── App.css\n│   │   ├── App.js\n│   │   ├── index.css\n│   │   └── index.js\n│   └── package.json\n│\n└── README.md\n```\n\n---\n\n## Prerequisites\n1. **Python 3.8+**\n2. **Node.js 14+**\n3. **npm or Yarn**\n4. API Keys for:\n   - OpenWeatherMap API\n   - Google Generative AI API\n   - Google Places API\n\n---\n\n## Installation Guide\n\n### Backend Setup\n1. **Navigate to the `backend` directory**:\n   ```\n   cd backend\n   python -m venv venv\n   venv\\Scripts\\activate\n   ```\n2. **Install Python dependencies**:\n   ```\n   pip install -r requirements.txt\n   pip install --upgrade Flask Werkzeug\n   pip install flask-cors\n   pip install python-Levenshtein\n   ```\n3. **Set up the `.env` file**:\n   Create a `.env` file in the `backend` directory with the following keys:\n   ```\n   WEATHER_API_KEY=\u003cYour_OpenWeatherMap_API_Key\u003e\n   GENAI_API_KEY=\u003cYour_Generative_AI_API_Key\u003e\n   PLACES_API_KEY=\u003cYour_Google_Places_API_Key\u003e\n   CORS_ORIGIN=http://localhost:3000\n   ```\n4. **Run the Flask application**:\n   ```\n   python app.py\n   ```\n   The backend will run on `http://127.0.0.1:5000`.\n\n### Frontend Setup\n1. **Navigate to the `frontend` directory**:\n   ```\n   cd frontend\n   ```\n2. **Install dependencies**:\n   ```\n   npm i\n   ```\n3. **Run the React application**:\n   ```\n   npm start\n   ```\n   The frontend will run on `http://localhost:3000`.\n\n---\n\n## Usage\n1. Open the browser and navigate to `http://localhost:3000`.\n2. Enter a city name and specify your preferences:\n   - Dietary preference (vegetarian, non-vegetarian, or any).\n   - Cuisine type (e.g., Indian, Continental, etc.).\n3. Click on the \"Get Recommendations\" button.\n4. View the list of recommended food items and popular restaurants in your locality for those items.\n\n---\n\n## Dependencies\n### Backend\n- `flask`\n- `flask-cors`\n- `requests`\n- `scikit-learn`\n- `google-generativeai`\n- `google-places`\n- `python-dotenv`\n- `fuzzywuzzy`\n\nInstall all dependencies via:\n```bash\npip install -r requirements.txt\n```\n\n### Frontend\n- `react`\n- `axios`\n\nInstall all dependencies via:\n```bash\nnpm install\n```\n\n---\n\n## Example Workflow\n1. **Input**:\n   - City: `New York`\n   - Preference: `Veg`\n   - Cuisine Type: `Indian`\n2. **Backend Process**:\n   - Fetch weather data for New York.\n   - Use the weather and user inputs to request food suggestions from the Generative AI API.\n   - Filter and refine results using the trained AI model.\n   - Use Google Places API to find popular restaurants for the recommended food items in New York.\n3. **Output**:\n   - A list of vegetarian Indian food items suitable for the current weather in New York.\n   - Suggested restaurants in New York known for these food items.\n\n---\n\n## AI and NLP Techniques Employed\n\n### 1. **TF-IDF Vectorization**\nTransforms textual food data into numerical representations for efficient analysis.\n\n### 2. **Cosine Similarity**\nMeasures similarity between user preferences and available food recommendations.\n\n### 3. **Fuzzy String Matching**\nHandles imperfect user inputs for better robustness.\n\n---\n\n## Contributing\nContributions are welcome! Feel free to open issues or submit pull requests.\n\n--- \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamsoumyajitd%2Ffood_ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamsoumyajitd%2Ffood_ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamsoumyajitd%2Ffood_ai/lists"}