The Personal Fitness Tool is a comprehensive application designed to help users manage their personal fitness journey. It combines AI-generated insights, goal tracking, and data storage to provide a seamless experience for maintaining and improving health and fitness.
The purpose of this application is to provide users with an intuitive platform to:
- Input and manage personal health data such as name, age, weight, height, and activity level.
- Set fitness goals like muscle gain, fat loss, or staying active.
- Generate customized nutritional macros using AI based on their profile and goals.
- Ask AI for guidance on fitness-related topics.
- Store and manage fitness notes to track progress or important information.
-
Personal Data Management
- Allows users to input and edit personal health data.
- Tracks data such as weight, height, age, gender, and activity levels.
-
Fitness Goal Setting
- Users can set and save specific fitness goals.
- Goals are used to tailor recommendations and macros.
-
AI-Generated Nutritional Macros
- Uses AI to calculate the ideal nutritional intake based on user profile and fitness goals.
- Provides calorie, protein, fat, and carbohydrate recommendations.
-
AI-Driven Q&A
- Users can ask fitness-related questions to an AI for guidance.
- AI provides detailed, tailored responses.
-
Notes Management
- Users can add, view, and delete notes related to their fitness journey.
- Notes are stored in the database for future reference.
-
Personal Profile
- Users input their personal data such as name, age, weight, height, gender, and activity level.
- Data is stored securely in a database and is used to customize recommendations.
-
Goal Setting
- Users select fitness goals, which are used to tailor AI-generated recommendations.
-
Macros Calculation
- Users click a button to generate nutritional macros using AI.
- The AI uses the stored personal profile and goals to calculate ideal calorie, protein, fat, and carbohydrate values.
-
AI Interaction
- Users can ask the AI questions for fitness advice or guidance.
- The AI responds with detailed, actionable insights.
-
Notes
- Users can add notes to track progress, store reminders, or record thoughts.
- Notes can be edited or deleted as needed.
The application consists of the following files:
-
ai.py
Handles interaction with the LangFlow API for AI functionalities like generating macros and answering questions. -
db.py
Manages interactions with the Astra DB database, including creating and managing collections for personal data and notes. -
form_submit.py
Provides utility functions to update personal information and manage notes. -
main.py
The main Streamlit application, which integrates all components into a user interface. -
profiles.py
Contains functions to create, retrieve, and manage user profiles and associated data. -
.env
File
Stores sensitive credentials such as API tokens and database endpoints.
- Python 3.8+
- Streamlit
- Requests
- Astrapy
- dotenv
-
Clone the repository:
git clone https://github.com/hamzaabbasi16/workout_ask_ai.git cd workout_ask_ai
-
Install the required packages:
pip install -r requirements.txt
-
Set up the environment variables:
- Create a
.env
file in the project root with the following content:LANGFLOW_TOKEN=<your-langflow-token> ASTRA_ENDPOINT=<your-astra-db-endpoint> ASTRA_DB_APPLICATION_TOKEN=<your-astra-db-token>
- Create a
-
Run the application:
streamlit run main.py
- Open the application in your browser at the default Streamlit URL (e.g.,
http://localhost:8501
). - Fill in your personal data and save it.
- Set your fitness goals and generate macros using AI.
- Use the "Ask AI" feature to get answers to fitness-related questions.
- Add and manage notes to track your progress.
This project is licensed under the MIT License.
Contributions are welcome! If you encounter bugs or have suggestions for improvement, feel free to create an issue or submit a pull request.
Enjoy your fitness journey with the Personal Fitness Tool! 💪