Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name: Build stack and run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Install Docker Compose (build job)
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: none

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{ matrix.language }}"

2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
[![ci.yml](https://github.com/GalacticCodeGambit/LazyCook/actions/workflows/ci.yml/badge.svg)](https://github.com/GalacticCodeGambit/LazyCook/actions/workflows/ci.yml)
[![lint.yml](https://github.com/GalacticCodeGambit/LazyCook/actions/workflows/lint.yml/badge.svg)](https://github.com/GalacticCodeGambit/LazyCook/actions/workflows/lint.yml)

LazyCook soll eine Webanwendung sein. Die es ermöglichen seine vorhanden Zutaten einzutragen und darauf soll LazyCook dir mögliche Rezepte/Gerichte vorschlagen die du aus diesen Zutaten gemacht werden können.

LazyCook soll eine Webanwendung sein. Die es ermöglichen, seine vorhandenen Zutaten einzutragen, und darauf soll LazyCook dir mögliche Rezepte/Gerichte vorschlagen, die du aus diesen Zutaten gemacht werden können.
## Features
- [x] [#23](https://github.com/GalacticCodeGambit/LazyCook/issues/23) Zutaten hinzufügen können
- [x] [#24](https://github.com/GalacticCodeGambit/LazyCook/issues/24) Zutaten entfernen können
Expand All @@ -26,15 +25,15 @@ LazyCook soll eine Webanwendung sein. Die es ermöglichen seine vorhanden Zutate
1. Klonen das Repository:
`git clone https://github.com/GalacticCodeGambit/LazyCook.git`
2. Navigieren zum Projektverzeichnis:
`cd LazyCook/Project`
`cd LazyCook/project`
3. Starten der Anwendung mit: Docker Compose:
`docker compose up --build -d`
<!--Unterschied zu "docker compose up -d"? -->
Die Anwendung sollte jetzt unter `http://localhost:8000` erreichbar sein.

Für die Funktion [#115](https://github.com/GalacticCodeGambit/LazyCook/issues/115) von Email Versenden/Empfangen muss im Ordner `project/` eine `.env` Datei mit den folgenden Variablen angelegt werden:
```
EMAIL_HOST=<dein.mail@gmail.com>
GMAIL_USER=<dein.mail@gmail.com>
GMAIL_PASSWORD=<dein_gmail_passwort>
```

Expand Down
13 changes: 6 additions & 7 deletions project/backend/RecipeSUCUK.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
# SUCUK = Search for Uncomplicated Cooking and User-friendly Kitchen recipes
import Database
from Ingredient import Ingredient
from Recipe import Recipe
from Database import getAllRecipes, getAllIngredientsForRecipe


def findRecipes(ingriedents: list[Ingredient]) -> list[Recipe]:
def findRecipes(ingredients: list[Ingredient]) -> list[Recipe]:
recipes = __initRecipes()

for Ingredient in ingriedents:
recipes = __filterRecipes(recipes, Ingredient)
for ingredient in ingredients:
recipes = __filterRecipes(recipes, ingredient)

recipes.sort(key=lambda x: x.getRating(), reverse=True)

if len(recipes) > 98:
return recipes[:98]

return recipes


def __filterRecipes(recipes: list[Recipe], Ingredient: Ingredient) -> list[Recipe]:
def __filterRecipes(recipes: list[Recipe], ingredient: Ingredient) -> list[Recipe]:
for recipe in recipes:
for recipeIngredient in recipe.getIngredients():
if recipeIngredient.getName() == Ingredient.getName():
if recipeIngredient.getName() == ingredient.getName():
recipe.incrementMatching()
recipe.setRating(recipe.getMatching() / len(recipe.getIngredients()))
return recipes
Expand Down
12 changes: 10 additions & 2 deletions project/backend/SearchRecipeNames.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,26 @@
from Ingredient import Ingredient
from Recipe import Recipe


def getMatchingRecipeNames(searchTerm: str) -> list[Recipe]:
"""Gibt eine Liste von Rezepten zurück, die den Suchbegriff enthalten."""
searchTerm = searchTerm.lower()
matchingRecipes = []
for recipe in getAllRecipes():
if searchTerm in recipe["name"].lower():
matchingRecipes.append(Recipe(recipe["name"], __formatIngredients(recipe["id"]), recipe["description"]))
matchingRecipes.append(
Recipe(
recipe["name"],
__formatIngredients(recipe["id"]),
recipe["description"],
)
)
return matchingRecipes


def __formatIngredients(id: int) -> list[Ingredient]:
IngredientsRaw = getAllIngredientsForRecipe(id)
Ingredients = []
for IngredientRaw in IngredientsRaw:
Ingredients.append(Ingredient(IngredientRaw["name"], IngredientRaw["amount"]))
return Ingredients
return Ingredients
8 changes: 4 additions & 4 deletions project/frontend/app/components/profile_dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,26 @@ export default function ProfileDropdown() {
<div ref={menuRef} className="account-menu">
<button
onClick={() => setOpen(!open)}
className="account-menu__trigger"
className="account-menu-trigger"
aria-label="Account-Menü"
aria-expanded={open}
>
<User size={28} />
</button>

{open && (
<div className="account-menu__dropdown" role="menu">
<div className="account-menu-dropdown" role="menu">
<button
onClick={handleProfil}
className="account-menu__item"
className="account-menu-item"
role="menuitem"
>
<UserCircle size={18} />
<span>Profil ansehen</span>
</button>
<button
onClick={ handleLogout }
className="account-menu__item"
className="account-menu-item"
role="menuitem"
>
<LogOut size={18} />
Expand Down
111 changes: 56 additions & 55 deletions project/frontend/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,86 +1,87 @@
/* stylelint-disable */
@import "tailwindcss";


:root {
--font-size: 16px;
--background: #ffffff;
--foreground: oklch(0.145 0 0);
--card: #ffffff;
--card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.145 0 0);
--background: #fff;
--foreground: oklch(14.5% 0 0deg);
--card: #fff;
--card-foreground: oklch(14.5% 0 0deg);
--popover: oklch(100% 0 0deg);
--popover-foreground: oklch(14.5% 0 0deg);
--primary: #030213;
--primary-foreground: oklch(1 0 0);
--secondary: oklch(0.95 0.0058 264.53);
--primary-foreground: oklch(100% 0 0deg);
--secondary: oklch(95% 0.0058 264.53deg);
--secondary-foreground: #030213;
--muted: #ececf0;
--muted-foreground: #717182;
--accent: #e9ebef;
--accent-foreground: #030213;
--destructive: #d4183d;
--destructive-foreground: #ffffff;
--border: rgba(0, 0, 0, 0.1);
--destructive-foreground: #fff;
--border: rgb(0 0 0 / 10%);
--input: transparent;
--input-background: #f3f3f5;
--switch-background: #cbced4;
--font-weight-medium: 500;
--font-weight-normal: 400;
--ring: oklch(0.708 0 0);
--chart-1: oklch(0.646 0.222 41.116);
--chart-2: oklch(0.6 0.118 184.704);
--chart-3: oklch(0.398 0.07 227.392);
--chart-4: oklch(0.828 0.189 84.429);
--chart-5: oklch(0.769 0.188 70.08);
--ring: oklch(70.8% 0 0deg);
--chart-1: oklch(64.6% 0.222 41.116deg);
--chart-2: oklch(60% 0.118 184.704deg);
--chart-3: oklch(39.8% 0.07 227.392deg);
--chart-4: oklch(82.8% 0.189 84.429deg);
--chart-5: oklch(76.9% 0.188 70.08deg);
--radius: 0.625rem;
--sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.145 0 0);
--sidebar: oklch(98.5% 0 0deg);
--sidebar-foreground: oklch(14.5% 0 0deg);
--sidebar-primary: #030213;
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.97 0 0);
--sidebar-accent-foreground: oklch(0.205 0 0);
--sidebar-border: oklch(0.922 0 0);
--sidebar-ring: oklch(0.708 0 0);
--sidebar-primary-foreground: oklch(98.5% 0 0deg);
--sidebar-accent: oklch(97% 0 0deg);
--sidebar-accent-foreground: oklch(20.5% 0 0deg);
--sidebar-border: oklch(92.2% 0 0deg);
--sidebar-ring: oklch(70.8% 0 0deg);
--text-base: 10px;
--text-2xl: 30px;
--text-lg: 20px;
--text-xl:25px;
}

.dark {
--background: oklch(0.145 0 0);
--foreground: oklch(0.985 0 0);
--card: oklch(0.145 0 0);
--card-foreground: oklch(0.985 0 0);
--popover: oklch(0.145 0 0);
--popover-foreground: oklch(0.985 0 0);
--primary: oklch(0.985 0 0);
--primary-foreground: oklch(0.205 0 0);
--secondary: oklch(0.269 0 0);
--secondary-foreground: oklch(0.985 0 0);
--muted: oklch(0.269 0 0);
--muted-foreground: oklch(0.708 0 0);
--accent: oklch(0.269 0 0);
--accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.396 0.141 25.723);
--destructive-foreground: oklch(0.637 0.237 25.331);
--border: oklch(0.269 0 0);
--input: oklch(0.269 0 0);
--ring: oklch(0.439 0 0);
--background: oklch(14.5% 0 0deg);
--foreground: oklch(98.5% 0 0deg);
--card: oklch(14.5% 0 0deg);
--card-foreground: oklch(98.5% 0 0deg);
--popover: oklch(14.5% 0 0deg);
--popover-foreground: oklch(98.5% 0 0deg);
--primary: oklch(98.5% 0 0deg);
--primary-foreground: oklch(20.5% 0 0deg);
--secondary: oklch(26.9% 0 0deg);
--secondary-foreground: oklch(98.5% 0 0deg);
--muted: oklch(26.9% 0 0deg);
--muted-foreground: oklch(70.8% 0 0deg);
--accent: oklch(26.9% 0 0deg);
--accent-foreground: oklch(98.5% 0 0deg);
--destructive: oklch(39.6% 0.141 25.723deg);
--destructive-foreground: oklch(63.7% 0.237 25.331deg);
--border: oklch(26.9% 0 0deg);
--input: oklch(26.9% 0 0deg);
--ring: oklch(43.9% 0 0deg);
--font-weight-medium: 500;
--font-weight-normal: 400;
--chart-1: oklch(0.488 0.243 264.376);
--chart-2: oklch(0.696 0.17 162.48);
--chart-3: oklch(0.769 0.188 70.08);
--chart-4: oklch(0.627 0.265 303.9);
--chart-5: oklch(0.645 0.246 16.439);
--sidebar: oklch(0.205 0 0);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(0.269 0 0);
--sidebar-ring: oklch(0.439 0 0);
--chart-1: oklch(48.8% 0.243 264.376deg);
--chart-2: oklch(69.6% 0.17 162.48deg);
--chart-3: oklch(76.9% 0.188 70.08deg);
--chart-4: oklch(62.7% 0.265 303.9deg);
--chart-5: oklch(64.5% 0.246 16.439deg);
--sidebar: oklch(20.5% 0 0deg);
--sidebar-foreground: oklch(98.5% 0 0deg);
--sidebar-primary: oklch(48.8% 0.243 264.376deg);
--sidebar-primary-foreground: oklch(98.5% 0 0deg);
--sidebar-accent: oklch(26.9% 0 0deg);
--sidebar-accent-foreground: oklch(98.5% 0 0deg);
--sidebar-border: oklch(26.9% 0 0deg);
--sidebar-ring: oklch(43.9% 0 0deg);
}

@theme inline {
Expand Down
Loading
Loading