Skip to content

Repository files navigation

Mes Recettes 🍽️

A modern, personal recipe management application built with Blazor WebAssembly and Supabase. Organize your favorite recipes, associate them with cookbooks and authors, and never lose track of your culinary treasures again!

✨ Features

  • 📝 Recipe Management: Create, edit, and organize your favorite recipes
  • 📚 Cookbook Integration: Associate recipes with physical or digital cookbooks
  • 🏪 Store & Restaurant Tracking: Track recipes from stores, restaurants, and prepared meal vendors
  • 🌐 Website Integration: Store URLs for online recipes with clickable links
  • Rating System: Rate recipes from 1-5 stars for easy favorites tracking
  • 📄 Page References: Track page numbers for cookbook recipes
  • 🏷️ Source Badges: Visual indicators showing recipe origin (book/store/website/homemade)
  • 🖨️ Print-Friendly: Generate clean, printable versions of recipes with source information
  • 📱 Responsive Design: Works beautifully on desktop, tablet, and mobile
  • 🔍 Search & Filter: Find recipes by name, rating, cookbook, store, or author
  • 📊 Dashboard Statistics: Track your recipe collection, popular books, and favorite stores

🚀 Quick Start

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/mongeon/RecettesIndex.git
    cd RecettesIndex
  2. Restore dependencies

    dotnet restore
  3. Configure Supabase

    • Create a new project at supabase.com
    • Update wwwroot/appsettings.json:
    {
       "Supabase": {
          "Url": "YOUR_SUPABASE_URL",
          "Key": "YOUR_SUPABASE_ANON_KEY"
       }
    }
  4. Set up the database Run this SQL in your Supabase SQL editor:

    -- Create tables
       CREATE TABLE authors (
          id SERIAL PRIMARY KEY,
          first_name VARCHAR(255) NOT NULL,
          last_name VARCHAR(255),
          created_at TIMESTAMP DEFAULT NOW()
       );
    
       CREATE TABLE books (
          id SERIAL PRIMARY KEY,
          title VARCHAR(255) NOT NULL,
          created_at TIMESTAMP DEFAULT NOW()
       );
    
       CREATE TABLE books_authors (
          book_id INTEGER REFERENCES books(id) ON DELETE CASCADE,
          author_id INTEGER REFERENCES authors(id) ON DELETE CASCADE,
          created_at TIMESTAMP DEFAULT NOW(),
          PRIMARY KEY (book_id, author_id)
       );
    
       CREATE TABLE stores (
          id SERIAL PRIMARY KEY,
          name VARCHAR(255) NOT NULL,
          address TEXT,
          phone VARCHAR(50),
          website TEXT,
          notes TEXT,
          created_at TIMESTAMP DEFAULT NOW()
       );
    
       CREATE TABLE recettes (
          id SERIAL PRIMARY KEY,
          name VARCHAR(255) NOT NULL,
          notes TEXT,
          rating INTEGER CHECK (rating >= 1 AND rating <= 5),
          book_id INTEGER REFERENCES books(id),
          page INTEGER,
          store_id INTEGER REFERENCES stores(id),
          url TEXT,
          created_at TIMESTAMP DEFAULT NOW()
       );
  5. Run the application

    dotnet run
  6. Open in browser Navigate to http://localhost:5000

🏗️ Tech Stack

  • Frontend: Blazor WebAssembly (.NET 10.0)
  • UI Framework: MudBlazor (Material Design)
  • Backend: Supabase (PostgreSQL + REST API)
  • Authentication: Supabase Auth
  • Testing: xUnit with NSubstitute mocking and comprehensive unit test coverage
  • CI/CD: GitHub Actions with automated testing and deployment
  • Hosting: Azure Static Web Apps

🧪 Testing

This project maintains comprehensive unit test coverage with 559 tests across all business logic (as reported by dotnet test):

# Run all tests
dotnet test

# Run tests with detailed output
dotnet test --verbosity detailed

# Run specific test file
dotnet test --filter "RecipeModelTests"

