E-commerce on the Jamstack with NextJS and Netlify

certificate
Recording and certification are available to Multipass and Full ticket holders only
Please login if you have one.
Rate this content
Bookmark

Jamstack frameworks are changing the way we build top-of-the-line experiences on the web. They are performant, secure and enable developers to build web apps faster than before. In this workshop, Nick DeJesus will walk you through what it's like to build an e-commerce site using NextJS, use-shopping-cart and theme-ui. You will learn how serverless functions with Netlify to help you make secure transactions and how to build accessible UI components that extend use-shopping-cart's abilities.

This workshop has been presented at React Summit Remote Edition 2021, check out the latest edition of this React Conference.

FAQ

To set up your local environment, follow the instructions in the repository's README. Click the deploying button on the getting started section in the README. If you encounter any issues, refer to the troubleshooting channel on Discord.

If you haven't set up your environment yet, follow the provided link in the Discord to get started. You can also follow along with the workshop and set up as you go. The main branch contains the completed project if you need a reference.

The workshop is designed to be four hours long, but the goal is to keep it as close to two hours as possible. The workshop involves high-level discussions and copying and pasting code.

If you have questions during the workshop, feel free to unmute your mic and ask, or drop your questions in the Zoom chat or Discord chat, and they will be answered as soon as possible.

The useShoppingCart library is a Stripe-powered shopping cart state and logic library for React developers. It helps manage shopping cart functionality, including adding items to the cart and processing payments with Stripe.

To integrate the useShoppingCart library, first install it in your project. Then, initialize Stripe with your API key, wrap your app with the CartProvider, and use functions like addItem and removeItem to manage the shopping cart state.

Theme UI is a library for building consistent, themeable React apps. In the workshop, it is used for styling components, managing color modes (dark/light), and ensuring responsiveness without writing media queries.

To handle dark and light modes in Theme UI, use the useColorMode hook. Toggle between default and dark modes by setting up a button with logic to switch modes using the useColorMode hook.

To add more products, update the products array in the JSON file with new product objects, including properties like name, price, and ID. Ensure that the new products are correctly formatted and integrated into the site.

To handle serverless functions with Netlify, create a functions folder at the root level of your project and add function files, such as create-session.js. Use these functions to manage tasks like validating cart items and processing payments securely.

Nick DeJesus
Nick DeJesus
120 min
10 Jun, 2021

Comments

Sign in or register to post your comment.

Video Summary and Transcription

This workshop focuses on launching an e-commerce experience on Next.js and Netlify, using the useShoppingCart library for shopping cart functionality. The workshop covers project setup, dynamic routes, integration with Stripe, Netlify functions, and authentication. It also explores theme UI, Netlify features, and Netlify forms. The presenter mentions the availability of a Gatsby version of the workshop and highlights Next.js Commerce as a template for integrating with popular e-commerce tools. Overall, the workshop provides a comprehensive overview of building an e-commerce site using Next.js and Netlify.
Video transcription and chapters available for users with access.