This project is a Flask-based web application that serves as an AI-powered fitness assistant. It leverages the capabilities of Twilio's WhatsApp API to facilitate interaction with an AI model. The application is designed to provide fitness advice, answer health-related questions, and calculate the Body Mass Index (BMI) of a user.
- User authentication: The application includes a secure login system.
- AI interaction: Users can send messages to the AI model and receive responses.
- WhatsApp integration: The application integrates with WhatsApp via Twilio's API, enabling users to interact with the AI model directly from their WhatsApp account.
- BMI calculation: Users can calculate their BMI by providing their height and weight.
- Display of recommendations based on the calculated BMI.
- Multi-language support (English and Romanian).
- User profile management: users can save and update their profile information (name, height, age, gender, and activity level).
- The height field on the BMI calculation form is pre-filled with the user's height from their profile.
- Navigation updates: added a Profile button in the navbar on the index and history page
- Clone the repository to your local machine.
- Install the required Python packages using pip:
- Set up a Twilio account and configure the WhatsApp sandbox.
- Set up ngrok to expose your local server to the internet. This is necessary for the Twilio API to be able to send requests to your application.
- Update the
TWILIO_ACCOUNT_SID
,TWILIO_AUTH_TOKEN
, andTWILIO_PHONE_NUMBER
in theconfig.py
file with your Twilio account details. - Run the application: run.py
- Open your web browser and go to
http://127.0.0.1:5000/
to access the application.
- Python 3.10
- Flask
- Flask-SQLAlchemy
- Flask-Login
- Flask-Babel
- Werkzeug
- Flask-WTF
- Twillio
- Register for an account or log in if you already have one.
- Enter your weight (in kg) and height (in cm) in the provided fields.
- Click the "Calculate BMI" button.
- The application will display your BMI and a recommendation based on the result.
- Navigate to the Profile page to save or update your profile information.