Test Coverage

  • Model Validation: Recipe rating constraints (1-5), data annotations, relationship tests, store associations
  • Service Layer: BookAuthorService, RecipeService, StoreService, CacheService, SupabaseRecipesQuery, Result pattern
  • Business Logic: Author name formatting, book-recipe relationships, store-recipe relationships, caching
  • Constants: Service constants validation, pagination, sorting, cache configuration
  • Custom Exceptions: NotFoundException, ServiceException, ValidationException
  • Component Tests: Edit dialogs for Recipe, Book, Author, and Store with creation date preservation
  • Integration Tests: Complete relationship chains, store integration, and data integrity
  • Edge Cases: Invalid inputs, boundary conditions, null handling, error scenarios
  • Data Relationships: Book-Author-Recipe associations, Store-Recipe associations, and many-to-many mappings

📖 Documentation

For detailed information, visit our comprehensive documentation:

🛠️ Development

Development Workflow

  1. Always create a feature branch (never work directly on main)
  2. Write comprehensive unit tests for all new functionality
  3. Run tests before committing - ensure dotnet test passes
  4. Validate all changes using git diff and git show --stat
  5. Run and test the application before committing
  6. Update documentation when making changes
  7. Get user approval before creating commits or PRs
  8. Use GitHub MCP server for all GitHub operations

Quick Commands

# Clean and rebuild
dotnet clean && dotnet build

# Run all tests
dotnet test

# Run with hot reload
dotnet run

# Run on specific port
dotnet run --urls "http://localhost:5030"

# Publish for production
dotnet publish -c Release

Project Structure

RecettesIndex/
├── 📁 .github/
│   ├── 📁 workflows/    # GitHub Actions CI/CD
│   └── 📄 copilot-instructions.md # AI agent development guidelines
├── 📁 src/             # Main application source
│   ├── 📁 Configuration/ # App configuration
│   ├── 📁 Layout/       # App layout components
│   ├── 📁 Models/       # Data models with validation
│   ├── 📁 Pages/        # Blazor pages and dialogs
│   ├── 📁 Services/     # Business logic services
│   │   ├── 📁 Abstractions/ # Service interfaces
│   │   ├── 📁 Exceptions/ # Custom exception types
│   │   ├── RecipeService.cs
│   │   ├── BookAuthorService.cs
│   │   ├── CacheService.cs
│   │   └── SupabaseRecipesQuery.cs
│   ├── 📁 Shared/       # Shared components
│   ├── 📁 wwwroot/      # Static assets
│   │   └── staticwebapp.config.json # Azure Static Web Apps config
│   ├── 📄 Program.cs    # App entry point
│   └── 📄 _Imports.razor # Global imports
├── 📁 tests/           # Unit test project (559 tests)
│   ├── � Integration/  # Integration tests
│   ├── � Models/       # Model tests
│   ├── � Pages/        # Component tests
│   ├── � Services/     # Service layer tests
│   │   └── � Exceptions/ # Exception tests
│   └── 📄 RecettesIndex.Tests.csproj # Test project file
├── 📁 docs/            # Project documentation  
└── 📄 RecettesAI.slnx  # Solution file

🤝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Follow our development workflow (see documentation)
  4. Make your changes and test thoroughly
  5. Update documentation to reflect your changes
  6. Commit with clear messages: git commit -m "Add amazing feature"
  7. Push to your fork: git push origin feature/amazing-feature
  8. Create a Pull Request

Development Guidelines

  • Follow C# conventions and use nullable reference types
  • Use MudBlazor components for consistent UI
  • Implement proper async/await patterns
  • Include error handling and loading states
  • Write comprehensive unit tests for all new features - mandatory before PRs
  • Achieve high test coverage - aim for 100% coverage of business logic
  • Follow testing conventions - use descriptive test file names and Arrange-Act-Assert pattern
  • Keep documentation up to date

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🆘 Support

🙏 Acknowledgments


Made with ❤️ for home cooks who love to organize their recipes

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages