Build a Shopping Cart With React JS & Stripe

Ғылым және технология

In this project, we will create a shopping cart using React and Stripe.
📽️ Cooper Codes KZread Channel:
/ coopercodes
💻 Code:
github.com/coopercodes/ReactE...
💖 Show Support
Patreon: / traversymedia
PayPal: paypal.me/traversymedia
👇 Follow Traversy Media On Social Media:
Twitter: / traversymedia
Instagram: / traversymedia
Linkedin: / bradtraversy
Timestamps:
0:00 Project showcase
1:25 Create react app / installs
2:22 Navbar component
6:00 Implementing React Router
7:45 Creating pages for router
10:35 Building rows and cols for Store page
12:14 Creating products for React to use
16:50 Loading products dynamically
19:18 Creating product card component
22:45 Creating a modal for the cart
25:55 Creating our cart context (Cart functionality)
46:02 Adding CartProvider to our app
46:29 Creating add / remove product to product cards
52:05 Adding cart functionality to navbar (number of items)
54:40 Showing cart data in modal
57:00 Creating CartProduct component
1:01:00 Create Stripe account and add test products
1:03:06 Creating Express server / installs
1:05:00 Creating Stripe checkout request
1:09:30 Adding Stripe IDs to React
1:10:33 Creating checkout call from React
1:13:43 Final project / checkout demo!
1:15:06 Thank you for watching

