A modern JSP + Servlet web application providing BMI, BMR, TDEE, Body Fat %, and Water Intake Calculations.
TBMI Health is a fully-functional JSP/Servlet-based health calculator web application. It includes calculators for:
-
BMI (Body Mass Index)
-
BMR (Basal Metabolic Rate)
-
TDEE (Total Daily Energy Expenditure)
-
Body Fat Percentage (US Navy method)
-
Daily Water Intake Calculator
The app follows a professional MVC architecture and includes:
โ Model classes
โ Service layer
โ Input validation
โ Exception handling
โ Responsive UI
โ JUnit5 unit tests
- Uses metric & imperial units
- Provides BMI category + tailored health tips
- Input validation & error handling
- Add / Update / Delete books
- Search by title, author, subject, ISBN
- Track availability
- Uses MifflinโSt Jeor equation
- Supports activity levels
- Calculates daily caloric needs
- Male + Female formulas
- Instant body fat category
- Full explanation & ranges
- Weight-based formula
- Activity adjustments
- Clean UI display
- Navbar + Mobile hamburger
- Cards layout
- Fully responsive
| Layer | Technologies |
|---|---|
| Frontend | HTML, CSS, JSP |
| Backend | Java Servlets, Service Layer |
| Testing | JUnit5 |
| Build | Maven |
| Server | Apache Tomcat 9/10 |
| Tools | IntelliJ IDEA |
graph TD;
A["JSP Pages (View)"] --> B["Servlets (Controller)"];
B --> C["Service Layer"];
C --> D["Models"];
C --> E["Validators"];
src/
โโโ main/
โโโ java/
โ โโโ com.github.joel003
โ โโโ controller/ (Servlets)
โ โโโ service/ (Business logic)
โ โโโ model/ (POJOs)
โ โโโ util/ (Validators)
โ โโโ exception/ (Custom exceptions)
โ
โโโ resources/
โ
โโโ webapp/
โโโ css/
โโโ javascript/
โโโ images/
โโโ bmi-adult.jsp
โโโ bmr.jsp
โโโ bodyfat.jsp
โโโ water.jsp
โโโ index.jsp
โโโ test/
โโโ java/
โโโ BMIAdultServiceTest.java
โโโ BMRServiceTest.java
โโโ InputValidatorTest.java
git clone https://github.com/joel-003/BMI-Health-App.git
cd BMI-Health-App- File โ Open โ select project folder
- IntelliJ will auto-import Maven dependencies
- Run โ Edit Configurations โ Add New โ Tomcat Local
- Set deployment to:
Artifacts โ BMI-Health-App:war exploded
Start Tomcat.
http://localhost:9090/BMI-Health-App/
| Test Suite | Coverage |
|---|---|
| BMIAdultServiceTest | BMI formula + categories |
| BMRServiceTest | BMR & TDEE calculations |
| BodyFatServiceTest | Navy method accuracy |
| InputValidatorTest | parseDouble, validation rules |
mvn test
| Page | Servlet | URL |
|---|---|---|
| BMI | BMIAdultServlet | /bmi-adult |
| BMR | BMRServlet | /bmr-calc |
| Body Fat | BodyFatServlet | /bodyfat-calct |
| Water | WaterServlet | /water-calc |
Click below to view all screenshots:
Below is a short demo of the BMi-Health-App in action:
- The app uses a centralized validation utility:
InputValidator.parseDouble(value, "Height");
InputValidator.validatePositive(height, "Height");
- Custom exception:
throw new InvalidInputException("Invalid input!");
-
Dark mode UI
-
Add calorie tracking module
-
Add export PDF option
-
Add mobile PWA support
This project is licensed under the MIT License.
See the LICENSE file for full details.
Below is the complete class diagram representing the system architecture.


