Guga-Santos / recipesApp

Repositório dedicado à projeto feito durante o curso de desenvolvimento web da Trybe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Project Recipes App

  • Project to develop a recipes app, using the most modern tools in React: Hooks and Context API.
  • Two APIs consumed, one for meals, other for drinks.
  • Project endeavours:
    • Use Redux to manage states
    • Use React-Redux library
    • Use React Context API to manage states
    • Use React Hook useState
    • Use React Hook useContext
    • Use React Hook useEffect
    • Create Custom Hooks
    • Use clipboard-copy library
Routes
  • Login screen: /;
  • Food recipes main screen: /foods;
  • Drink recipes main screen: /drinks;
  • Food recipe details screen: /foods/{recipe-id};
  • Drink recipe details screen: /drinks/{recipe-id};
  • In progress food recipe screen: /foods/{recipe-id}/in-progress;
  • In progress drink recipe screen: /drinks/{recipe-id}/in-progress;
  • Explore screen: /explore;
  • Explore foods screen: /explore/foods;
  • Explore drinks screen: /explore/drinks;
  • Explore foods by ingredient screen: /explore/foods/ingredients;
  • Explore drinks by ingredient screen: /explore/drinks/ingredients;
  • Explore foods by nationality screen: /explore/foods/nationalities;
  • Profile screen: /profile;
  • Done recipes screen: /done-recipes;
  • Favorite recipes screen: /favorite-recipes.

Requirements

Unit tests
  1. Develop unit tests to cover at least 90% of your application ✔️
Login page
  1. Create Login form ✔️
  2. Create code to allow email input ✔️
  3. Create code to allow password input ✔️
  4. Create validations to only allow valid email (regex) and password above 6 characters ✔️
  5. Save two tokens in localStorage after form submission, named mealsToken and cocktailsToken ✔️
  6. Save email key with user email in localStorage after form submission ✔️
  7. Redirect to food recipes main page after form validation and submission ✔️
Header
  1. Create Header elements for recipe main pages (profile button, page title and search button) ✔️
  2. Implement profile page icon, title and search icon, if it exists in prototype ✔️
  3. Redirect to profile page once profile button is clicked ✔️
  4. Develop search button to show/hide search bar when clicked ✔️
Search Bar - Header
  1. Create Search Bar elements, respecting prototype attributes (ingredient radio button, name radio button, first letter radio button and search button) ✔️
  2. Place search bar below main Header, and implement three radio buttons: Ingredient, Name and First letter ✔️
  3. Fetch from foods API if in foods page, and from drinks API in drinks page. ✔️
  4. If only one recipe is found when searching, redirect to recipe details page ✔️
  5. Show recipes in cards if multiple recipes are found ✔️
  6. Exhibit an alert if no recipes are found ✔️
Bottom menu (Footer)
  1. Create Footer elements, respecting prototype attributes (drinks button, explore button, and food button) ✔️
  2. Fix Footer in page bottom, and add three icons, one for Foods, one for Drinks, one to Explore ✔️
  3. Display Footer in pages according to prototype ✔️
  4. Redirect user to drinks main page when drinks button is clicked ✔️
  5. Redirect user to explore page when explore button is clicked ✔️
  6. Redirect user to foods main page when foods button is clicked ✔️
Recipes main page
  1. Create main page elements, respecting prototype attributes (data-testids of twelve food/drink cards) ✔️
  2. Load the first twelve cards of either foods or drinks ✔️
  3. Implement category buttons to be used as filters ✔️
  4. Implement API usage based on clicked category filter ✔️
  5. Implement category filter toggle, to return all recipes when clicked twice ✔️
  6. Implement filters to be used only once, based on clicked element ✔️
  7. Implement All categories button, to return all recipes ✔️
  8. Redirect user to clicked recipe details page ✔️
