Skip to content

Latest commit

 

History

History
249 lines (173 loc) · 8.24 KB

File metadata and controls

249 lines (173 loc) · 8.24 KB

Week 1 — Setup & Skeleton

Learn: Django tutorial parts 1–4, MVT, ORM, admin; install Postgres. Build:

Create project wanna_fit/ and apps: accounts/, nutrition/, workouts/, plans/, dashboard/.

Connect PostgreSQL; run first migration; create superuser.

Base template, navbar, simple home page. Done when: you can log in to admin and see empty models, site renders.

Week 2 — Auth & Profile + Daily Target

Learn: forms/ModelForms, auth CBVs, class-based views. Build:

Sign up/login/logout/password reset with Django auth.

Profile (OneToOne with User): age, sex, height_cm, weight_kg, activity_level, goal.

Compute BMR (Mifflin-St Jeor) → TDEE → daily calorie target.

Profile edit page. Done when: New user signs up, fills profile, and sees a dashboard card with “Your target calories”.

Week 3 — Foods & Meals (Calories In)

Learn: related models, inlines, CreateView with formsets. Build:

Food (name, brand, per-serving macros) + admin import.

Meal (date, type) and MealItem (FK to Food + quantity).

Meal create/edit flows (add items via formset), show daily totals.

(Optional) tiny “fetch calories” button (placeholder function for future API). Done when: user can log a breakfast/lunch/dinner/snack and sees calories in for the day.

Week 4 — Exercises & Programs (Calories Out)

Learn: simple calculations, annotations, small utilities. Build:

Exercise (name, MET) + ExerciseLog (date, duration_min).

Burned calories formula: kcal = MET * 3.5 * weight_kg / 200 * duration_min.

Programs: Program and ProgramExercise (ordered exercises with default durations); “Add to my plan”. Done when: user logs an exercise and sees calories out and net on dashboard.

Week 5 — Recommendations & Recipes

Learn: filtering, simple rules, preferences. Build:

Recipe (name, list of Food + quantities) and a simple recommender:

look at remaining daily calories; suggest recipes under that budget,

respect optional preferences (e.g., vegetarian/halal toggle or disliked foods tags),

suggest exercise if user is over target. Done when: clicking “Recommend” shows 3–5 meal or exercise suggestions tailored to remaining cals.

Week 6 — Polish, Tests, Deploy

Build:

Tests for BMR/TDEE, meal totals, exercise burn.

Pagination, flash messages, 404/500 pages, empty states.

Basic styling (Bootstrap or Tailwind).

Production settings: .env, ALLOWED_HOSTS, DEBUG=False, static files collect. Done when: Deployed demo with a seeded admin and sample foods/exercises; README explains setup.

this was the initial plan of the project, im done till week 4, i have 2 weeks left until my internship ends. i really want to impress my supervisors i want to use jquery, ajax, data scraping, pagination, redis, apache kafka, go, docker, kubernetes, a recommendation system to should ML skills, compplicated database queries, validation of serializers, we havent dine anything with the plans app to impress my supervisors plan my next 2 weeks to complete this project

Wanna Fit - Django Fitness Tracking Application

Project Overview

I've built a comprehensive Django-based fitness tracking web application called "Wanna Fit" that helps users monitor their nutrition, workouts, and overall health progress. The application features a modern, responsive UI with a mint/coral color scheme and includes both web interface and REST API capabilities.

Technical Stack

  • Backend: Django 5.2.5 with PostgreSQL database
  • Frontend: Bootstrap 5.3.2 (Minty theme) with Bootstrap Icons
  • API: Django REST Framework for API endpoints
  • Authentication: Django's built-in authentication system
  • Charts: Chart.js for data visualization

Application Architecture

Core Django Apps:

  1. accounts - User management and profiles
  2. nutrition - Meal logging and tracking
  3. workouts - Exercise logging and tracking
  4. dashboard - Main analytics and overview
  5. plans - (Placeholder for future meal/workout plans)
  6. api - REST API endpoints

