Skip to content

daveklee/calorieclimb.com

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽ Calorie Climb - Kids Nutrition Learning Game

A fun, educational web game that teaches children about nutrition and healthy eating through interactive calorie climbing gameplay. Built with React, TypeScript, and integrated with the USDA Food Database for accurate nutritional information.

Calorie Climb Screenshot

๐ŸŽฏ What is Calorie Climb?

Calorie Climb is an educational game where kids feed a virtual character different foods, learning about calories and nutrition in the process. The goal is to "climb" the calorie ladder by choosing foods with progressively more calories while keeping the character healthy and happy.

Key Features

  • ๐Ÿฅ— Real Food Data: Uses the official USDA Food Data Central database
  • ๐Ÿค– AI-Enhanced Learning: Educational feedback powered by OpenAI
  • ๐ŸŽฎ Gamified Education: Makes nutrition learning fun and engaging
  • ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Family Friendly: Safe, kid-appropriate content with alcohol filtering
  • ๐Ÿ“ฑ Responsive Design: Works on desktop, tablet, and mobile devices
  • ๐Ÿ” Food Search: Explore thousands of foods with detailed nutrition information

๐Ÿš€ Live Demo

Visit the live application: https://calorieclimb.com

๐Ÿ› ๏ธ Technology Stack

  • Frontend: React 18 with TypeScript
  • Styling: Tailwind CSS
  • Routing: React Router
  • Icons: Lucide React
  • APIs: USDA Food Data Central, OpenAI
  • Build Tool: Vite
  • Deployment: Netlify

๐Ÿƒโ€โ™‚๏ธ Quick Start

Prerequisites

  • Node.js (version 18 or higher)
  • npm or yarn package manager

Installation

  1. Clone the repository

    git clone [repository-url]
    cd calorie-climb
  2. Install dependencies

    npm install
  3. Set up environment variables (optional but recommended)

    cp .env.example .env

    Add your API keys to .env:

    VITE_USDA_API_KEY=your_usda_api_key_here
    VITE_OPENAI_API_KEY=your_openai_api_key_here
    VITE_GA_MEASUREMENT_ID=your_ga_measurement_id_here
  4. Start the development server

    npm run dev
  5. Open your browser to http://localhost:5173

API Keys (Optional)

The app works in offline mode without API keys, but for the full experience:

๐ŸŽฎ How to Play

  1. Start with Water: The game begins with the character drinking water (0 calories)
  2. Choose Foods: Type in food names to feed the character
  3. Climb the Ladder: Each new food must have more calories than the previous one
  4. Stay Healthy: Keep the character healthy and happy with good food choices
  5. Reach the Goal: Try to reach the calorie limit while maintaining good health

Game Modes

  • Online Mode: Access to 300,000+ foods from the USDA database with AI feedback
  • Offline Mode: Curated list of common foods with basic educational content

๐Ÿ“ Project Structure

src/
โ”œโ”€โ”€ components/          # Reusable UI components
โ”‚   โ”œโ”€โ”€ Character.tsx    # Animated character display
โ”‚   โ”œโ”€โ”€ GameInterface.tsx # Main game controls
โ”‚   โ”œโ”€โ”€ GameStats.tsx    # Score and progress tracking
โ”‚   โ”œโ”€โ”€ FoodHistory.tsx  # Food consumption history
โ”‚   โ””โ”€โ”€ Navigation.tsx   # App navigation
โ”œโ”€โ”€ pages/              # Page-level components
โ”‚   โ”œโ”€โ”€ GamePage.tsx    # Main game page
โ”‚   โ”œโ”€โ”€ FoodSearchPage.tsx # Food database explorer
โ”‚   โ””โ”€โ”€ AboutPage.tsx   # About and information page
โ”œโ”€โ”€ services/           # External API integrations
โ”‚   โ”œโ”€โ”€ usdaApi.ts      # USDA Food Database API
โ”‚   โ””โ”€โ”€ openaiApi.ts # OpenAI API
โ”œโ”€โ”€ utils/              # Utility functions
โ”‚   โ”œโ”€โ”€ foodService.ts  # Food search and management
โ”‚   โ”œโ”€โ”€ gameLogic.ts    # Game rules and calculations
โ”‚   โ”œโ”€โ”€ foodDatabase.ts # Offline food database
โ”‚   โ”œโ”€โ”€ analytics.ts    # Google Analytics integration
โ”‚   โ””โ”€โ”€ envConfig.ts    # Environment configuration
โ””โ”€โ”€ types/              # TypeScript type definitions
    โ””โ”€โ”€ game.ts         # Game-related types

๐Ÿ”ง Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run preview - Preview production build
  • npm run lint - Run ESLint

๐ŸŒŸ Features in Detail

Character System

  • Visual representation of health, happiness, and fullness
  • Dynamic expressions based on food choices
  • Size changes based on calorie consumption

Food Database Integration

  • Generic Foods: Common foods like "apple", "chicken breast"
  • Branded Foods: Specific products with brand names
  • Nutritional Data: Calories, nutrients, serving sizes
  • Safety Filtering: Automatic removal of inappropriate content

Educational Feedback

  • AI-generated explanations about food choices
  • Health ratings for different foods
  • Positive reinforcement for healthy choices
  • Learning about portion sizes and nutrition

Accessibility

  • Keyboard navigation support
  • Screen reader friendly
  • High contrast color schemes
  • Mobile-responsive design

๐Ÿค Contributing

We welcome contributions from developers, educators, nutritionists, and parents! See CONTRIBUTING.md for detailed guidelines.

Ways to Contribute

  • ๐Ÿ› Report bugs or suggest features
  • ๐Ÿ’ป Submit code improvements
  • ๐Ÿ“š Improve documentation
  • ๐ŸŽจ Enhance design and user experience
  • ๐ŸŽ Suggest educational content improvements

๐Ÿ“„ License

This project is open source and available under the MIT License.

โš ๏ธ Important Disclaimers

  • Not Medical Advice: This app is for educational purposes only and is not medical advice
  • AI-Generated Content: Food descriptions are generated by AI and should be validated
  • Parental Guidance: Designed for kids but parental supervision is recommended
  • Content Filtering: While we filter inappropriate content, please report any issues

๐Ÿ™ Acknowledgments

  • USDA Food Data Central: For providing comprehensive food nutrition data
  • OpenAI: For educational content generation
  • React Community: For the amazing ecosystem and tools
  • Contributors: Everyone who helps make this project better

๐Ÿ“ž Support

  • Issues: Report bugs or request features on GitHub
  • Questions: Use GitHub Discussions for general questions
  • Security: Report security issues privately via email

Made with โค๏ธ for kids and families who want to learn about nutrition in a fun way!

๐Ÿ”— Links


"Teaching kids about nutrition, one calorie at a time!" ๐ŸŽโœจ

About

Fun nutritional game for kids with USDA food data

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Languages