This project is a landing page developed with Vite and React that allows users to calculate their ideal weight using the Devine formula and their daily caloric intake needed to reach that ideal weight using the Harris-Benedict formula. Users enter their data such as age, weight, height, gender, and level of physical activity, and the system provides personalized calculations based on that information.
- Female: Ideal weight (kg) = 45.5 + 2.3 × (Height in inches − 60)
- Male: Ideal weight (kg) = 50+2.3 × (Height in inches − 60)
-
Female: TMB = 447.593 + (9.247 × Weight in kg) + (3.098 × Height in cm) − (4.330 × Age)
-
Male: TMB = 88.362 + (13.397 × Weight in kg) + (4.799 × Height in cm) − (5.677 × Age)
-
Exercise Level:
- Sedentary: 1.2
- Light Activity: 1.375
- Moderate Activity: 1.55
- High Activity: 1.725
- Very High Activity: 1.9
TMB x Exercise Level = result kcal/day
- Interactive Form: Captures the user's age, weight, height, gender, and level of physical activity.
- Ideal Weight Calculation: Uses the Devine formula to calculate the ideal weight based on the user's height.
- Daily Caloric Intake Calculation: Uses the Harris-Benedict formula to calculate the calories needed to reach the ideal weight.
- Multi-language Support: Implemented with
react-i18nextto offer the application in various languages. - Modern Interface: Uses
SweetAlert2to display elegant and interactive alerts. - Navigation: Implemented with
react-router-domfor a smooth user experience.
- Vite: A fast development tool for frontend applications.
- React: A JavaScript library for building user interfaces.
- react-hook-form: Form management and validation in React.
- react-router-dom: Navigation and routing in React applications.
- react-i18next: Internationalization and multi-language support.
- SweetAlert2: Interactive and stylized alerts.
Follow these steps to install and run the project locally:
-
Clone the repository:
git clone https://github.com/jhonv4sq/calorie-calculator.git cd calorie-calculator -
Install dependencies:
npm install
-
Start the development server:
npm run dev