# Recipe Manager

A C# ASP.NET Core MVC web application for managing your personal recipe collection with advanced search and filtering capabilities.

## Features

- **Recipe Management**: Add, edit, view, and delete recipes
- **Advanced Search**: Search recipes by title, description, and ingredients
- **Smart Filtering**: 
  - Filter by category
  - Include specific ingredients (must-have)
  - Exclude unwanted ingredients (allergens, dietary restrictions)
- **Responsive Design**: Works on desktop, tablet, and mobile devices
- **Interactive UI**: 
  - Ingredient checklist in recipe details
  - Real-time search and filtering
  - Recipe cards with hover effects

## Database Configuration

The application connects to a MySQL database with the following configuration:
- **Server**: nordh.xyz:3306
- **Database**: recept
- **Username**: recepieUser
- **Password**: v.FV-ssZPzVyev28

## Getting Started

### Prerequisites

- .NET 8.0 SDK
- Access to the MySQL database (credentials provided above)

### Running the Application

1. Clone or download this project
2. Open the project in Visual Studio Code
3. Open a terminal and navigate to the project directory
4. Run the application:
   ```bash
   dotnet run
   ```
5. Open your web browser and navigate to `http://localhost:5104`

### Building the Application

```bash
dotnet build Recepie.sln
```

## Project Structure

```
Recepie/
├── Controllers/
│   └── RecipeController.cs      # Main controller with search/filter logic
├── Data/
│   └── RecipeContext.cs         # Entity Framework DbContext
├── Models/
│   └── Recipe.cs                # Recipe entity model
├── ViewModels/
│   └── RecipeIndexViewModel.cs  # ViewModel for index page
├── Views/
│   ├── Recipe/
│   │   ├── Index.cshtml         # Main recipe listing with search/filter
│   │   ├── Details.cshtml       # Recipe details view
│   │   ├── Create.cshtml        # Add new recipe form
│   │   ├── Edit.cshtml          # Edit recipe form
│   │   └── Delete.cshtml        # Delete confirmation
│   └── Shared/
│       └── _Layout.cshtml       # Main layout template
└── wwwroot/
    └── css/
        └── site.css             # Custom styling
```

## Usage

### Adding Recipes

1. Click "Add New Recipe" button
2. Fill in the recipe details:
   - Title and description
   - Category and difficulty level
   - Preparation and cooking times
   - Number of servings
   - Ingredients (comma-separated)
   - Step-by-step instructions
3. Click "Save Recipe"

### Searching and Filtering

Use the left sidebar to:

- **Search**: Enter keywords to search in titles, descriptions, and ingredients
- **Category Filter**: Select a specific recipe category
- **Include Ingredients**: Enter ingredients that must be present (comma-separated)
- **Exclude Ingredients**: Enter ingredients to avoid (comma-separated)

### Example Searches

- Find all recipes with "chicken": Enter "chicken" in the search box
- Find recipes you can make with eggs and flour: Enter "eggs, flour" in "Must Have Ingredients"
- Find recipes without nuts: Enter "nuts" in "Must NOT Have Ingredients"
- Combine filters: Search for "pasta" with "tomato" included and "meat" excluded

## Technology Stack

- **Backend**: ASP.NET Core 8.0 MVC
- **Database**: MySQL with Entity Framework Core
- **Frontend**: Bootstrap 5, Font Awesome icons, jQuery
- **Styling**: Custom CSS with responsive design

## Database Schema

The Recipe entity includes:
- **Id**: Primary key
- **Title**: Recipe name (required)
- **Description**: Brief description
- **Ingredients**: Comma-separated list (required)
- **Instructions**: Step-by-step cooking instructions
- **Category**: Recipe category (e.g., "Main Course", "Dessert")
- **Difficulty**: Easy, Medium, or Hard
- **PreparationTimeMinutes**: Prep time
- **CookingTimeMinutes**: Cooking time
- **Servings**: Number of servings
- **CreatedAt/UpdatedAt**: Timestamps

## Contributing

This is a personal recipe management application. Feel free to customize it for your needs!

## License

This project is for personal use.