Skip to content

joel-003/BMI-Health-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โš•๏ธ BMI Health โ€“ Multi-Health Calculator Web App

A modern JSP + Servlet web application providing BMI, BMR, TDEE, Body Fat %, and Water Intake Calculations.

Badges

Java PostgreSQL

Maven

Status License

IDE OS

๐Ÿ“ŒOverview

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

โš™๏ธ Features

๐Ÿงฎ BMI Calculator

  • Uses metric & imperial units
  • Provides BMI category + tailored health tips
  • Input validation & error handling

๐Ÿ”ฅ BMR & TDEE Calculator

  • Add / Update / Delete books
  • Search by title, author, subject, ISBN
  • Track availability

๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ Borrower Management

  • Uses Mifflinโ€“St Jeor equation
  • Supports activity levels
  • Calculates daily caloric needs

๐Ÿ’ช Body Fat % Calculator (U.S. Navy Formula)

  • Male + Female formulas
  • Instant body fat category
  • Full explanation & ranges

๐Ÿ’ง Water Intake Calculator

  • Weight-based formula
  • Activity adjustments
  • Clean UI display

๐ŸŽจ Modern UI

  • Navbar + Mobile hamburger
  • Cards layout
  • Fully responsive

๐Ÿ—๏ธ Technologies Used

Layer Technologies
Frontend HTML, CSS, JSP
Backend Java Servlets, Service Layer
Testing JUnit5
Build Maven
Server Apache Tomcat 9/10
Tools IntelliJ IDEA

๐Ÿงฉ Architecture Diagram (Mermaid)

graph TD;
    A["JSP Pages (View)"] --> B["Servlets (Controller)"];
    B --> C["Service Layer"];
    C --> D["Models"];
    C --> E["Validators"];

Loading

Project Structure

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

๐Ÿš€ Installation & Setup

1๏ธโƒฃ Clone the repository

git clone https://github.com/joel-003/BMI-Health-App.git
cd BMI-Health-App

2๏ธโƒฃ Open in IntelliJ

  • File โ†’ Open โ†’ select project folder
  • IntelliJ will auto-import Maven dependencies

3๏ธโƒฃ Configure Tomcat

  • Run โ†’ Edit Configurations โ†’ Add New โ†’ Tomcat Local
  • Set deployment to:
Artifacts โ†’ BMI-Health-App:war exploded

4๏ธโƒฃ Run the project

Start Tomcat.

http://localhost:9090/BMI-Health-App/

๐Ÿงช Unit Testing (JUnit5)

โœ” Tested Modules

Test Suite Coverage
BMIAdultServiceTest BMI formula + categories
BMRServiceTest BMR & TDEE calculations
BodyFatServiceTest Navy method accuracy
InputValidatorTest parseDouble, validation rules

Run all tests:

mvn test

โ–ถ๏ธ Servlet Endpoints

Page Servlet URL
BMI BMIAdultServlet /bmi-adult
BMR BMRServlet /bmr-calc
Body Fat BodyFatServlet /bodyfat-calct
Water WaterServlet /water-calc

๐Ÿ“ธ CLI Screenshots

Click below to view all screenshots:

๐Ÿ‘‰ Open Screenshots Folder

๐ŸŽฌ Run Demo

Below is a short demo of the BMi-Health-App in action:

๐Ÿ›ก๏ธ Exception Handling

  • The app uses a centralized validation utility:
InputValidator.parseDouble(value, "Height");
InputValidator.validatePositive(height, "Height");

  • Custom exception:
throw new InvalidInputException("Invalid input!");

๐Ÿ”ฎ Future Enhancements

  • Dark mode UI

  • Add calorie tracking module

  • Add export PDF option

  • Add mobile PWA support

License

This project is licensed under the MIT License.

See the LICENSE file for full details.

UML Class Diagram

Below is the complete class diagram representing the system architecture.

UML Diagram

About

A JSP/Servlet-driven health calculator application featuring BMI, BMR, TDEE, Body Fat %, and Water Intake calculators. Designed with MVC architecture, reusable validation utilities, meaningful exception handling, responsive UI/UX, and complete JUnit 5 test coverage. Ideal for demonstrating backend Java web development skills.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors