An intelligent meal planning system with AI integration, supporting recipe management, products, and shopping lists.
FoodMatch is a comprehensive web application that helps users efficiently plan meals, manage recipes, and automatically generate shopping lists. Leveraging OpenAI's artificial intelligence, the application offers personalized culinary suggestions tailored to user dietary preferences.
This project was successfully defended as an Engineering Thesis and awarded with honors.
- π€ OpenAI Integration - Intelligent recipe and meal plan suggestions
- π Meal Planning - Create and manage weekly meal plans
- π Recipe Database - Complete recipe library with ability to add custom recipes
- π Automatic Shopping Lists - Generate shopping lists based on meal plans
- π₯ Product Management - OpenFoodFacts integration for detailed product information
- π€ User Management - Secure registration and JWT authentication
- π― Dietary Preferences - Personalization according to diets and user preferences
- π Unit Tracking - Support for various measurement units for ingredients
- π§ Email Notifications - Notification system for users
- π Security - Role-based authorization with Identity Framework
- Framework: ASP.NET Core 8.0
- Language: C# 12
- Database: PostgreSQL
- ORM: Entity Framework Core
- Cache: Redis
- Authentication: JWT Bearer + ASP.NET Identity
- AI: OpenAI API (GPT-4)
- Email: SMTP (Gmail)
- Framework: React 19
- Language: TypeScript 5.9
- Build Tool: Vite 7
- UI Library: Material-UI (MUI) v7
- Routing: React Router v7
- Forms: React Hook Form + Zod
- Styling: Emotion (CSS-in-JS)
- Testing: Vitest + Testing Library
- Containerization: Docker + Docker Compose
- Admin Tools: pgAdmin 4, Redis Commander
- Testing: xUnit, Vitest
Before starting, make sure you have installed:
- .NET 8.0 SDK or newer
- Node.js (LTS) and npm
- Docker Desktop
- Git
git clone <repository-url>
cd foodmatchStart PostgreSQL, Redis, and administrative tools:
cd backend/inzynierka
docker-compose up -dAvailable services:
- PostgreSQL:
localhost:5433 - Redis:
localhost:6379 - pgAdmin:
http://localhost:8080(admin@foodmatch.com / admin123) - Redis Commander:
http://localhost:8081
Edit the file backend/inzynierka/appsettings.json:
{
"AI": {
"ApiKey": "YOUR_OPENAI_API_KEY"
},
"Email": {
"SmtpUsername": "your-email@gmail.com",
"SmtpPassword": "your-app-password",
"FromEmail": "your-email@gmail.com"
},
"ConnectionStrings": {
"DefaultConnection": "Host=localhost;Port=5433;Database=foodmatch;Username=postgres;Password=postgres"
}
}cd backend/inzynierka
dotnet ef database updateOr use the built-in migration on first application startup.
cd backend/inzynierka
dotnet runThe API will be available at: http://localhost:5127
Swagger UI: http://localhost:5127/swagger
cd frontend
npm installEdit frontend/src/config.ts if the API runs on a different port:
export const API_URL = 'http://localhost:5127';npm run devThe application will be available at: http://localhost:5173
cd backend/inzynierka
dotnet publish -c Release -o ./publishcd frontend
npm run buildThe built application will be located in the frontend/dist/ folder.
# Unit tests
cd backend/inzynierka.Tests
dotnet test
# Integration tests
cd backend/inzynierka.IntegrationTests
dotnet testcd frontend
npm testfoodmatch/
βββ backend/
β βββ inzynierka/ # Main ASP.NET Core application
β β βββ AI/ # OpenAI integration
β β βββ Auth/ # Authentication and authorization
β β βββ Data/ # DbContext and EF configuration
β β βββ MealPlans/ # Meal planning
β β βββ Products/ # Product management
β β βββ Recipes/ # Culinary recipes
β β βββ ShoppingList/ # Shopping lists
β β βββ Users/ # User management
β β βββ UserPreferences/ # User preferences
β β βββ Migrations/ # Entity Framework migrations
β β βββ Program.cs # Application entry point
β βββ inzynierka.Tests/ # Unit tests
β βββ inzynierka.IntegrationTests/ # Integration tests
β
βββ frontend/
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Application pages
β β βββ services/ # API services
β β βββ contexts/ # React Context
β β βββ types/ # TypeScript types
β β βββ utils/ # Utility functions
β β βββ __tests__/ # Unit tests
β βββ public/ # Static files
β
βββ README.md
POST /api/auth/register- User registrationPOST /api/auth/login- LoginPOST /api/auth/refresh-token- Refresh token
GET /api/recipes- Recipe listPOST /api/recipes- Add recipeGET /api/recipes/{id}- Recipe detailsPUT /api/recipes/{id}- Update recipeDELETE /api/recipes/{id}- Delete recipe
GET /api/mealplans- Plans listPOST /api/mealplans- Create planGET /api/mealplans/{id}- Plan details
GET /api/products- Product listGET /api/products/search- Search products
GET /api/shoppinglists- User's shopping listsPOST /api/shoppinglists- Create list
- JWT Tokens: Access token (60 min) + Refresh token (7 days)
- Password Hashing: ASP.NET Identity with default password hasher
- CORS: Configured for
http://localhost:5173 - HTTPS: Required in production
- Role-based authorization: Admin and User
- Change
JWT:secretinappsettings.jsonto a secure key (min. 32 characters) - Remove API keys from code before commit
- Use HTTPS in production
- Regularly update dependencies
dotnet ef migrations add InitialCreate
dotnet ef database updateCheck CORS configuration in Program.cs and URL in config.ts.
docker-compose down -v
docker-compose up -dAfter starting the backend, full Swagger documentation is available at:
http://localhost:5127/swagger
- Backend: C# Coding Conventions (Microsoft)
- Frontend: ESLint + Prettier
- Fork the project
- Create a branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open a Pull Request
MIT
- Szymon Zych - frontend
- Kamil ZiΓ³Εkowski - backend
For questions or issues, open an Issue on GitHub.
- OpenFoodFacts - Product database
Made with β€οΈ for food lovers