Company
Date Published
Author
Ryan Belke
Word count
450
Language
English
Hacker News points
None

Summary

To create a new Strapi project, simply copy and paste the command line `npx create-strapi-app my-project` in your terminal. This tutorial is part of the "Cooking a Deliveroo clone with Next.js (React), GraphQL, S[strapi] and Stripe" series. The author provides instructions on how to add items to a shopping cart using React Context API. A new component named Cart.js is created to track items added to the cart across pages. The state of items in the cart is managed using the React Context API, but saving items to a cookie upon page refresh is not implemented yet. An AppProvider directory is created to use the context throughout the application and on the dishes page. Updates are made to `_app.js` and `restaurants.js` files to use the AppProvider/Consumer components. The Cart component appears on the right side of the dishes when the page is refreshed, and a logout button is added to the Layout header if the user is logged in. However, this implementation lacks server-side validation for sensitive data.