Skip to content

Conversation

@MihaiZecheru
Copy link
Contributor

Summary

Add the meal planner feature (frontend and backend).

Changes

Add db table: logged_meals
Add trpc routes: logMeal, getAllLoggedMeals, deleteLoggedMeal
Add page to sidebar: /nutrition
Add btn to food-card.tsx for logging a meal

Closes #527

Add db table: logged_meals
Add trpc routes: logMeal, getAllLoggedMeals, deleteLoggedMeal
Add page to sidebar: /nutrition
Add btn to food-card.tsx for logging a meal
@EightBitByte EightBitByte self-requested a review December 1, 2025 23:41
@EightBitByte
Copy link
Collaborator

EightBitByte commented Dec 2, 2025

Had an issue when clicking a meal tracker add button @MihaiZecheru:

insert or update on table "logged_meals" violates foreign key constraint "logged_meals_user_id_users_id_fk"
image

Could this be because of the way you're inserting the meal? I'll look deeper into the issue later, but a good place to start looking in the meantime would be in your insert procedure and/or the db schema for this table.

@MihaiZecheru
Copy link
Contributor Author

Ah, I forgot to specify that there has to be a dummy user in the DB for this to work.

Create a user in the Users table with ID=TEST_USER

Copy link
Collaborator

@EightBitByte EightBitByte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look great and work great on the local device. A few nitpicks when it comes to styling and adding some comments for things TODO later. Overall, great work!

Please fix before Friday. Message me on Discord if you have any questions.

import { apiTest } from "@api/apiTest";
import { describe } from "vitest";

// TODO: finish adding tests
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EightBitByte EightBitByte changed the base branch from main to dev December 3, 2025 00:38
MihaiZecheru and others added 16 commits December 4, 2025 17:59
Co-authored-by: Jacob Moy <79670488+EightBitByte@users.noreply.github.com>
Co-authored-by: Jacob Moy <79670488+EightBitByte@users.noreply.github.com>
Co-authored-by: Jacob Moy <79670488+EightBitByte@users.noreply.github.com>
For replacing alert with a toast/sonner

Co-authored-by: Jacob Moy <79670488+EightBitByte@users.noreply.github.com>
Co-authored-by: Jacob Moy <79670488+EightBitByte@users.noreply.github.com>
For replacing alert with toast/sonner

Co-authored-by: Jacob Moy <79670488+EightBitByte@users.noreply.github.com>
Co-authored-by: Jacob Moy <79670488+EightBitByte@users.noreply.github.com>
Co-authored-by: Jacob Moy <79670488+EightBitByte@users.noreply.github.com>
Co-authored-by: Jacob Moy <79670488+EightBitByte@users.noreply.github.com>
Co-authored-by: Jacob Moy <79670488+EightBitByte@users.noreply.github.com>
Co-authored-by: Jacob Moy <79670488+EightBitByte@users.noreply.github.com>
Co-authored-by: Jacob Moy <79670488+EightBitByte@users.noreply.github.com>
Co-authored-by: Jacob Moy <79670488+EightBitByte@users.noreply.github.com>
Copy link
Collaborator

@EightBitByte EightBitByte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! There are a few things yet to implement but those come later when we're ready.

@EightBitByte EightBitByte merged commit bcf5809 into dev Dec 9, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

📋 Meal Tracker

3 participants