A full-stack Django web application that empowers users to monitor and improve their fitness through BMI tracking, personalized exercise recommendations, and daily habit logging.
👉 https://fithub-98q3.onrender.com/
- 🔐 User authentication (login/signup)
- 📊 BMI calculator with history and categorization
- 🏃 Personalized exercise recommendations based on BMI
- 📅 Daily fitness habit tracker with progress tracking
- 🎨 Responsive dark theme UI
- Python 3.12 & Django 6.0.2
- SQLite (development) / PostgreSQL (production)
- HTML5, CSS3
- Gunicorn, WhiteNoise
fithub_project/
├── accounts/ # User authentication
├── fitness/ # BMI & Exercise modules
├── habits/ # Daily tracking system
├── templates/ # HTML templates
├── static/ # CSS & images
├── fithub_project/ # Project settings
├── manage.py
├── requirements.txt
├── .env # ⚠️ MANDATORY
└── Procfile
- Python 3.8+
- pip & Git
git clone https://github.com/vignesh12042003/fithub_project.git
cd fithub_project# Windows
python -m venv venv
venv\Scripts\activate
# macOS/Linux
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtCreate .env file in project root:
SECRET_KEY=your_generated_secret_key_here
DEBUG=TrueHow to generate SECRET_KEY:
from django.core.management.utils import get_random_secret_key
print(get_random_secret_key())Copy the output and paste it in .env
For Development (SQLite) – No action needed, default in settings.py
For Production (PostgreSQL):
Update fithub_project/settings.py:
import dj_database_url
DATABASES = {
'default': dj_database_url.config(
default='postgresql://user:password@localhost:5432/fithub_db'
)
}Or set in .env:
DATABASE_URL=postgresql://user:password@localhost:5432/fithub_dbpython manage.py migratepython manage.py runserverVisit: http://127.0.0.1:8000/
BMI = weight (kg) / height² (m²)- Underweight: BMI < 18.5
- Normal: 18.5 ≤ BMI < 25
- Overweight: BMI ≥ 25
- Underweight: Muscle building (Push-ups, Squats, Planks)
- Normal: Balanced fitness (Jogging, Crunches, Stretching)
- Overweight: Low-impact fat burn (Walking, Cycling, Wall Push-ups)
- Track 5 habits: Exercise, Water intake, Stretching, Fruits, Sleep
- Real-time progress calculation
- One log per user per day
| Route | Method | Purpose |
|---|---|---|
/accounts/login/ |
GET/POST | Login |
/accounts/signup/ |
GET/POST | Registration |
/ |
GET | Home page |
/bmi/ |
GET/POST | BMI calculator |
/dashboard/ |
GET | User dashboard |
/exercise/ |
GET | Exercise recommendations |
/habits/ |
GET/POST | Daily habits |
BMIRecord
- user, height, weight, bmi_value, category, created_at
FitnessHabit
- name, is_active
DailyHabitLog
- user, date, completed_habits, completion_percent
- Constraint: One log per user per day
- Push to GitHub
- Connect repository to Render
- Set
SECRET_KEYin Render environment variables - Set
DATABASE_URLif using PostgreSQL - Auto-deploy on push
heroku login
heroku create fithub-app
heroku config:set SECRET_KEY=your_secret_key
git push heroku main
heroku run python manage.py migrateModuleNotFoundError
pip install -r requirements.txtDatabase locked
rm db.sqlite3
python manage.py migrateStatic files not loading
python manage.py collectstatic --noinputMIT License
Vignesh S – GitHub