Estimated time: 10-15 minutes
Important: You need TWO terminal windows running simultaneously - one for backend, one for frontend.
Open a terminal and navigate to the backend directory:
cd backendCreate virtual environment:
python -m venv venvActivate virtual environment:
On macOS/Linux:
source venv/bin/activateYou should see (venv) at the start of your terminal prompt.
On Windows (Command Prompt):
venv\Scripts\activateOn Windows (PowerShell):
venv\Scripts\Activate.ps1Install dependencies:
pip install -r requirements.txtThis will install all required Python packages (~2-3 minutes).
Ensure virtual environment is activated (look for (venv) in prompt):
uvicorn app.main:app --reloadYou should see output like:
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO: Started reloader process
INFO: Started server process
INFO: Waiting for application startup.
INFO: Application startup complete.
Server URLs:
- API:
http://localhost:8000 - Interactive API docs:
http://localhost:8000/docs - Alternative docs:
http://localhost:8000/redoc
Test the health endpoint (open a new terminal):
curl http://localhost:8000/healthExpected response:
{"status": "healthy"}Or visit http://localhost:8000/docs in your browser to see the interactive API documentation.
Important: Keep the backend terminal running. Open a NEW terminal window for the frontend.
cd frontend
npm installThis will install all Node.js packages (~1-2 minutes).
npm run devYou should see output like:
VITE v5.x.x ready in xxx ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h + enter to show help
Application URL: http://localhost:5173
- Open
http://localhost:5173in your browser - You should see the NutriSync login/signup page
- Check browser console (F12) for any errors
- Navigate to
http://localhost:5173in your browser - Click Sign Up (or Register)
- Enter email and password
- Check email for confirmation link (check spam folder)
- For development, you can disable email confirmation in Supabase
- Log in with your credentials
- Complete profile setup:
- Age, gender, height, weight
- Activity level
- Weight goals
- Nutrition goals (calories, protein, carbs, fat, fiber)
- Dietary restrictions (optional)
Manual Meal Logging:
- Navigate to Log Meals or Add Meal
- Search for a food (try "chicken breast" or "apple")
- Adjust serving size as needed
- Click Add to meal
- Submit the meal
- Verify it appears in your meal history
AI Food Recognition (requires Gemini API key):
- Navigate to Add Meal or AI Upload
- Click to upload or drag-and-drop a food photo
- Supported formats: JPG, PNG, HEIC
- Max size: 10MB
- Wait for AI analysis (5-10 seconds)
- Verify AI identifies foods correctly
- Review and edit nutrition estimates if needed
- Save the meal
Dashboard:
- Navigate to Dashboard or Home
- Check that nutrition summary shows your meal data
- Verify progress charts display correctly
- Check that meals appear in meal history
- Test date navigation (if available)
Profile & Goals:
- Navigate to Profile or Settings
- Try updating your goals
- Verify changes are saved
Fasting Tracker (if using fasting features):
- Navigate to Fasting tab
- Start a fasting session
- Verify timer is working
- End session and check it's logged
Check virtual environment:
# Verify .env file exists
ls backend/.env # macOS/Linux
dir backend\.env # Windows
# Check if virtual environment is activated
# You should see (venv) at the start of your promptIf you don't see (venv):
# macOS/Linux:
source venv/bin/activate
# Windows:
venv\Scripts\activateCheck Python version:
python --version
# Should show 3.11.x or higherCommon issues:
- Missing API keys in
.envfile - Virtual environment not activated
- Wrong Python version
- Missing dependencies - run
pip install -r requirements.txt - Port 8000 already in use - stop other processes or change port
Check backend logs in the terminal for specific error messages.
Verify configuration:
# Check .env.local exists
ls frontend/.env.local # macOS/Linux
dir frontend\.env.local # WindowsCommon issues:
- Missing
.env.localfile in frontend directory - Variables not prefixed with
VITE_ - Backend not running (must be started first)
- Incorrect
VITE_API_URL(should behttp://localhost:8000) - Port 5173 already in use - Vite will try 5174 automatically
After creating/modifying .env.local: Restart the dev server (Ctrl+C, then npm run dev again).
Verify Supabase setup:
- All 8 database migrations completed successfully
- Email authentication enabled in Supabase dashboard
- Correct
VITE_SUPABASE_URLandVITE_SUPABASE_ANON_KEYin frontend.env.local - Check Supabase dashboard for user creation
Check browser console (F12) for specific error messages about:
- CORS errors (backend must be running)
- Supabase connection errors
- Invalid credentials
Email confirmation:
- Check spam/junk folder for confirmation email
- Or temporarily disable email confirmation in Supabase
Verify USDA API:
# Check backend .env has USDA_API_KEY
cat backend/.env | grep USDA # macOS/Linux
findstr USDA backend\.env # WindowsCommon issues:
USDA_API_KEYnot set in backend.env- Backend server not running
- Rate limit exceeded (DEMO_KEY: 30/hour, Personal key: 1,000/hour)
- Network connectivity issues
Check backend terminal for USDA API error messages.
Verify Gemini API:
# Check backend .env has GOOGLE_API_KEY
cat backend/.env | grep GOOGLE # macOS/Linux
findstr GOOGLE backend\.env # WindowsCommon issues:
GOOGLE_API_KEYnot set or invalid- API key doesn't start with
AIzaSy - Rate limit exceeded (Free tier: 60/minute, 1,500/day)
- Photo file too large (>10MB)
- Photo format not supported
Check backend terminal for Gemini API error messages.
Backend (port 8000):
# Find process using port 8000
# macOS/Linux:
lsof -i :8000
# Windows:
netstat -ano | findstr :8000
# Kill the process or use different port:
uvicorn app.main:app --reload --port 8001Frontend (port 5173): Vite will automatically try the next available port (5174, 5175, etc.).
Verify:
- Backend is running at
http://localhost:8000 VITE_API_URLin frontend.env.localmatches backend URL- No typos in URL (http not https for local development)
Check browser console for specific CORS error details.
- Use two terminal windows/tabs: one for backend, one for frontend
- Both must be running for the app to work
- Backend logs show API requests and errors
- Browser console (F12) shows frontend errors
- Use
http://localhost:8000/docsto test API endpoints directly - Check Supabase dashboard to verify data is being saved
Next: Google OAuth Setup (Optional)