- 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
.
Unit tests
- Develop unit tests to cover at least 90% of your application ✔️
Login page
- Create
Login
form ✔️ - Create code to allow
email
input ✔️ - Create code to allow
password
input ✔️ - Create validations to only allow valid email (regex) and password above 6 characters ✔️
- Save two tokens in
localStorage
after form submission, namedmealsToken
andcocktailsToken
✔️ - Save
email key
with user email inlocalStorage
after form submission ✔️ - Redirect to food recipes
main
page after form validation and submission ✔️
Header
- Create
Header
elements for recipe main pages (profile button
,page title
andsearch button
) ✔️ - Implement profile page icon, title and search icon, if it exists in prototype ✔️
- Redirect to profile page once profile button is clicked ✔️
- Develop search button to show/hide search bar when clicked ✔️
Search Bar - Header
- Create
Search Bar
elements, respecting prototype attributes (ingredient radio button
,name radio button
,first letter radio button
andsearch button
) ✔️ - Place search bar below main Header, and implement three radio buttons:
Ingredient
,Name
andFirst letter
✔️ - Fetch from
foods
API if in foods page, and fromdrinks
API in drinks page. ✔️ - If only one recipe is found when searching, redirect to recipe
details
page ✔️ - Show recipes in
cards
if multiple recipes are found ✔️ - Exhibit an
alert
if no recipes are found ✔️
Bottom menu (Footer)
- Create
Footer
elements, respecting prototype attributes (drinks button
,explore button
, andfood button
) ✔️ - Fix Footer in page bottom, and add three icons, one for
Foods
, one forDrinks
, one toExplore
✔️ - Display Footer in pages according to
prototype
✔️ - Redirect user to drinks main page when drinks button is clicked ✔️
- Redirect user to explore page when explore button is clicked ✔️
- Redirect user to foods main page when foods button is clicked ✔️
Recipes main page
- Create
main page
elements, respecting prototype attributes (data-testids
of twelve food/drink cards) ✔️ - Load the first
twelve
cards of either foods or drinks ✔️ - Implement
category
buttons to be used as filters ✔️ - Implement
API
usage based on clicked category filter ✔️ - Implement category filter
toggle
, to return all recipes when clicked twice ✔️ - Implement filters to be used only once, based on clicked element ✔️
- Implement
All
categories button, to return all recipes ✔️ - Redirect user to clicked recipe details page ✔️
Recipes details page
- Create
details page
elements, respecting prototype attributes (data-testids
of elements in page) ✔️ - Fetch API and load recipe based on page
id
parameter ✔️ - Develop page to contain
recipe image
,title
,category
(including if it's alcoholic), list ofingredients
followed byquantities
,instructions
, an embeddedyoutube
video, andrecommendations
✔️ - Implement
recommendations
. If in foods page, recommend drinks, and vice-versa ✔️ - Implement six recommendation
cards
, with a scroll showing two at a time ✔️ - Implement a
Start Recipe
button that must be fixed to bottom page ✔️ - Implement a solution to show
Start Recipe
button only if recipe is not marked asdone
✔️ - Implement a solution to show
Continue Recipe
button if recipe is in progress ✔️ - Redirect user to recipe
in progress
page, if Start Recipe button is clicked ✔️ - Implement buttons to
share
orfavorite
recipes ✔️ - Implement
clipboard-copy
solution when share button is clicked, showing a message that the link was copied ✔️ - Implement
heart
icon as favorite button. Must be black if favorited, and white if not ✔️ - Implement a solution to toggle heart
color
when clicked ✔️ - Send favorite recipes to localStorage, in
favoriteRecipes
key ✔️
Recipes in progress page
- Develop page to contain
recipe image
,title
,category
(including if it's alcoholic), list ofingredients
followed byquantities
, andinstructions
✔️ - Develop
checkboxes
to each list ingredients ✔️ - Implement a solution to add a
line-through
once a checkbox is checked ✔️ - Save progress state, that must persist if page is reloaded or accessed afterwards ✔️
- Implement
share
andfavorite
buttons in progress page ✔️ - Implement a solution to enable
Finish Recipe
button only when all ingredients are checked ✔️ - Redirect user to
Done recipes
page when Finish Recipe button is clicked ✔️
Done recipes page
- Create
done recipes
page elements, respecting prototype attributes (data-testids
of elements in page) ✔️ - Implement a solution to display recipe
image
,name
,category
,nationality
,date
of recipe completion, the first twoAPI tags
returned, and ashare
button, if it's a food recipe card ✔️ - Implement a solution to display recipe
image
,name
, whether it isalcoholic
or not,date
of recipe completion and ashare
button, if it's a drink recipe card ✔️ - Implement a solution to copy recipe details page when
share
button is clicked ✔️ - Implement buttons to filter done recipes by
foods
ordrinks
, and a third to remove filters ✔️ - Redirect to recipe
details
page when clicking in recipe image or name ✔️
Favorite recipes page
- Create
favorite recipes
page elements, respecting prototype attributes (data-testids
of elements in page) ✔️ - Implement a solution to display recipe
image
,name
,category
,nationality
,share
button andunfavorite
button, if it's a food recipe card ✔️ - Implement a solution to display recipe
image
,name
, whether it isalcoholic
or not,share
button andunfavorite
button, if it's a drink recipe card ✔️ - Implement a solution to copy recipe details page when
share
button is clicked ✔️ - Implement a solution to remove recipe from
localStorage
andscreen
if unfavorite button is clicked ✔️ - Implement buttons to filter favorite recipes by
foods
ordrinks
, and a third to remove filters ✔️ - Redirect to recipe
details
page when clicking in recipe image or name ✔️
Explore page
- Create
explore
page elements, respecting prototype attributes (data-testids
of elements in page) ✔️ - Create
explore foods
andexplore drinks
buttons ✔️ - Redirect user to respective explore pages, when buttons are clicked ✔️
Explore drinks/foods pages
- Create
explore foods/drinks
page elements, respecting prototype attributes (data-testids
of elements in page) ✔️ - Create
explore by ingredient
,explore by nationality
andexplore surprise
buttons ✔️ - Redirect user to explore by ingredients page, when button is clicked ✔️
- Redirect user to explore by nationality page, when button is clicked ✔️
- Redirect user to random recipe details page, when
explore surprise
button is clicked ✔️
Explore ingredients page
- Create
explore ingredients
page elements, respecting prototype attributes (data-testids
of elements in page) ✔️ - Display
cards
for the first twelve ingredients, each card containing ingredientname
, and animage
✔️ - When ingredient card is clicked, redirect user to recipes
main
page, but only showing recipes which includes chosen ingredient ✔️
Explore nationality page
- Create
explore nationality
page elements, respecting prototype attributes (data-testids
of elements in page) ✔️ - Develop same specifications from recipes
main
page, but with a dropdown instead of category filters ✔️ - Implement dropdown, showing all areas returned by the
API
, including anAll
option, to return non-filtered recipes ✔️ - Route must only return page if in
foods
./explore/drinks/nationalities
must returnNot Found
error ✔️
Profile page
- Create
profile
page elements, respecting prototype attributes (data-testids
of elements in page) ✔️ - Implement a solution to display user email ✔️
- Implement three buttons:
Done Recipes
,Favorite Recipes
andLogout
✔️ - Redirect user to favorite recipes page when respective button is clicked ✔️
- Redirect user to done recipes page when respective button is clicked ✔️
- Clear
localStorage
and redirect user tologin
page whenLogout
button is clicked ✔️
React
JavaScript
Tailwind
Jest
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