Pr64 fixes - #178
Open
AshokGaire3 wants to merge 74 commits into
Open
Conversation
Updated the README to enhance feature descriptions and add new sections.
Added user roles and expanded user stories for the application.
Removed instructions for user roles and user stories format.
Updated reflections on challenges and support needed.
/client /server scaffolding
- client - folder structure - /assets, /components, pages, /services - client - router structure - based in App.jsx
feat(client): Create Home page, Website Nav bar
Added a checkmark to the Home page feature and included a note about a beta demo with an image.
Replaced beta demo image with a YouTube video link.
Added progress report for Milestone 3 detailing project setup, issues created, milestones, completion percentages, and features completed.
Changes to be committed: modified: client/src/App.jsx new file: client/src/assets/eggs.jpg modified: client/src/components/Card.jsx new file: client/src/components/Ingredient.jsx modified: client/src/components/SearchBar.jsx new file: client/src/pages/AddIngredient.jsx new file: client/src/pages/Kitchen.jsx new file: client/src/services/api.jsx
feat(client): Add Kitchen page, and AddIngredient page
on branch erd changes to be committed: modified: client/src/app.jsx modified: client/src/pages/addingredient.jsx new file: client/src/pages/editingredient.jsx modified: client/src/pages/kitchen.jsx modified: client/src/services/api.jsx new file: server/.env new file: server/config/dotenv.js new file: server/controllers/controller.js new file: server/db/dbpool.js new file: server/db/schema.js new file: server/models/model.js modified: server/package-lock.json modified: server/package.json new file: server/routes/routes.js modified: server/server.js
feat(server): add database schema and routes for ingredients table - erd realized in schema.js - database pool established with .env - servers basic MVC structure setup - backend mvc routing for ingredients table established - client src/services/api.js request logic established for ingredients table
structure On branch recipes Changes to be committed: renamed: server/controllers/controller.js -> server/controllers/ingredientsController.js new file: server/controllers/recipeController.js renamed: server/models/model.js -> server/models/ingredientsModel.js new file: server/models/recipeModel.js renamed: server/routes/routes.js -> server/routes/ingredientsRoutes.js new file: server/routes/recipeRoutes.js modified: server/server.js
refactor(server): added create route for recipe table and separated MVC
- full crud routes on backend for recipes table - home page cards populated with database recipes On branch recipes-crud Changes to be committed: modified: client/src/components/Card.jsx modified: client/src/pages/Home.jsx modified: client/src/services/api.jsx modified: server/controllers/recipeController.js modified: server/models/recipeModel.js modified: server/routes/recipeRoutes.js
feat(server): full crud mvc for recipes table
Updated Milestone 4 progress report with completion percentage and completed issues.
- user can logout by pressing on the logout button in the profile menu On branch logout Changes to be committed: modified: client/src/components/ProfileMenu.jsx modified: client/src/pages/Login.jsx modified: client/src/services/auth.js modified: server/routes/auth.js modified: server/server.js
feat(): add logout functionality
Added a checkmark to the User Authentication section and included a demo video link.
On branch profile-page Changes to be committed: modified: client/src/App.jsx new file: client/src/pages/Profile.jsx modified: server/db/schema.js
feat(client): add profile page
- server - schema update to include prefereces table - server - routes for preferences table - client - profile page has modal to edit preferences - client - edit preferences modal can add and delte preferences On branch preferences-page Changes to be committed: modified: client/src/App.jsx new file: client/src/components/PrefItem.jsx new file: client/src/pages/EditPreferences.jsx modified: client/src/pages/Profile.jsx new file: client/src/services/preferenceApi.js new file: client/src/services/userApi.jsx new file: server/controllers/preferenceController.js modified: server/controllers/userController.js modified: server/db/schema.js new file: server/models/preferenceModel.js modified: server/models/userModel.js new file: server/routes/preferencesRoutes.js modified: server/routes/userRoutes.js modified: server/server.js
feat(): add edit preference model on profile page
- when click away from the menu modal the modal closes On branch menu-toggle Changes to be committed: modified: client/src/components/Nav.jsx
feat(client): click away to close menu
- when a user presses heart icon on home feed it shows up in their profile favorites On branch favorite Changes to be committed: modified: client/src/components/Card.jsx modified: client/src/pages/Profile.jsx modified: client/src/services/api.jsx new file: client/src/services/favoritesApi.js new file: server/controllers/favoritesController.js new file: server/models/favoritesModel.js new file: server/routes/favoritesRoutes.js modified: server/server.js
feat(): enable favorite functionality
- page for recipes On branch recipe-page Changes to be committed: modified: client/src/App.jsx modified: client/src/components/Card.jsx new file: client/src/pages/Recipe.jsx
feat(client): add recipe page
On branch del-fav Changes to be committed: new file: client/src/assets/trash-icon.svg new file: client/src/components/ProfileIngrCard.jsx modified: client/src/pages/Profile.jsx modified: client/src/services/favoritesApi.js modified: server/controllers/favoritesController.js modified: server/models/favoritesModel.js modified: server/routes/favoritesRoutes.js
feat(): add ability to delete favorite
…e when edit On branch profile-edit-and-refresh Changes to be committed: modified: client/src/components/PrefItem.jsx modified: client/src/components/ProfileIngrCard.jsx new file: client/src/pages/Calendar.jsx modified: client/src/pages/EditPreferences.jsx modified: client/src/pages/Profile.jsx
…refresh fix(client): allow favorites and preferences to update on profile page when edit
- Kitchen table columns were shifted by one, mislabeling calories as category and hiding dietary facts - EditPreferences refetched on every render via a `[preferences]` effect dependency; switch to explicit refetch after create/delete - preferenceController.getPreference called a typo'd model method (getPreferencec) that never existed, throwing on every call - Home's rating/date sort dropdowns were unwired decoration; wire them to actually sort the recipe list
Home is now reachable without a session. Favoriting still requires login: the heart button routes guests to /login instead of firing an API call that would 500 without req.user. Nav (which held the only login entry point) is hidden for guests, so add a minimal guest header with a Log in link.
Ingredients were global (SELECT * FROM ingredients with no user_id filter) despite the schema already having a kitchen join table that no model/controller/route ever touched. Add kitchenModel/Controller/ Routes mirroring the favorites pattern, backed by the existing kitchen table (user_id, ingredient_id, quantity, unit). Also add requireAuth/requireAdmin middleware, applied here since these are brand-new routes that assume req.user.id.
On branch calendar Changes to be committed: modified: client/src/App.jsx new file: client/src/assets/left-caret.png new file: client/src/assets/right-caret.png modified: client/src/pages/Calendar.jsx
feat(client): add layout of calendar page
…r-stories Close out issue #17: complete remaining user stories
selected On branch mealday Changes to be committed: modified: client/src/pages/Calendar.jsx
feat(client): user directed to recipe when a calendar meal day is selected
Found these reviewing my own PR after it merged. addToKitchen was inserting a new ingredients row every time instead of reusing the existing one, so the catalog filled up with duplicates. Re-adding something you already have now just updates the quantity. The is_admin flag I added wasn't picked up by anyone already logged in, since passport was caching the whole user row in the session, so I switched it to store the id and read the user per request. Also fixed addToKitchen navigating away before the POST finished. Admin now uses the api service instead of its own fetch and API_URL, dropped the duplicate load functions in Admin and Calendar, added try/catch to scheduledMealsApi, and moved App's styles into a styles object.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.