A comprehensive meal planning web application built with ASP.NET Core that helps users plan meals, manage recipes, and generate shopping lists.
- .NET 9.0+ SDK
- SQL Server
- Visual Studio 2022 or VS Code
# Clone the repository
git clone <repository-url>
cd CookingNotebookWebApp
# Build the project
dotnet build
# Update the database
dotnet ef database update
# Run the application
dotnet runThe app will be available at http://localhost:5000
- Generate meal plans for 1-30 days
- Select meal times (breakfast, lunch, dinner, snacks)
- Add dietary restrictions and preferences
- Intelligent recipe selection based on:
- User favorites
- Recipe ratings
- Review count
- Random variation
- Automatic ingredient aggregation
- Ingredient quantities scaled to number of people
- Grouped by ingredient category
- Interactive checklist
- Print and email options
- Browse and search recipes
- View detailed recipe information
- Rate and review recipes
- Save favorites
- Filter by cuisine type, cooking method, and time
- User registration and login
- Personal profile management
- Change password
- Favorites management
CookingNotebookWebApp/
├── Controllers/ # API and view controllers
├── Services/ # Business logic
├── Models/ # Data models
├── Views/ # Razor views
├── Data/ # Database context and migrations
├── wwwroot/ # Static files (CSS, JS, images)
├── Helpers/ # Utility functions
└── Program.cs # Application startup
The algorithm uses a 6-step process:
- Initialize: Load user favorites and prepare tracking list
- Loop: Iterate through each day and meal time
- Build Candidate Pool: Filter recipes by meal time and restrictions
- Score Candidates:
- Favorite: +10 points
- Rating 4.5+: +5 points; 4.0+: +3 points
- 20+ reviews: +2 points
- Random: 0-2 points
- Select: Choose recipe with highest score
- Generate Shopping List: Calculate ingredient quantities based on number of people
GET /api/mealplanning/health
GET /api/mealplanning/mealtimes
POST /api/mealplanning/generate
Content-Type: application/json
{
"userId": 1,
"numDays": 7,
"numPeople": 2,
"mealTimeIds": [1, 2, 3],
"restrictions": ["Vegetarian"]
}
POST /api/mealplanning/test
Edit appsettings.json:
{
"ConnectionStrings": {
"DefaultConnection": "Server=YOUR_SERVER;Database=CookingNotebook;Trusted_Connection=true;TrustServerCertificate=true;"
}
}In Views/MealPlanning/Index.cshtml, update the USER_ID constant (currently hardcoded as 1).
Required tables:
Users- User accountsRecipe- Recipe informationMealTime- Meal types (breakfast, lunch, dinner, snacks)RecipeIngredient- Ingredients in recipesIngredient- Ingredient catalogFavorites- User favoritesReview- Recipe reviews
Run the included test file:
dotnet testOr test via API:
curl -X POST http://localhost:5000/api/mealplanning/test- Page load: < 2 seconds
- API response: 2-5 seconds
- Total time from request to result: 4-7 seconds
- ✓ Server-side input validation
- ✓ Parameterized queries (no SQL injection)
- ✓ Read-only operations
- ✓ Cookie-based authentication
- ✓ CORS policy configured
- Primary: #f28c38 (Orange)
- Text: #5a3210 (Dark Brown)
- Background: #fff8f3 (Light Cream)
- Borders: #e3b289 (Light Orange)
- Font: Segoe UI
- H1: 2.2rem, weight 700
- Body: 1em, weight 400
- Mobile: < 768px
- Tablet: 768-1024px
- Desktop: > 1024px
-- Check data
SELECT COUNT(*) FROM MealTimes;
SELECT COUNT(*) FROM Recipe;
SELECT COUNT(*) FROM RecipeIngredient;
-- Reset database
-- dotnet ef database drop
-- dotnet ef database update| Issue | Solution |
|---|---|
| 500 Server Error | Check database connection string |
| CSS not loading | Clear browser cache (Ctrl+Shift+R) |
| No recipes found | Verify database has recipe data |
| CORS error | Check CORS policy in Program.cs |
- Framework: ASP.NET Core 9.0
- Database: Entity Framework Core with SQL Server
- Frontend: Razor Views, HTML, CSS, JavaScript
- Authentication: Cookie-based with Google OAuth support
- BCrypt.Net-Next (password hashing)
- Google.Apis.Auth (OAuth)
- Entity Framework Core
🚀 Production Ready
- ✅ Meal planning algorithm
- ✅ API endpoints
- ✅ Responsive UI
- ✅ Database integration
- ✅ Form validation
- ✅ Error handling
- Change recipe option in meal plan
- Save favorite meal plans
- Export to PDF / Email
- Nutrition tracking
- Allergen filtering
- Cost optimization
- Dark theme support
Academic Project - CookingNotebookWebApp
Last Updated: November 26, 2025
Version: 1.0.0
Framework: ASP.NET Core 9.0