Skip to content

Latest commit

 

History

History
70 lines (52 loc) · 2.13 KB

File metadata and controls

70 lines (52 loc) · 2.13 KB

Documentation

Complete setup and deployment guide for NutriSync.

Setup Guide

Follow these guides in order:

  1. Prerequisites - Required software and accounts
  2. Database Setup - Supabase configuration and migrations
  3. API Configuration - Google Gemini AI and USDA API
  4. Running Locally - Start the application
  5. Google OAuth - Optional: "Sign in with Google"
  6. Testing - Run and write tests
  7. Deployment - Production deployment
  8. Troubleshooting - Common issues and solutions

Database Migrations

Database schema is managed through sequential migration files in backend/migrations/.

See backend/migrations/README.md for details.

Additional Resources

Quick Reference

Environment Variables

Backend (Supabase Edge Function secrets - SUPABASE_URL/SUPABASE_SERVICE_ROLE_KEY are auto-injected):

supabase secrets set GOOGLE_API_KEY=your_gemini_api_key
supabase secrets set USDA_API_KEY=your_usda_key

Frontend (frontend/.env.local):

VITE_SUPABASE_URL=https://[project-ref].supabase.co
VITE_SUPABASE_ANON_KEY=your_anon_key
VITE_API_URL=http://localhost:54321/functions/v1

Common Commands

Backend:

supabase functions serve --env-file supabase/.env  # Local dev server
supabase functions deploy  # Deploy all functions
supabase functions logs <name>  # View logs

Frontend:

cd frontend
npm install  # Install dependencies
npm run dev  # Start development server
npm test  # Run tests

Getting Help

  • Check troubleshooting sections in each guide
  • Review error messages in browser console and terminal
  • Verify environment variables are set correctly
  • Ensure all migrations completed successfully