Key Features Implemented

1. User Management & Profiles

  • User Registration/Login: Standard Django auth with custom signup flow
  • Profile System: Comprehensive user profiles with:
    • Personal details (age, sex, height, weight)
    • Activity level (sedentary to very active)
    • Fitness goals (lose/maintain/gain weight)
    • Automatic BMR (Basal Metabolic Rate) calculation using Mifflin-St Jeor equation
    • TDEE (Total Daily Energy Expenditure) calculation
    • Daily calorie target calculation based on goals

2. Nutrition Tracking

  • Meal Logging: Users can log meals with:
    • Meal name and type (breakfast, lunch, dinner, snack)
    • Calorie count
    • Date tracking
  • Meal History: View all logged meals with filtering by date
  • API Support: REST endpoints for meal CRUD operations

3. Workout Tracking

  • Exercise Database: Pre-defined exercises with:
    • Exercise categories (cardio, strength, flexibility)
    • Calories burned per minute for each exercise
  • Workout Logging: Users can log:
    • Exercise type and duration
    • Date of workout
    • Automatic calorie burn calculation
  • API Support: REST endpoints for workout logging

4. Dashboard & Analytics

  • Weekly Overview: 7-day summary showing:
    • Total calories consumed vs burned
    • Net calorie balance
    • Daily progress toward calorie targets
  • Interactive Charts: Chart.js visualization of:
    • Daily calories in vs calories out over 7 days
    • Progress tracking with visual indicators
  • Today's Progress: Real-time progress bar showing daily calorie target completion

5. REST API

  • Meal Management: Full CRUD operations for meals
  • Workout Logging: Full CRUD operations for workout logs
  • Profile Management: Read/update user profiles
  • Authentication: Session-based authentication for API access

Database Models

Profile Model

- user (OneToOne to User)
- sex, age, height_cm, weight_kg
- activity_level (sedentary to very active)
- goal (lose/maintain/gain weight)
- Methods: bmr(), tdee(), daily_target()

Meal Model

- user (ForeignKey to User)
- name, meal_type, calories
- date (defaults to today)

Workout Models

Workout:
- name, category, calories_per_minute

WorkoutLog:
- user, exercise (FK to Workout)
- duration_minutes, date
- Method: total_calories_burned()

UI/UX Features

  • Modern Design: Clean, professional interface with mint/coral color scheme
  • Responsive Layout: Mobile-friendly Bootstrap design
  • Navigation: Intuitive navigation with active state highlighting
  • Toast Messages: User feedback for actions (success, error, info)
  • Progress Indicators: Visual progress bars and charts
  • Form Validation: Client and server-side validation

Security & Best Practices

  • Authentication Required: All main features require login
  • Profile Completion: Users must complete profile before accessing main features
  • CSRF Protection: Django's built-in CSRF protection
  • Environment Variables: Database credentials stored in .env file
  • Password Validation: Django's built-in password validators

File Structure

wanna_fit/
├── accounts/          # User management
├── nutrition/         # Meal tracking
├── workouts/          # Exercise tracking
├── dashboard/         # Analytics dashboard
├── plans/            # Future meal/workout plans
├── api/              # REST API endpoints
├── templates/        # HTML templates
├── wanna_fit/        # Main project settings
└── demo_data.json    # Sample data for testing

Current Status

The application is fully functional with:

  • ✅ User registration and authentication
  • ✅ Profile management with health calculations
  • ✅ Meal logging and tracking
  • ✅ Workout logging and tracking
  • ✅ Comprehensive dashboard with analytics
  • ✅ REST API for all major features
  • ✅ Modern, responsive UI
  • ✅ Demo data for testing

Next Steps/Areas for Enhancement

  • Meal/workout plan generation (plans app is placeholder)
  • Food database integration for automatic calorie lookup
  • Social features (friends, challenges)
  • Mobile app development
  • Advanced analytics and reporting
  • Integration with fitness trackers/wearables

This is a production-ready fitness tracking application with a solid foundation for future enhancements.