A web-based diabetes risk assessment and data entry system designed to help users evaluate and monitor their potential risk for diabetes β providing personalized rule and AI-based health tips using a trained XGBoost model.
GlucoPredictor is a web-based diabetes risk assessment and data entry system designed to help users evaluate and monitor their potential risk for diabetes. The system allows users to perform diabetes risk assessments, obtain risk assessment results, and track their glucose levels, insulin usage, and weight, while providing personalized rule and AI-based health tips using a trained XGBoost model and educational insights about diabetes.
Note: Some portions of this code were developed with assistance from AI tools (e.g., ChatGPT). All AI-generated content has been reviewed and adapted by the developer to ensure accuracy and suitability for the project.
GlucoPredictor is intended for educational and non-commercial use only. This project is not a certified medical device or diagnostic tool. The results and health tips provided are based on general rules and AI predictions, and should not be considered as medical advice or diagnosis.
Always consult with a qualified healthcare professional for medical concerns or before making decisions about your health.
| # | Feature | Description |
|---|---|---|
| 1 | User Authentication | Registration, login, and email verification using PHPMailer. Admin panel to manage users and system access. |
| 2 | Risk Assessment | Calculates diabetes risk using both rule-based logic and AI-based predictions (XGBoost). Past results tracked on history page. |
| 3 | Health Tracking | Track glucose levels, insulin usage, and weight β visualized with charts and tables. |
| 4 | Personalized Health Tips | Health tips based on risk levels. AI-generated bonus tips fostering healthier living. |
| 5 | Bilingual Support | Supports English and Malay languages. |
| 6 | Responsive Design | Mobile-friendly with a dark mode toggle. |
| 7 | Reset Password | Users can reset their passwords if forgotten. |
| 8 | Edit Profile | Users can edit their username and password whenever desired. |
| 9 | Account Deletion | Users can delete their accounts along with their risk assessment details. |
| 10 | Admin Dashboard | Admins can manage and remove users, view user count, and edit their own profile. |
| Layer | Technology |
|---|---|
| Frontend | HTML, CSS, Bootstrap, JavaScript |
| Backend | PHP |
| Machine Learning | XGBoost (Python) |
| Database | MySQL (phpMyAdmin) |
| Server | Apache (XAMPP for local hosting) |
-
User Registration & Login β Users sign up, activate their accounts via email, and log in. Admin users can manage other users.
-
Data Input β Users input details such as age, gender, pregnancies, weight, height, family history, blood pressure, activity level, sugar consumption, and symptoms on
form.php. Glucose levels, insulin intake, and weight can also be tracked on dedicated tracking pages. -
Risk Calculation β Risk is calculated using predefined rules via JavaScript and the AI model (
predict.py) based on form inputs, and displayed onresult.php. -
Health Tips β Based on the risk assessment result, users receive personalized rule & AI-based health tips on
tips.php. -
Risk Score History Tracking β Users can view their stored risk score history on
history.php.
- XAMPP β to run Apache & MySQL locally
- Python 3 β for running the AI model
- Composer β to install PHP dependencies (PHPMailer)
- Git β to clone the repository (optional)
1. Clone the repository
git clone https://github.com/yourusername/glucopredictor.git2. Set Up the Database
- Open XAMPP Control Panel and start Apache & MySQL
- Go to
http://localhost/phpmyadmin - Create a new database named:
glucopredictor - Click on the new database β Go to the Import tab β Upload and execute
glucopredictor.sql
3. Configure Database Connection
In any PHP files that connect to the database (e.g., form.php, login.php), ensure your credentials are correct:
$conn = new mysqli("localhost", "root", "", "glucopredictor");If your MySQL password is not empty, update it accordingly.
4. Install Composer Dependencies (PHPMailer)
cd C:\xampp\htdocs\glucopredictor
composer require phpmailer/phpmailerMake sure to include the Composer autoload in any file that uses PHPMailer:
require 'vendor/autoload.php';5. Set Up the Python Environment (AI Model)
cd C:\xampp\htdocs\glucopredictor\ml
pip install xgboost numpyMake sure the following files are present in the ml/ folder:
predict.pyxgboost_diabetes_model.json
- Register an account and activate it via email
- Login using your registered email and password
- Fill in the risk assessment form with the necessary details
- Get your risk calculated upon valid form submission
- View your personalized health tips based on your results
- Check your risk assessment history for past risk scores and levels
- Monitor your glucose, weight, and insulin intake using the tracking pages
Jegathiswaran Thiaghu
This project is open source and available under the MIT License βοΈ.






