Skip to content

brij0/calorietracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nutrition Tracker 🥗📊

A simple, reliable nutrition tracking application built with Django REST Framework and React. No AI gimmicks, no subscription fees - just straightforward meal tracking that actually works.

Why I Built This 🤔

After a year of going to the gym, I wanted to start tracking my meals properly. The market is flooded with expensive "AI-powered calorie tracking apps" that promise to identify food from photos, but having worked with vision models myself, I know how unreliable they can be:( I didn't want to pay $10-15/month for features that don't work consistently. Since I had a PC at home, I figured why not build something simple and host it myself? Something I could also share with friends who were in the same boat.

This app focuses on what actually matters: accurate nutrition tracking through a comprehensive ingredient database, not fancy AI that gets your apple confused with an orange.

Features ✨

  • Daily Nutrition Tracking: Log meals across breakfast, lunch, dinner, and snacks
  • Comprehensive Ingredient Database: Pre-loaded with detailed nutritional information
  • Recipe Management: Create and save custom recipes
  • Weight Tracking: Monitor weight changes with visual charts
  • Nutrition Goals: Set and track daily macro targets
  • Historical Analysis: View your nutrition trends over time
  • Responsive Design: Works on desktop and mobile

Tech Stack 🛠️

Backend

  • Django 4.x with Django REST Framework
  • SQLite (dev) / PostgreSQL (production)
  • Token-based authentication

Frontend

  • React 18 with Hooks
  • Chart.js for visualizations
  • Axios for API calls

Quick Start 🚀

Backend Setup

# Clone and navigate
git clone https://github.com/brij0/calorietracker.git
cd nutrition-tracker/backend

# Create virtual environment
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

# Install dependencies and setup database
pip install -r requirements.txt
python manage.py migrate
python manage.py createsuperuser

# Start server
python manage.py runserver

Frontend Setup

# Navigate and install
cd ../frontend
npm install

# Create environment file
echo "REACT_APP_API_BASE=http://localhost:8000/api" > .env

# Start development server
npm start

Visit http://localhost:3000 and start tracking!

Key Features 🎯

Dashboard

  • Real-time nutrition summary with progress bars
  • Meal breakdown with macro information
  • Quick access to logging and recipes

Meal Logging

  • Search comprehensive ingredient database
  • Custom portion sizes with automatic conversion
  • Recipe integration for quick logging
  • Meal categorization

Analytics

  • Nutrition trends over time
  • Weight tracking with charts
  • Goal progress visualization
  • Historical comparisons

API Endpoints 📡

# Authentication
POST /api/auth/login/
POST /api/auth/register/

# Nutrition Tracking
GET/POST /api/daily-intake/
GET /api/nutrition-history/
DELETE /api/daily-intake/clear-meal/

# Recipe Management
GET/POST /api/recipes/
POST /api/recipes/create/

# Data Management
GET/POST /api/ingredients/
GET/POST /api/user-weight/
GET/POST /api/nutrition-goals/

Database Schema 📊

User ──→ DailyIntake ──→ IntakeItem ──→ Ingredient
  │         │
  ├──→ Recipe ──→ RecipeIngredient ──→ Ingredient
  │
  ├──→ UserWeight
  └──→ NutritionGoals

Future Ideas 🔮

  • Barcode scanning for packaged foods
  • Meal planning features
  • Friends/sharing functionality
  • Export data to CSV
  • Mobile app version

Contributing 🤝

This started as a personal project, but I'm happy to accept contributions! Feel free to:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License 📄

MIT License - feel free to use this for your own nutrition tracking needs!


Built with ❤️ for people who want simple, reliable nutrition tracking without the monthly subscription fees and unreliable AI features.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors