Skip to content

JCorts1/lean

Repository files navigation

Lean - Modern Nutrition Tracker

A modern, AI-inspired calorie and protein tracking application built with CoffeeScript frontend (Backbone.js) and Ruby on Rails JSON API backend.

Features

  • 🤖 AI-Inspired Design: Modern interface with neon colors and futuristic styling
  • 🌓 Dark/Light Mode: Toggle between dark and light themes
  • 📊 Progress Tracking: Visual progress circles with color-coded status
  • 🍽️ Meal Categories: Track breakfast, lunch, dinner, pre/post-workout, and snacks
  • 🎯 Goal Setting: Set and track daily calorie and protein goals
  • 📱 Responsive Design: Works on desktop and mobile devices
  • 🔒 Authentication: Secure user registration and login system

Color-Coded Progress System

  • 🔴 Red (0-50%): Too far from goal - needs attention
  • 🟡 Yellow (51-80%): Getting closer to goal
  • 🟢 Green (81-100%): Goal achieved!
  • 💙 Blue Neon (>100%): Goal exceeded with animated glow effect

Technology Stack

Backend

  • Ruby on Rails 7.1+ (API mode)
  • SQLite3 database
  • JWT authentication
  • CORS enabled for frontend

Frontend

  • CoffeeScript compiled to JavaScript
  • Backbone.js for MVC structure
  • Modern CSS with CSS Grid and Flexbox
  • Neon color scheme with AI-inspired design
  • Font Awesome icons
  • Google Fonts (Inter + JetBrains Mono)

Setup Instructions

  1. Install Dependencies

    bundle install
    npm install -g coffeescript
  2. Database Setup

    rails db:migrate
    rails db:seed
  3. Compile CoffeeScript

    coffee -c -o public/js app/coffeescript/app.coffee
  4. Start Server

    rails server
  5. Access Application Open http://localhost:3000 in your browser

Test Account

Use the following credentials to test the application:

  • Email: test@example.com
  • Password: password123

API Endpoints

Authentication

  • POST /api/v1/login - User login
  • POST /api/v1/users - User registration

Goals

  • GET /api/v1/goals - Get user goals
  • POST /api/v1/goals - Create/update goals

Food Logs

  • GET /api/v1/food_logs?date=YYYY-MM-DD - Get food logs for date
  • POST /api/v1/food_logs - Create food log entry
  • DELETE /api/v1/food_logs/:id - Delete food log entry

Development

CoffeeScript Development

The main application logic is in app/coffeescript/app.coffee. To make changes:

  1. Edit the CoffeeScript file
  2. Recompile: coffee -c -o public/js app/coffeescript/app.coffee
  3. Refresh browser

Adding New Meal Types

To add new meal categories, update:

  1. FoodLog::MEAL_TYPES in app/models/food_log.rb
  2. Add corresponding HTML section in public/index.html
  3. Update CoffeeScript meal types array

Design Philosophy

The application follows an AI-inspired design with:

  • Neon accent colors for interactive elements
  • Dark theme by default with smooth transitions
  • Futuristic typography using Inter and JetBrains Mono
  • Glowing effects for exceeded goals
  • Smooth animations and hover effects
  • Card-based layout with soft shadows and blur effects

Browser Compatibility

  • Chrome 70+
  • Firefox 65+
  • Safari 12+
  • Edge 79+

Contributing

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

License

This project is available as open source under the terms of the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published