Build and Deploy a Modern Full Stack ECommerce React Application with Stripe

JavaScript Mastery · 1.4M views · 2022 · 3:34:12

Open on YouTube

Web developmentSoftware architecture & designcoursedated

Why Stack Overflow recommends it

Stack Overflow users link it because their questions and answers come from following this tutorial, citing timestamps for the Sanity slug query, cart quantity state, and the Stripe checkout step.

Recommended by 2 people across 2 different months, 2022 to 2022.

What it is

A 3.5 hour project course from JavaScript Mastery that builds a full stack e-commerce store with React and Next.js. It uses Sanity as the product CMS, the React Context API for cart state, and Stripe for real checkout payments, then deploys the result.

What people said

Recommends Tomas Kopcik · 2022-10 · Stack Overflow · on “Stripe issues when "pay with stripe" React Js method”

I am following tutorial step by step [this video] everything doing step by steps but when clicking on paying with stripe the window redirecting will pop up but that's it... when checking console I've got this errors [LINK] 400 (Bad Request) In console I have Uncaught (in promise) IntegrationError: stripe.redirectToCheckout: You must provide one of lineItems, items, or sessionId. My code's so far getStripe.js import { loadStripe } from '@stripe/stripe-js'; let stripePromise; const getStripe = () => { if(!stripePromise) { stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY); } return stripePromise; } export default getStripe; stripe.js import Stripe from 'stripe'; const stripe

Recommends well yes but no · 2022-11 · Stack Overflow · on “how to filter only one data with a specific slug in sanity.io?”

You get back all the data but the first one or first item in that array of data is the one your searching for so at the end of your query put [0] at the end to get the first value you should be solid eg *[_type=="game" && slug.current == '${params.game}'][0] Ref go to this video which is taught by js mastery skip to 1:21:27 he starts explaining how to get the current slug/product [this video]

Cites SNAK3 · 2022-08 · Stack Overflow · on “set quantity back to 1 when I open a different product”

I have this silly and weird issue I am trying to over come but as there are no errors i don't know which part of my code should i paste here. The issue i want to solve is the product quantity does not update back to 1 once i move to a different product page after adding current product to the cart the issue can also be seen in the tutorial video [this video] around at 2:35:44 to 2:35:51 Product A quantity 5 Product B quantity still 5 instead of it's initial state 1 I would really appreciate the help this is my state Context code import React, { createContext, useContext, useState, useEffect } from "react"; import { toast } from "react-hot-toast"; const Context = createContext(); export const Stat

Cites Saeed Abass · 2022-10 · Stack Overflow · on “TypeError: Cannot destructure property 'image' of 'product' as it is null in a sanity ecommerce tutorial”

I am following a [this video] , and I get and error at 1:28:11 saying Type Error: Cannot destructure property 'image' of 'product' as it is null. I'll paste the code below, any help would be appreciated. import React from 'react' import { client, urlFor } from '../../lib/client'; const ProductDetails = ({ product, products }) => { const { image, name, details, price } = product; return ( <div> <div className='product-detail-container'> <div> <div className='image-container'> <img src={urlFor(image && image[0])} /> </div> </div> </div> </div> ) } export const getStaticPaths = async () => { const query = `*[_type == "product"] { slug { current } } `; const products = await client.fetch(query); cons

Cites Xiaohu · 2022-12 · Stack Overflow · on “Error when fetching with stripe: Uncaught IntegrationError: stripe.redirectToCheckout: You must provide one of lineItems, items, or sessionId”

I am currently building an Ecommerce store with React and Stripe and learning through it. Now I have reached the checkout with Stripe, but there is a problem: 'Uncaught (in promise) IntegrationError: stripe.redirectToCheckout: You must provide one of lineItems, items, or sessionId'. Also my const data is undefined. This project is from the platform Youtube for learning to build ecommerce shops. Here is the link: Video [this video] (Section: 'Stripe') Here are the code snippets: Cart.jsx: ` const handleCheckout = async () => { const stripe = await getStripe(); const response = await fetch('/api/stripe', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(cartIte