Пікірлер: 184

  • @sanjaybatak3549
    @sanjaybatak3549 Жыл бұрын

    Just when you wanted something like this, Brad drops this video. 🎉 Thank you Brad and the team. You guys are doing phenomenal work.

  • @paulthomas1052
    @paulthomas1052 Жыл бұрын

    A fantastic tutorial. Easy to follow....no errors....a great introduction to Stripe too. Thanks

  • @aliplaysgtr
    @aliplaysgtr Жыл бұрын

    Exactly what I needed for a graduation work. Thanks a lot! Super clear and comprehensive

  • @mikeynavarro3195
    @mikeynavarro3195 Жыл бұрын

    This is probably my favorite youtube tutorial, Cooper revisited harder concepts for clarification multiple times. he's cool for that, definitely earned a Sub

  • @renangaldino6538
    @renangaldino6538 Жыл бұрын

    This is absolutaly one of the best React tutorial avaiable in YT, Thanks a lot !!!

  • @laxmiprasanna4092
    @laxmiprasanna40928 ай бұрын

    This is exactly what we need. These small videos help us during actual work.

  • @thangtruong1808
    @thangtruong180811 ай бұрын

    Thank you for your time to support us. Loved.

  • @JonBrookes
    @JonBrookes Жыл бұрын

    Watching this from start to finish I honestly did not know how Cooper Codes would fit all the material required to code a react app and Stripe backend with express in such a short session but he did ! Very well structured approach and excellent teaching by Cooper. If you dont know arrays in Javascript and methods for workng with them you will at the end of this. If you've never used context with React you will be fine to do so at the end of this video. If you thought integrating payments into a front end app or any other for that matter is in some way beyond reason difficult you will see how easy it can be by the end of this tutorial. Thank you Cooper and also to the venerable Brad for showcasing a new channel and content of great quality

  • @tonykharioki6913
    @tonykharioki6913 Жыл бұрын

    I hadn't used stripe in two years, and thanks for this. I needed this refresher

  • @RobButzofNorthAmerica
    @RobButzofNorthAmerica Жыл бұрын

    Stuff like this is why I support your Patreon! Thanks so much

  • @shannonbrookshire234
    @shannonbrookshire234 Жыл бұрын

    great tutorial. thank you so much for your efforts. I was stuck on a project for a couple of days and using the 'useContext' and 'CartContext' approach really helped. thanks

  • @hbela1000
    @hbela1000 Жыл бұрын

    Your tutorial is very straightforward, thx Brad, thx Cooper.

  • @user-hg9zo5gu7v
    @user-hg9zo5gu7v6 ай бұрын

    This video helped me finish my first full stack project. Thank you.

  • @maskman4821
    @maskman4821 Жыл бұрын

    This is the best React + Stripe tutorial, thank you so much 🙏

  • @brandonespinosa3756
    @brandonespinosa37569 ай бұрын

    Bravissimo, context hook is amazing. Thank you so much for showing this. Great video!

  • @josephngugi
    @josephngugi Жыл бұрын

    Been looking forward to learn stripe and here it is. thanks to traversy media

  • @pablodominguez6129
    @pablodominguez6129 Жыл бұрын

    awesome, simple and cut to the chase. Thanks man!

  • @user-ry8ko5fc8n
    @user-ry8ko5fc8n3 ай бұрын

    This was an amazing tutorial! I am working on a Capstone project that is very similar to this so this was really, really helpful!! Thank you!

  • @user-qi2hv3rx6l
    @user-qi2hv3rx6l26 күн бұрын

    You're genuinely the boss. No cap. Thanks a lot 🤝

  • @Brazo07
    @Brazo0710 ай бұрын

    Loved every single minute. Thank you so much

  • @DavisNorde
    @DavisNorde Жыл бұрын

    Thank you, Cooper! And nice t-shirt, Brad :)

  • @blue_berry_pie64
    @blue_berry_pie64 Жыл бұрын

    Very nice video explaination for each step! Thank Brad and Cooper Codes so much!

  • @Julesarixx__my__teleqram__ID

    @Julesarixx__my__teleqram__ID

    Жыл бұрын

    👆send a direct message for support and guidance

  • @plaguegames3556
    @plaguegames35563 ай бұрын

    Great job Cooper, thanks.

  • @charugupta7103
    @charugupta7103 Жыл бұрын

    Heyyy traversy! Big fan here, saw your react tutorial few months ago. Came back to revise the same and found this. Thanks for the amazing contetnt.

  • @user-vk8kt3tp1g

    @user-vk8kt3tp1g

    Жыл бұрын

    Questions can come in⬆️

  • @blipblop92
    @blipblop9211 ай бұрын

    Thank you Cooper. Amazing tutorial, so glad I found your channel. Wish the tutorial also showed how to deploy the code to something like heroku or netlify.

  • @250kennedy8
    @250kennedy8 Жыл бұрын

    @CooperCodes thank you for this amazing project.

  • @mukangwakalonda7726
    @mukangwakalonda7726 Жыл бұрын

    I thanks all traversy group, it is my first time I manage the payment project God bless you all

  • @perrythepalteypus2185
    @perrythepalteypus2185 Жыл бұрын

    Brilliant tutorial man ❤️ total blast 👌🏻

  • @tonghandsome1
    @tonghandsome1 Жыл бұрын

    Thank you very much Cooper for all the efforts you have done! Also Thank you Brad!

  • @Julesarixx__my__teleqram__ID

    @Julesarixx__my__teleqram__ID

    Жыл бұрын

    👆send a direct message for support and guidance .

  • @tristen_grant
    @tristen_grant Жыл бұрын

    I give him 10/10. Easy to follow and good pacing.

  • @Julesarixx__my__teleqram__ID

    @Julesarixx__my__teleqram__ID

    Жыл бұрын

    👆send a direct message for support and guidance .

  • @TechIndustryAnalysis
    @TechIndustryAnalysis Жыл бұрын

    Thanks for doing this bro!

  • @Feciboy
    @Feciboy3 ай бұрын

    Great tutorial! Thank you!

  • @cosanostraytc1030
    @cosanostraytc1030 Жыл бұрын

    Great tutorial man. Thank you!!!

  • @futureverse9347
    @futureverse9347 Жыл бұрын

    Very good project Thank you @Cooper Codes 10/10

  • @andrewaghoghovwia1948
    @andrewaghoghovwia1948 Жыл бұрын

    Thanks so much guys

  • @VitorGomes_
    @VitorGomes_ Жыл бұрын

    Awesome work! Thank you.

  • @Russ_Paul
    @Russ_Paul Жыл бұрын

    Excellent tutorial Cooper, you're a very good teacher. Your tutorial is very straightforward, it's to the point and makes perfect sense start to finish. One thought that is going through my mind, I don't know if this goes against the grain of React, but could it be restructured into an MVC pattern?

  • @VictorJReilly118
    @VictorJReilly118 Жыл бұрын

    Thanks so much!! Really good tutorial!

  • @christian-schubert
    @christian-schubert Жыл бұрын

    Thanks for this! Love how Cooper structures this video, I really think Brad should make sure any video to be featured on this channel should meet certain criteria, i.e. demonstrating the final product before getting down to the nitty-gritty, etc.

  • @shannonbrookshire234
    @shannonbrookshire234 Жыл бұрын

    I can't give this video enough thumbs up. Thank You

  • @omarimoody9794
    @omarimoody9794 Жыл бұрын

    Excellent work, Appreciate cha!

  • @guilhermebrazmoreirafaria5126
    @guilhermebrazmoreirafaria5126 Жыл бұрын

    I came here just for the removeOneFromCart and it was awesome, thanks for the help. It really helped me a lot. I was in big troubblle using filter instead of map and then removing the product and then pushing it in again, but it was changing the array order, and this is not fine.

  • @tarcisiosassi9379
    @tarcisiosassi937910 ай бұрын

    Really cool. Thanks for share!!

  • @aniket1008
    @aniket1008 Жыл бұрын

    Best tutorial on shopping cart on react

  • @nathanle8957
    @nathanle89576 ай бұрын

    Another tutorial hell. keep going!

  • @paymankhayree8552
    @paymankhayree85526 ай бұрын

    thanks. really helped me

  • @oyeyinkaojora
    @oyeyinkaojora7 ай бұрын

    Thank you so much for this,

  • @oxanasf6369
    @oxanasf6369 Жыл бұрын

    Amazing, thank you!

  • @danielowusu6163
    @danielowusu616311 ай бұрын

    Lifesaver 🎉 subscribed

  • @arminesmaili908
    @arminesmaili908 Жыл бұрын

    real good Armin liked that👍

  • @nathanle8957
    @nathanle89576 ай бұрын

    Thanks Cooper

  • @thenomadengineer9260
    @thenomadengineer92609 ай бұрын

    DUDE... MEGA HELPFUL

  • @sonamohialdin3376
    @sonamohialdin3376 Жыл бұрын

    This is awesome tutorial thank you

  • @kellyncodes7421
    @kellyncodes7421 Жыл бұрын

    Thanks for the vdeo Brad/Copper Code

  • @densel.c8935
    @densel.c89357 күн бұрын

    Great video!

  • @nicolassuarez2933
    @nicolassuarez29339 ай бұрын

    Best of its kind!

  • @movrew
    @movrew Жыл бұрын

    This is super cool

  • @Hodja60
    @Hodja60 Жыл бұрын

    Great tutorial

  • @programmingwithnit5308
    @programmingwithnit5308 Жыл бұрын

    Thank you so much🙏🙏

  • @emvoinamdinh
    @emvoinamdinh Жыл бұрын

    thank you sir very much !!!😍😍

  • @dgloria
    @dgloria Жыл бұрын

    Cool T-shirt!

  • @kamichikora6035
    @kamichikora6035 Жыл бұрын

    Yes!!!!! Cooper codes!!!! This guy has good stuff

  • @CooperCodes

    @CooperCodes

    Жыл бұрын

    Hah I appreciate it! Thanks for watching :)

  • @TheBelafleck
    @TheBelafleck Жыл бұрын

    Hey. This is awesome and very helpful. One question: How is the cart emptied after the purchase is completed?

  • @codewithahad5990
    @codewithahad5990 Жыл бұрын

    It;s was really great toturial best of luck

  • @Julesarixx__my__teleqram__ID

    @Julesarixx__my__teleqram__ID

    Жыл бұрын

    👆send a direct message for support and guidance .

  • @haroldve98
    @haroldve98 Жыл бұрын

    this tutorial it's absolutely god thanks

  • @Julesarixx__my__teleqram__ID

    @Julesarixx__my__teleqram__ID

    Жыл бұрын

    👆send a direct message for support and guidance .

  • @aguywithoutaname
    @aguywithoutaname Жыл бұрын

    Thanks man

  • @varadarajanm6954
    @varadarajanm6954 Жыл бұрын

    Awesome

  • @bnji6601
    @bnji6601 Жыл бұрын

    Amazing tutorial, I had one question on the success and cancel url in the server. I realize this works for localhost. For live deployment how would you go about setting up the routes for that.

  • @Julesarixx__my__teleqram__ID

    @Julesarixx__my__teleqram__ID

    Жыл бұрын

    👆send a direct message for support and guidance .

  • @emmanuelenwereji472
    @emmanuelenwereji4723 ай бұрын

    Thank you for this awesome video, I would really appreciate if I can get more clarifications on using local storage for this project, I am having issues, whenever I reload the page, I usually loose all my items in the cart. Thank you

  • @logancabrera7824
    @logancabrera7824 Жыл бұрын

    Hey guys, I'm having troubles hosting this code. Do I have to change any code to make it work on the web (hosted)?

  • @thomasstambaugh5181
    @thomasstambaugh5181 Жыл бұрын

    Does the Modal (that contains the cart) hide when the user clicks outside the BROWSER? For example, if the user has this app open in a chrome browser on a desktop and clicks on "Snipping tool" to take a screenshot, will the Modal hide? I spent a few days (close to a week) trying to provide that behavior to an Material UI (v5) pane with no success. It appears that the "onHide" handler in the (Bootstrap Modal component) is somehow connected to the "focusout" and "blur" events that are flying around under the cover. I'm curious about whether this is a "hard" problem that the Modal component solves or (more likely) whether I'm just confused about how to provide the desired behavior. I do have one substantive criticism of the approach presented here -- I would have used literal object ("{}") rather than array ("[]") for the container of items. Since each item in the array must have a unique ID, then the "id" property used in each item can be its key in an object container. That makes the manipulators for the items cleaner, more robust, and more performant. I appreciate this well edited piece. I might pick some nits with specifics, but those are just nits -- this is an excellent piece.

  • @iamailasama
    @iamailasama Жыл бұрын

    great!

  • @jawidz4636
    @jawidz4636 Жыл бұрын

    Amazing tutorial bro ! One question ! im trying to use that show cart button in some other component. tried many stuff but none worked! any suggestion for that matter ? i Appreciate any help

  • @ambrosebeavers
    @ambrosebeavers Жыл бұрын

    Hi There, thank you for this vid. How do one receive payment in a production environment using Stripe. Would it be the same procedure. How would the money get to ones bank account

  • @sadique_x_
    @sadique_x_2 ай бұрын

    ohh Brad!🤟

  • @Seedley
    @Seedley Жыл бұрын

    This is a great video. If I want to make a post once I get a success url back from stripe is there a way to do that? I'm making a car listing site and would like to charge per car post.

  • @lehuynh7637
    @lehuynh7637 Жыл бұрын

    20:29 you can use ffc snippet Simple React Snippets extension to fast to code

  • @ahsanaqueel1182
    @ahsanaqueel1182 Жыл бұрын

    Hey @CooperCodes what if we have a lot of products how can we use stripe without creating products on stripe as it will be very difficult to upload same products on 2 different platforms (website and stripe).

  • @ankitbhatt9388
    @ankitbhatt9388 Жыл бұрын

    I am deploying a project like this, so in cart.jsx and server.js page in checkout function what URL should i give.

  • @CodeCouture
    @CodeCouture10 ай бұрын

    hi, I have a question whn building a full stack ecommerce website how to do you get the person's details Thank you

  • @jancahlik9959
    @jancahlik995911 ай бұрын

    How does one host this project in production? Can someone explain please? Would this be under 1 domain and hosting? I am confused, because two different ports are being used.

  • @bradwoods371
    @bradwoods371 Жыл бұрын

    what would be the best way to implement this into a site already built with html css javascript etc.

  • @igwanwan_dagoat1523
    @igwanwan_dagoat1523 Жыл бұрын

    Can I use this for business use?

  • @godswillumukoro8908
    @godswillumukoro8908 Жыл бұрын

    Awesome tutorial I'm not sure why, it doesn't work for me unless I change the modefrom 'payment' to 'subscription'

  • @travisbacon5527
    @travisbacon552710 ай бұрын

    Any chance you would do a course on stripe payments for saas apps that uses pay per seat? I.e. admin pays for five seats and then invite users and then they can expand and reduce subscription based on active users.

  • @iUniverse
    @iUniverse Жыл бұрын

    Hi Brad, if you don't mind can you make a React, Redux-Saga, React Tool Kit real world projects tutorial in your Udemy platform. Learning with you is a great help.

  • @iUniverse

    @iUniverse

    Жыл бұрын

    Is this Brad's Whatsapp number?

  • @rajatmalviya1097

    @rajatmalviya1097

    Жыл бұрын

    I am also looking for a Redux-tool kit Course.

  • @psnjathin8615
    @psnjathin8615 Жыл бұрын

    The best

  • @estifanosgashawtena8789
    @estifanosgashawtena8789 Жыл бұрын

    Great video, at 45:40 to find the total cost of products from cart, it better to use Array.Reduce() but overall good content 👌

  • @CooperCodes

    @CooperCodes

    Жыл бұрын

    Yeah there were definitely some tradeoffs at areas to make the code easier to understand, I feel map can be easier to show that at each item we are getting that total price but it is a bit unnecessary. Thanks for the comment and perspective I appreciate it.

  • @Murdermurcox
    @Murdermurcox Жыл бұрын

    Great tutorial i succeeded to do this on localhost. I want to publish it to my hosting. Im new to react and run a build in the shop folder. How can i build the server along with my project and upload into the ftp.

  • @Julesarixx__my__teleqram__ID

    @Julesarixx__my__teleqram__ID

    Жыл бұрын

    👆send a direct message for support and guidance

  • @963seeker
    @963seeker Жыл бұрын

    does anyone know how to set a fixed quantity for items to control the amount of supply of any given item? A user might pay for an item that the supplier (You) don't have in stock :( Any help is greatly appreciated

  • @user-kj5ug4ok3b
    @user-kj5ug4ok3b4 ай бұрын

    Hey Brad, Thanks for this video. I just having one question, Because I am not able to access array for added product in other components of my project. How can I fix this ?

  • @plaguegames3556

    @plaguegames3556

    3 ай бұрын

    C'mon that is a very specific request with almost none information given. Maybe if you can share the code people can help here.

  • @mostafahemdan8609
    @mostafahemdan860915 күн бұрын

    This Bootstrap is unfamiliar to me , Is this better or the usual one written in the class name?

  • @longsyee
    @longsyee Жыл бұрын

    Is a great teaching but i really hope that more stuff can be added such as multer for file upload profile page dashboard setingup mongo forgot password email api to send email websocket for live chat etc.... so many missing wait you to have a more advance video

  • @ArnavSingh-im5bj
    @ArnavSingh-im5bj10 ай бұрын

    You should have also covered webhook

  • @danimusbar
    @danimusbar Жыл бұрын

    Unfortunately the stripes service is not available yet for indonesia

  • @yuehanchen578
    @yuehanchen5788 ай бұрын

    I Created my account and updated the stripe Secret key and product API but it was not working when you click the "Purchase" button

  • @Chroknow
    @Chroknow Жыл бұрын

    😃Hey ! Is it possible to learn from scratch react with this tutorial please ? :)

  • @sridhararavamudan1801
    @sridhararavamudan1801 Жыл бұрын

    By any chance did you receive an email after entering your email address? I kind of tried it, but I am failing

  • @puahwankoon9227
    @puahwankoon92278 ай бұрын

    Hello, i follow along the whole tutorial and all is fine till listening on port 4000, it keep throwing error "Cannot GET /", even i clone this github project and still the same error, anyone please help!!>

  • @davisspradling5456
    @davisspradling5456 Жыл бұрын

    How did you get a blank JSON file at 1 hour and 4 minutes. Thanks and keep up the videos!!

  • @CooperCodes

    @CooperCodes

    Жыл бұрын

    Hey sorry that one was a little unclear I'm realizing. I ran the npm init --yes command in my terminal to create the package.json file.

  • @davisspradling5456

    @davisspradling5456

    Жыл бұрын

    @@CooperCodes Thank you!

  • @davisspradling5456

    @davisspradling5456

    Жыл бұрын

    @@CooperCodes How would you get it so when you refresh the page in the browser so the cart total does not reset? Thanks!!!

Келесі