This project is a Flask-based web application that provides personalized diet recommendations based on user inputs such as age, weight, height, gender, activity level, and dietary goals. The app utilizes the FatSecret API to fetch food and recipe data, ensuring that the diet plans are both accurate and diverse.
The goal of this project is to create a program that recommends meals tailored to individuals' body types and preferences, especially for those starting a fitness journey.
- Start Date: 2024.08.28
- End Date: 2024.08.30
- Idea Note Creation
- Presentation and Evaluation
- Ollama: Python-based AI model for generating diet recommendations.
- Front-end: (Not yet decided)
-
[Home Page]
-
[Results Page]
- User Information Collection: Collect personal data such as height, weight, goal, gender, and activity level, which is then input into Ollama AI.
- Diet Search: Using the collected data, Ollama AI determines the appropriate diet for the user and provides recommendations.
- Diet Re-evaluation: If the user is not satisfied with the initial diet plan, they can input their preferred or disliked foods to receive a new recommendation.
- API Server Improvement: Currently, the API is set to individual IPs. Future versions will allow multiple users to access the service without needing to configure their IPs by centralizing the API server.
- Alternative AI Models: Explore other AI APIs to replace Ollama if its responses are slow or include unnecessary information.
- Muscle Mass and Body Fat Percentage: Incorporate these metrics to provide more accurate diet recommendations.
- BMI Chart Enhancement: Improve the BMI chart to allow the x-axis to move dynamically based on user input.
Before you begin, ensure you have Python installed on your machine. You'll also need an API key from FatSecret.
-
Clone the repository:
git clone https://github.com/ttuurrnn/my-diet-app.git cd my-diet-app -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the dependencies:
pip install -r requirements.txt
-
Set up your environment variables:
Create a
.envfile in the project root and add your FatSecret API credentials:CLIENT_ID=your_fatsecret_client_id CLIENT_SECRET=your_fatsecret_client_secret -
Run the application:
python app.py
-
Access the application:
Open your web browser and navigate to
http://localhost:5000.
- Input your details: On the main page, enter your age, weight, height, gender, activity level, and dietary goal (e.g., weight loss, muscle gain).
- Get your diet plan: Click "맞춤형 다이어트 식단 추천 받기" to generate a customized diet plan.
- Review your plan: The app will display a diet plan with meals and recipes, along with a breakdown of calories and macronutrients.
app.py: The main Flask application file, containing all the routes and logic.templates/index.html: The main page where users input their information.templates/result.html: The results page displaying the recommended diet plan.requirements.txt: A list of all Python dependencies required to run the app.
- Flask: A lightweight web framework for Python used to build the application.
- FatSecret API: Used to retrieve food and recipe data for generating diet plans.
- Tailwind CSS: A utility-first CSS framework for styling the user interface.
- Chart.js: Used for visualizing BMI (Body Mass Index) on the front end.
- Enhanced Recipe Recommendations: Improve the diversity of recommended recipes by integrating more advanced search criteria.
- User Accounts: Allow users to save their dietary plans and track their progress over time.
- Multi-language Support: Add support for multiple languages to cater to a broader audience.
Special thanks to the FatSecret API team for providing a comprehensive API that made this project possible.

