MealMate is a full-stack web application designed to streamline meal planning, recipe management, and shopping list generation. Built with modern web technologies, it offers an intuitive interface for organizing your culinary life with AI-powered recipe parsing and intelligent meal suggestions.
- Weekly Meal Planner: Visual calendar interface for planning lunch and dinner for weekdays
- Drag & Drop Interface: Intuitive drag-and-drop functionality to assign recipes to meal slots
- Optimistic Updates: Instant UI feedback with automatic rollback on errors
- Customizable Servings: Adjust serving sizes for meal planning
- AI-Powered Recipe Parsing: Convert recipe text into structured format using Mistral AI
- URL Recipe Scraping: Import recipes directly from web URLs
- Recipe Collections: Organize recipes into custom collections
- Bulk Operations: Import, export, and manage multiple recipes efficiently
- Recipe Sharing: Share recipes via secure links with expiration dates
- Favorites & Ratings: Mark favorites and rate recipes (1-5 stars)
- Advanced Search: Filter by dietary tags, difficulty, prep time, and more
- Auto-Generation: Generate shopping lists from your weekly meal plans
- Cost Estimation: Automatic cost calculation for shopping items
- Interactive Lists: Check off items as you shop
- PDF Export: Export shopping lists and recipes for offline use
- Nutrition Analysis: Detailed nutritional information for recipes
- Dietary Filtering: Support for vegetarian, vegan, gluten-free, keto, and more
- Bulk Import/Export: Comprehensive data backup and migration tools
- Smart Suggestions: AI-powered meal recommendations (planned feature)
- React 18 with TypeScript for type-safe development
- Vite for lightning-fast development and optimized builds
- Tailwind CSS for utility-first styling
- Radix UI for accessible, headless UI components
- React Query (TanStack) for server state management
- React Hook Form with Zod validation
- Wouter for lightweight client-side routing
- Express.js with TypeScript for robust API development
- PostgreSQL with Drizzle ORM for type-safe database operations
- Neon Database for serverless PostgreSQL deployment
- Zod for runtime validation and type inference
- Mistral AI integration for intelligent recipe parsing
- Winston for structured logging and monitoring
- Recipes: Core recipe data with JSONB ingredients
- Collections: Custom recipe organization
- Meal Plans: Weekly meal scheduling
- Shopping Lists: Generated from meal plans
- Recipe Sharing: Secure link management
- Node.js (v18 or higher)
- PostgreSQL database (local or cloud)
- Mistral AI API key for recipe parsing
-
Clone the repository
git clone <repository-url> cd MealMate
-
Install dependencies
npm install
-
Environment Configuration Create a
.envfile in the project root:# Database Configuration DATABASE_URL=postgresql://username:password@localhost:5432/mealmate # AI Integration MISTRAL_API_KEY=your_mistral_api_key_here # Server Configuration PORT=5000 NODE_ENV=development # Session Security SESSION_SECRET=your_secure_session_secret
-
Database Setup
# Initialize database with schema and sample data npm run db:init # Or run migrations manually npm run db:migrate
-
Development Server
npm run dev
Access the application at
http://localhost:5000
npm run dev- Start development server with hot reloadnpm run check- TypeScript type checkingnpm test- Run test suitenpm run test:watch- Run tests in watch modenpm run test:coverage- Generate test coverage report
npm run db:generate- Generate migration files from schema changesnpm run db:push- Push schema directly to database (development)npm run db:migrate- Run database migrations (production)npm run db:studio- Open Drizzle Studio GUInpm run db:init- Initialize database with schema and sample data
npm run build- Build for productionnpm start- Start production server
MealMate/
โโโ client/ # Frontend React application
โ โโโ src/
โ โ โโโ components/ # Reusable UI components
โ โ โโโ hooks/ # Custom React hooks
โ โ โโโ lib/ # Utilities and configurations
โ โ โโโ pages/ # Route components
โโโ server/ # Backend Express application
โ โโโ routes.ts # API route definitions
โ โโโ storage.ts # Database access layer
โ โโโ recipe-parser.ts # AI-powered recipe parsing
โ โโโ ... # Additional server modules
โโโ shared/ # Shared TypeScript types and schemas
โโโ migrations/ # Database migration files
@/โclient/src/@shared/โshared/@server/โserver/@client/โclient/src/@assets/โattached_assets/
| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | Yes |
MISTRAL_API_KEY |
Mistral AI API key for recipe parsing | Yes |
PORT |
Server port (default: 5000) | No |
NODE_ENV |
Environment mode | No |
SESSION_SECRET |
Secret for session management | Yes |
- Optimistic Updates: Immediate visual feedback during drag operations
- Error Handling: Automatic rollback on failed operations
- Loading States: Visual indicators during async operations
- Improved UX: Better visual feedback and hover states
- React Query Integration: Efficient server state management
- Optimized Cache Invalidation: Precise cache updates for related data
- Memory Management: Proper cleanup and error boundaries
GET /api/recipes- List recipes with filteringPOST /api/recipes- Create new recipePOST /api/recipes/parse- AI-powered text parsingPOST /api/recipes/parse-url- Import from URLPUT /api/recipes/:id/favorite- Toggle favorite status
GET /api/meal-plans- Get meal plans for date rangePOST /api/meal-plans- Create/update meal planDELETE /api/meal-plans/:id- Remove meal plan
GET /api/shopping-list- Generate shopping list for weekPUT /api/shopping-list/:id/check- Toggle item checked state
GET /api/collections- List recipe collectionsPOST /api/recipes/:id/share- Create shareable linkGET /api/shared/:shareId- Access shared recipe
- Input Validation: Comprehensive validation using Zod schemas
- SQL Injection Protection: Parameterized queries with Drizzle ORM
- XSS Prevention: HTML sanitization for user inputs
- Rate Limiting: API endpoint protection
- Secure Sessions: Express session management
- CORS Configuration: Properly configured cross-origin requests
- Responsive Design: Mobile-first approach with Tailwind CSS
- Touch Interactions: Optimized for touch devices
- Progressive Web App: Service worker support (planned)
- Jest for unit and integration tests
- Testing Library for React component testing
- Supertest for API endpoint testing
- Coverage Reports with detailed metrics
npm run build
npm startdocker build -t mealmate .
docker run -p 5000:5000 mealmate- Configure production database
- Set secure session secrets
- Enable HTTPS in production
- Configure proper CORS settings
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
This project is licensed under the MIT License. See the LICENSE file for details.
Database Connection Issues
- Verify DATABASE_URL in .env file
- Ensure PostgreSQL is running
- Check database permissions
Recipe Parsing Failures
- Verify MISTRAL_API_KEY is valid
- Check network connectivity
- Review API rate limits
Build Failures
- Clear node_modules and reinstall
- Check Node.js version compatibility
- Verify all environment variables
- Check the CLAUDE.md file for detailed development guidance
- Review server logs for error details
- Use the health check endpoint:
GET /api/health
- Mobile app development
- Advanced nutrition tracking
- Social features and recipe sharing
- AI-powered meal suggestions
- Integration with grocery delivery services
- Recipe video support
- Advanced meal planning templates
Built with โค๏ธ using modern web technologies for a seamless meal planning experience.