Recipes details page
  1. Create details page elements, respecting prototype attributes (data-testids of elements in page) ✔️
  2. Fetch API and load recipe based on page id parameter ✔️
  3. Develop page to contain recipe image, title, category (including if it's alcoholic), list of ingredients followed by quantities, instructions, an embedded youtube video, and recommendations ✔️
  4. Implement recommendations. If in foods page, recommend drinks, and vice-versa ✔️
  5. Implement six recommendation cards, with a scroll showing two at a time ✔️
  6. Implement a Start Recipe button that must be fixed to bottom page ✔️
  7. Implement a solution to show Start Recipe button only if recipe is not marked as done ✔️
  8. Implement a solution to show Continue Recipe button if recipe is in progress ✔️
  9. Redirect user to recipe in progress page, if Start Recipe button is clicked ✔️
  10. Implement buttons to share or favorite recipes ✔️
  11. Implement clipboard-copy solution when share button is clicked, showing a message that the link was copied ✔️
  12. Implement heart icon as favorite button. Must be black if favorited, and white if not ✔️
  13. Implement a solution to toggle heart color when clicked ✔️
  14. Send favorite recipes to localStorage, in favoriteRecipes key ✔️
Recipes in progress page
  1. Develop page to contain recipe image, title, category (including if it's alcoholic), list of ingredients followed by quantities, and instructions ✔️
  2. Develop checkboxes to each list ingredients ✔️
  3. Implement a solution to add a line-through once a checkbox is checked ✔️
  4. Save progress state, that must persist if page is reloaded or accessed afterwards ✔️
  5. Implement share and favorite buttons in progress page ✔️
  6. Implement a solution to enable Finish Recipe button only when all ingredients are checked ✔️
  7. Redirect user to Done recipes page when Finish Recipe button is clicked ✔️
Done recipes page
  1. Create done recipes page elements, respecting prototype attributes (data-testids of elements in page) ✔️
  2. Implement a solution to display recipe image, name, category, nationality, date of recipe completion, the first two API tags returned, and a share button, if it's a food recipe card ✔️
  3. Implement a solution to display recipe image, name, whether it is alcoholic or not, date of recipe completion and a share button, if it's a drink recipe card ✔️
  4. Implement a solution to copy recipe details page when share button is clicked ✔️
  5. Implement buttons to filter done recipes by foods or drinks, and a third to remove filters ✔️
  6. Redirect to recipe details page when clicking in recipe image or name ✔️
Favorite recipes page
  1. Create favorite recipes page elements, respecting prototype attributes (data-testids of elements in page) ✔️
  2. Implement a solution to display recipe image, name, category, nationality, share button and unfavorite button, if it's a food recipe card ✔️
  3. Implement a solution to display recipe image, name, whether it is alcoholic or not, share button and unfavorite button, if it's a drink recipe card ✔️
  4. Implement a solution to copy recipe details page when share button is clicked ✔️
  5. Implement a solution to remove recipe from localStorage and screen if unfavorite button is clicked ✔️
  6. Implement buttons to filter favorite recipes by foods or drinks, and a third to remove filters ✔️
  7. Redirect to recipe details page when clicking in recipe image or name ✔️
Explore page
  1. Create explore page elements, respecting prototype attributes (data-testids of elements in page) ✔️
  2. Create explore foods and explore drinks buttons ✔️
  3. Redirect user to respective explore pages, when buttons are clicked ✔️
Explore drinks/foods pages
  1. Create explore foods/drinks page elements, respecting prototype attributes (data-testids of elements in page) ✔️
  2. Create explore by ingredient, explore by nationality and explore surprise buttons ✔️
  3. Redirect user to explore by ingredients page, when button is clicked ✔️
  4. Redirect user to explore by nationality page, when button is clicked ✔️
  5. Redirect user to random recipe details page, when explore surprise button is clicked ✔️
Explore ingredients page
  1. Create explore ingredients page elements, respecting prototype attributes (data-testids of elements in page) ✔️
  2. Display cards for the first twelve ingredients, each card containing ingredient name, and an image ✔️
  3. When ingredient card is clicked, redirect user to recipes main page, but only showing recipes which includes chosen ingredient ✔️
Explore nationality page
  1. Create explore nationality page elements, respecting prototype attributes (data-testids of elements in page) ✔️
  2. Develop same specifications from recipes main page, but with a dropdown instead of category filters ✔️
  3. Implement dropdown, showing all areas returned by the API, including an All option, to return non-filtered recipes ✔️
  4. Route must only return page if in foods. /explore/drinks/nationalities must return Not Found error ✔️
Profile page
  1. Create profile page elements, respecting prototype attributes (data-testids of elements in page) ✔️
  2. Implement a solution to display user email ✔️
  3. Implement three buttons: Done Recipes, Favorite Recipes and Logout ✔️
  4. Redirect user to favorite recipes page when respective button is clicked ✔️
  5. Redirect user to done recipes page when respective button is clicked ✔️
  6. Clear localStorage and redirect user to login page when Logout button is clicked ✔️

Language and Tools

react React

javascript JavaScript

jest Jest

Get started

Install it locally
  • Open terminal and create a directory in your preferred location:
$ mkdir <Your directory name here>
  • Access directory then clone the repository:
$ cd <Your directory name here>
$ git clone git@github.com:ViniGB/Project-Recipes-app.git
  • Access the newly created directory:
$ cd Project-Recipes-app
  • Install dependencies:
$ npm install
  • Start application:
$ npm start

Project developed in group

Raphael Soares de Freitas
Breno Laskavski Lopes
Thiago Silva Muniz

About

Repositório dedicado à projeto feito durante o curso de desenvolvimento web da Trybe


Languages

Language:JavaScript 93.9%Language:CSS 4.2%Language:HTML 1.9%