A nutrition tracking application built with Next.js, TypeScript, and Supabase.
A web application for tracking nutrition and meals, built with modern web technologies.
- User Authentication: Email/password signup and login with Supabase Auth
- Guest Mode: Browse and search foods without creating an account
- Food Search: Search for foods using the USDA Food Database
- Meal Tracking: Add foods to meals (breakfast, lunch, dinner, snacks)
- Nutrition Information: View detailed nutritional information for foods
- Responsive Design: Mobile-friendly interface built with Tailwind CSS
- Frontend: Next.js 15 with App Router, React 18, TypeScript
- Backend: Supabase (PostgreSQL database, authentication, real-time)
- Styling: Tailwind CSS with Radix UI components
- API Integration: USDA Food Database API
- Deployment: Vercel
git clone <repository-url>
cd meal-app-react
npm install
Create a .env.local
file in the root directory:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
Get these values from your Supabase Dashboard:
- Go to Settings β API
- Copy the Project URL and anon public key
Set up your Supabase project with the required tables and authentication settings.
npm run dev
Open http://localhost:3000 in your browser.
meal-app-react/
βββ app/ # Next.js App Router
β βββ auth/ # Authentication pages
β βββ dashboard/ # Dashboard and meal tracking
β βββ food-details/ # Food detail pages
β βββ landing/ # Landing page
β βββ api/ # API routes
βββ components/ # React components
β βββ ui/ # Reusable UI components (Radix UI based)
β βββ [component-files] # Application components
βββ lib/ # Utility functions and configurations
β βββ supabase/ # Supabase client configuration
β βββ [utility-files] # Actions, types, and utilities
βββ hooks/ # Custom React hooks
βββ public/ # Static assets
# Development server
npm run dev
# Build for production
npm run build
# Start production server
npm run start
# Run tests
npm run test
# Run linting
npm run lint
git clone <repository-url>
cd meal-app-react
npm install
Create a .env.local
file in the root directory:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
Get these values from your Supabase Dashboard:
- Go to Settings β API
- Copy the Project URL and anon public key
Set up your Supabase project with the required tables and authentication settings.
npm run dev
Open http://localhost:3000 in your browser.
meal-app-react/
βββ app/ # Next.js App Router
β βββ auth/ # Authentication pages
β βββ dashboard/ # Dashboard and meal tracking
β βββ food-details/ # Food detail pages
β βββ landing/ # Landing page
β βββ api/ # API routes
βββ components/ # React components
β βββ ui/ # Reusable UI components (Radix UI based)
β βββ [component-files] # Application components
βββ lib/ # Utility functions and configurations
β βββ supabase/ # Supabase client configuration
β βββ [utility-files] # Actions, types, and utilities
βββ hooks/ # Custom React hooks
βββ public/ # Static assets
# Development server
npm run dev
# Build for production
npm run build
# Start production server
npm run start
# Run tests
npm run test
# Run linting
npm run lint
All of these warnings are expected during the build process and the application will deploy and function correctly despite them.
This project implements a comprehensive testing approach:
- Focus: Core business logic and utility functions
- Location:
__tests__/lib/
- Coverage: Nutrition calculations, data transformations, validation
# Run unit tests
npm run test
# Run with coverage
npm run test:coverage
# Watch mode for development
npm run test:watch
Key test files:
nutrition-calculator.test.js
- Nutrition calculation logicutils.test.js
- Utility function validationusda-integration.test.js
- USDA data conversionmeal-calculations.test.js
- Meal tracking business logic
- Focus: Critical user flows and integration testing
- Location:
cypress/e2e/
- Coverage: Authentication, food search, meal tracking, responsive design
# Open Cypress UI
npm run cypress
# Run headless
npm run cypress:headless
# Full E2E test with server
npm run test:e2e
Test suites:
auth-flow.cy.ts
- Login, signup, navigationfood-search.cy.ts
- Basic food search functionalityfood-search-integration.cy.ts
- Search integration & guest modedashboard-meal-tracking.cy.ts
- Dashboard and meal trackingresponsive-design.cy.ts
- Mobile/tablet/desktop compatibilityerror-handling.cy.ts
- Error states and edge cases
- No UI unit tests: We avoid testing React component rendering details
- Business logic focus: Unit tests concentrate on pure functions and calculations
- Integration coverage: Cypress tests handle user workflows
- Performance testing: Large datasets and responsive design validation