A modern mobile application that helps users explore the connection between their eating habits and how they feel physically, mentally, and emotionally.
FoodMood is a React Native app with a NestJS backend that allows users to:
- Log their food intake with mood tracking
- Store food entries with images, portions, and detailed notes
- Track patterns between diet and emotional/physical well-being
- Generate AI-powered insights about their food-mood relationships
- Maintain a personal food and mood diary with multiple mood associations per meal
foodmoodapp/
βββ backend/ # NestJS API server
β βββ src/
β β βββ auth/ # Supabase Auth integration module
β β βββ food-logs/ # Food logging module
β β βββ health/ # Health check endpoints
β β βββ common/ # Shared DTOs, services, and utilities
β β βββ types/ # TypeScript type definitions
β β βββ test/ # Test utilities and setup
β βββ supabase/ # Database migrations and configuration
βββ frontend/ # React Native Expo app
β βββ app/
β β βββ auth/ # Authentication screens (signin/signup)
β β βββ main/ # Main app screens (dashboard, profile, settings)
β β βββ components/ # Reusable UI components
β β βββ services/ # API client and authentication services
β β βββ contexts/ # React contexts for state management
β β βββ hooks/ # Custom React hooks
β β βββ utils/ # Utility functions
β β βββ constants/ # App constants and static data
β βββ assets/ # Images, icons, and static files
βββ docs/ # Documentation files
- Framework: NestJS 10.x
- Language: TypeScript 5.x
- Database: Supabase (PostgreSQL)
- Authentication: Supabase Auth (with request-scoped clients)
- Validation: class-validator with DTOs
- Testing: Jest with unit, integration, and e2e tests
- Documentation: Swagger/OpenAPI
- Framework: React Native + Expo (~53.0)
- Language: JavaScript/JSX
- Navigation: Expo Router
- State Management: React Context
- UI: Custom components with SVG support
- Charts: D3-based charting for insights
- Storage: Expo SecureStore for token management
- Node.js 18+
- npm or yarn
- Expo CLI (
npm install -g @expo/cli) - Supabase account
git clone <repository-url>
cd foodmoodappcd backend
npm install
cp env.example .env
# Edit .env with your Supabase credentials
npm run start:devcd frontend
npm install
npm startBackend (.env):
SUPABASE_URL=your_supabase_url
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
JWT_SECRET=your_jwt_secret
PORT=3001Frontend (.env):
EXPO_PUBLIC_API_URL=http://localhost:3001/api- User registration and login using Supabase Auth
- Profile management with user preferences
- Secure token storage with Expo SecureStore
- Request-scoped authentication with Row Level Security
- Log food items with customizable meal times
- Track multiple moods per meal (breakfast, lunch, dinner, snack)
- Add detailed notes and base64 images
- Portion size tracking
- Clean, intuitive dashboard interface
- Real-time food log updates
- Modal-based food entry system
- Profile customization and settings
- Secure authentication flow
POST /api/auth/register- Register new user with Supabase AuthPOST /api/auth/login- Login user with Supabase AuthGET /api/auth/me- Get current user profilePUT /api/auth/profile- Update user profileDELETE /api/auth/account- Delete user account
GET /api/food-logs- Get user's food logs with filteringPOST /api/food-logs- Create new food log entryGET /api/food-logs/:id- Get specific food logPUT /api/food-logs/:id- Update food log entryDELETE /api/food-logs/:id- Delete food log entry
GET /health- Health check endpoint
cd backend
npm install
npm run start:dev # Start development server
npm run test # Run unit tests
npm run test:integration # Run integration tests
npm run test:e2e-full # Run end-to-end tests
npm run lint # Lint code
npm run format # Format codecd frontend
npm install
npm start # Start Expo development server
npm run ios # Start iOS simulator
npm run android # Start Android emulator
npm run web # Start web versioncd backend
npm run supabase:dev # Start local Supabase
npm run db:reset # Reset database
npm run db:push # Push migrations
npm run types:generate # Generate TypeScript types- Backend Architecture
- Frontend Authentication Guide
- Threat Model & Security
- API Documentation (Swagger)
- Build:
npm run build - Set production environment variables
- Deploy to your preferred platform
- Build for production:
expo build - Submit to app stores or distribute via Expo
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
- Check the documentation
- Open an issue on GitHub
- Contact the development team
Built with β€οΈ for better food-mood relationships