Features • Run Project • Technologies • References • Author • License
- View products
- Add products to cart
- View products in cart
- Increment product quantity in cart
- Decrement product quantity in cart
- Remove product from cart
- Calculate total price
- Payment with stripe
- Sending email to confirm payment
1️⃣ Clone project and access its folder:
$ git clone https://github.com/jtiagosantos/techshop.git
$ cd techshop
2️⃣ Install dependencies:
$ yarn
3️⃣ Define environment variables:
#STRIPE
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_51KBVwiHkwOzynbEXsGE06zXuy7qXuGtMgmbQcDxEXX7GRfrGGB5FjIbMBtWEDXvqNj2SpMyn2QUKjU7VdvbzEmM900O0za"
STRIPE_SECRET_KEY="sk_test_51KBVwiHkwOzynbEX8jaXgLnR7vq74xSqsjXhUmiK7J1oE3HpXkaFVo2MABvhOCgrPMvXiZYxvoZf35wQpYDa4O1G00bGrLLbHQ"
STRIPE_WEBHOOK_SECRET="whsec_66ce0624aaddf5f2ac5aa310ea27fb88d1912bd60f095f4c5bb35e6471d043a2"
#API
API_BASE_URL="http://localhost:3000"
#NODEMAILER
NODEMAILER_HOST="" //your variables
NODEMAILER_POST= //your variables
NODEMAILER_AUTH_USER="" //your variables
NODEMAILER_AUTH_PASS="" //your variables
4️⃣ Start project:
$ yarn dev
5️⃣ Execute the below code to stripe listen to local webhook (needs Stripe CLI):
$ stripe listen --forward-to http://localhost:3000/api/webhook
The following tools were used in the construction of project:
- Getting started with Next.js, TypeScript, and Stripe Checkout
- Create an eCommerce website with Next.js and Stripe
- Get started with the Stripe CLI
- Stripe helpers
- Checkout prices migration guide
- Enviando e-mails com Node.js + Nodemailer
This project is under license MIT.