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 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.
- ๐ฅ 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
Visit the live application: https://calorieclimb.com
- 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
- Node.js (version 18 or higher)
- npm or yarn package manager
-
Clone the repository
git clone [repository-url] cd calorie-climb -
Install dependencies
npm install
-
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
-
Start the development server
npm run dev
-
Open your browser to
http://localhost:5173
The app works in offline mode without API keys, but for the full experience:
- USDA API Key: Get free access at USDA Food Data Central
- OpenAI API Key: Sign up at OpenAI Platform
- Google Analytics: Create a GA4 property for analytics
- Start with Water: The game begins with the character drinking water (0 calories)
- Choose Foods: Type in food names to feed the character
- Climb the Ladder: Each new food must have more calories than the previous one
- Stay Healthy: Keep the character healthy and happy with good food choices
- Reach the Goal: Try to reach the calorie limit while maintaining good health
- 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
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
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
- Visual representation of health, happiness, and fullness
- Dynamic expressions based on food choices
- Size changes based on calorie consumption
- 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
- AI-generated explanations about food choices
- Health ratings for different foods
- Positive reinforcement for healthy choices
- Learning about portion sizes and nutrition
- Keyboard navigation support
- Screen reader friendly
- High contrast color schemes
- Mobile-responsive design
We welcome contributions from developers, educators, nutritionists, and parents! See CONTRIBUTING.md for detailed guidelines.
- ๐ Report bugs or suggest features
- ๐ป Submit code improvements
- ๐ Improve documentation
- ๐จ Enhance design and user experience
- ๐ Suggest educational content improvements
This project is open source and available under the MIT License.
- 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
- 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
- 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!
"Teaching kids about nutrition, one calorie at a time!" ๐โจ