A modern Progressive Web App (PWA) built with React for tracking calories, calculating BMR/TDEE, and monitoring daily activities using the MET system.
** NEW: Daily calorie tracking with localStorage! Log food, exercise, and track your progress in real-time.**
- BMR & TDEE Calculator - Based on Mifflin-St Jeor equation
- Goal Setting - Maintenance, weight loss, or weight gain
- Activity Tracking - MET-based calorie burn calculator
- 6 Activities - Walking, Running, Weight Lifting, Wrestling, Football, Cycling
- Food Logging - Track everything you eat
- Exercise Logging - Track calories burned
- Real-time Totals - See remaining calories instantly
- localStorage - All data persists (survives browser refresh!)
- Daily Reset - Automatically resets at midnight
- Smart Guidance - Know exactly how much to eat/burn
NutriNote+/
public/ # Static files
index.html # Main HTML template
manifest.json # PWA manifest
robots.txt # Search engine rules
favicon.ico # App icon (add your own)
logo192.png # PWA icon 192x192 (add your own)
logo512.png # PWA icon 512x512 (add your own)
src/ # Source code
components/ # React components
UserProfile.js # User info input form
UserProfile.css # Styling for user form
ActivityTracker.js # Activity logging
ActivityTracker.css # Activity styling
Results.js # Calculation results
Results.css # Results styling
Dashboard.js # Daily calorie tracker (NEW!)
Dashboard.css # Dashboard styling (NEW!)
utils/ # Utility functions (NEW!)
localStorage.js # localStorage operations (NEW!)
App.js # Main app component
App.css # App-level styling
index.js # React entry point
index.css # Global styling
serviceWorkerRegistration.js # PWA service worker
reportWebVitals.js # Performance monitoring
App.test.js # Tests
setupTests.js # Test configuration
package.json # Dependencies and scripts
.gitignore # Git ignore rules
README.md # This file
CALORIE_TRACKING_GUIDE.md # Daily tracking guide (NEW!)
FEATURE_LIST.md # Feature documentation
FORMULAS.md # Calculation formulas
MET_SYSTEM_GUIDE.md # MET system guide
activity-calories.html # Standalone calculator demo
- Download Node.js from: https://nodejs.org/
- Choose the LTS version (recommended)
- Run the installer
- Verify installation by opening Command Prompt and typing:
node --version npm --version
Open your terminal in VS Code and run:
npm installThis will install all required packages listed in package.json.
What gets installed:
react- The React libraryreact-dom- React DOM renderingreact-scripts- Build tools and configurationweb-vitals- Performance monitoring- Testing libraries
npm startThis will:
- Start the development server
- Open your browser to http://localhost:3000
- Enable hot reloading (changes appear instantly)
When ready to deploy:
npm run buildThis creates an optimized production build in the build/ folder.
- react (^18.2.0) - UI library
- react-dom (^18.2.0) - DOM rendering
- react-scripts (5.0.1) - Build configuration
- web-vitals (^3.5.0) - Performance metrics
- @testing-library/react - React testing utilities
- @testing-library/jest-dom - Jest matchers
- @testing-library/user-event - User interaction simulation
- Age, gender, height, weight input
- Activity level selection
- Goal setting (maintain/lose/gain weight)
- Custom calorie adjustments
- Mifflin-St Jeor equation
- Gender-specific formulas
- Automatic unit conversions
- Activity level multipliers
- Maintenance calorie calculation
- MET-based calorie burn
- 6 pre-loaded activities:
- Walking (3.5 METs)
- Running (10.0 METs)
- Weight Lifting (5.0 METs)
- Wrestling (6.0 METs)
- Football Practice (8.0 METs)
- Cycling (7.5 METs)
- Daily calorie target
- Activity breakdown
- Total calories burned
- Adjusted daily intake
- Food logging with calorie input
- Exercise logging with calories burned
- Real-time summary cards showing:
- Daily target
- Total eaten
- Total burned
- Remaining calories
- localStorage persistence - data survives browser refresh
- Automatic daily reset at midnight
- Smart guidance - tells you exactly how much to eat/burn
- Progress tracking - see if you're on target, under, or over
See CALORIE_TRACKING_GUIDE.md for detailed usage instructions!
Step 1: User Profile
- Enter your age, gender, height, and weight
- Select your activity level (sedentary to extra active)
- Choose your goal (maintain, lose, or gain weight)
- Set custom calorie adjustment if needed
- Click "Next"
Step 2: Activity Tracker
- Select activities you'll do today
- Enter minutes for each activity
- See live calorie burn calculations
- Click "Calculate Results"
Step 3: Results
- View your BMR (Basal Metabolic Rate)
- See your TDEE (Total Daily Energy Expenditure)
- Check your daily calorie target
- Review activity breakdown
- Click "Continue to Daily Tracker"
Every Day:
-
Log Food
- Enter food name (e.g., "Grilled chicken")
- Enter calories (e.g., 250)
- Click "+ Add Food"
- Repeat for all meals/snacks
-
Log Exercise
- Enter exercise name (e.g., "Running")
- Enter calories burned (e.g., 400)
- Click "+ Add Exercise"
- Repeat for all workouts
-
Monitor Progress
- Check summary cards at top
- See remaining calories
- Follow guidance messages
- Stay on target!
-
Delete Mistakes
- Click button next to any entry
- Totals update automatically
All data saves automatically! Close browser and come back - it's still there.
Next day: Food and exercise logs reset automatically at midnight. Your profile and daily target stay saved.
Runs the app in development mode.
Open http://localhost:3000 to view it in your browser.
Launches the test runner in interactive watch mode.
Builds the app for production to the build folder.
The build is optimized and ready to deploy.
One-way operation! Ejects from Create React App for full control.
This app is a Progressive Web App (PWA), which means:
Install on mobile/desktop - Add to home screen
Offline capability - Works without internet (after first load)
Fast loading - Cached resources
App-like experience - Full screen mode
On Mobile (Chrome/Safari):
- Open the app in your browser
- Tap the menu (three dots)
- Select "Add to Home Screen"
- Follow the prompts
On Desktop (Chrome/Edge):
- Open the app
- Look for install icon in address bar
- Click "Install"
Edit the gradient colors in CSS files:
/* Current: Purple gradient */
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
/* Change to your preference */
background: linear-gradient(135deg, #your-color-1 0%, #your-color-2 100%);Edit src/components/ActivityTracker.js:
const ACTIVITIES = [
{ id: 'swimming', name: 'Swimming', met: 6.0, emoji: '' },
// Add more here
];Edit src/components/Results.js to modify calculations.
Solution:
- Delete
node_modulesfolder - Delete
package-lock.json - Run
npm installagain
Solution: Set a different port in Windows:
set PORT=3001 && npm startSolution:
- Stop the server (Ctrl+C)
- Clear browser cache
- Run
npm startagain
Solution:
- Check for syntax errors in console
- Ensure all imports are correct
- Run
npm run buildagain
- package.json - Project metadata and dependencies
- .gitignore - Files to exclude from Git
- public/manifest.json - PWA configuration
- src/index.js - React entry point, renders App
- src/App.js - Main component with routing logic
- src/App.css - Global app styling
- UserProfile.js - Collects user information
- ActivityTracker.js - Logs daily activities
- Results.js - Displays calculations
- serviceWorkerRegistration.js - Enables offline functionality
- reportWebVitals.js - Performance monitoring
npm install --save gh-pages
# Add to package.json: "homepage": "https://yourusername.github.io/NutriNote+"
npm run build
npx gh-pages -d build- Sign up at netlify.com
- Drag and drop
buildfolder - Done!
- Sign up at vercel.com
- Import GitHub repository
- Deploy automatically
- Install Node.js and npm
- Run
npm install - Run
npm start - Customize colors and branding
- Add your own icons (logo192.png, logo512.png, favicon.ico)
- Test the app on your phone
- Build and deploy
Q: What is React?
A: React is a JavaScript library for building user interfaces. It breaks your UI into reusable components.
Q: What is a component?
A: A component is a reusable piece of UI code. Think of it like a LEGO block - you combine them to build your app.
Q: What does npm do?
A: npm (Node Package Manager) installs and manages JavaScript packages (libraries) your project needs.
Q: Can I use this offline?
A: Yes! After the first load, the PWA features allow offline use.
Q: How do I add new features?
A: Create a new component in src/components/ and import it into App.js.
- Check
FORMULAS.mdfor calculation details - Check
MET_SYSTEM_GUIDE.mdfor activity tracking - Check
FEATURE_LIST.mdfor feature documentation - Open an issue on GitHub
- Ask in React community forums
See LICENSE file for details.
Run npm start and start building!