Next.js 13 E-Commerce Tutorial (App Router, TypeScript, Deployment, TailwindCSS, Prisma, DaisyUI)
By freeCodeCamp.org
Published: Oct 05, 2023
Build and deploy a full-stack e-commerce website with Next.js 13.4 and the new app router. This tutorial will walk you through harnessing Next.js server actions, managing databases with Prisma, constructing a dynamic website akin to Amazon, and ensuring user security with Next-Auth, MongoDB, and Google login. Enhance user experience with anonymous carts and a stellar UI via TailwindCSS and DaisyUI. Seamlessly deploy on Vercel, optimize page metadata, streamline Prisma requests with React cache, and set up essential developer tools for a smooth coding journey.âï¸ Code & Resources âï¸
Starting code: https://github.com/codinginflow/nextjs-ecommerce/tree/0-Starting-Point
tailwind.config.js: https://github.com/codinginflow/nextjs-ecommerce/blob/0-Starting-Point/tailwind.config.js
Favicon: https://github.com/codinginflow/nextjs-ecommerce/blob/0-Starting-Point/src/app/favicon.ico
Opengraph-image: https://github.com/codinginflow/nextjs-ecommerce/blob/0-Starting-Point/src/app/opengraph-image.png
Image assets: https://github.com/codinginflow/nextjs-ecommerce/tree/0-Starting-Point/src/assets
MongoDB Atlas: https://www.mongodb.com/atlas/database
Add to cart button with SVG icon: https://github.com/codinginflow/nextjs-ecommerce/blob/7-Add-to-Cart-Button/src/app/products/%5Bid%5D/AddToCartButton.tsx
Footer: https://github.com/codinginflow/nextjs-ecommerce/blob/8-Navbar-Footer/src/app/Footer.tsx
Google Cloud Console: https://console.cloud.google.com/
Prisma schema with user accounts: https://github.com/codinginflow/nextjs-ecommerce/blob/10-User-Authentication/prisma/schema.prisma
UserMenuButton with SVG icon: https://github.com/codinginflow/nextjs-ecommerce/blob/10-User-Authentication/src/app/Navbar/UserMenuButton.tsx
PaginationBar: https://github.com/codinginflow/nextjs-ecommerce/blob/12-Pagination/src/components/PaginationBar.tsxâœï¸ Course created by @codinginflow
ð‘¿: https://twitter.com/codinginflow
â Get his full-stack NextJS with Express & TypeScript course: https://codinginflow.com/nextjs
💌 Join his newsletter for regular web dev tips: https://codinginflow.com/newsletterâï¸ Contents âï¸
âŒ¨ï¸ (0:00:00) Intro + prerequisites
âŒ¨ï¸ (0:08:48) Project setup
âŒ¨ï¸ (0:28:18) Prisma + MongoDB setup
âŒ¨ï¸ (0:45:42) Add product page (Server action in server component)
âŒ¨ï¸ (1:31:07) Products list page
âŒ¨ï¸ (2:00:11) Product details page (generateMetadata + React cache)
âŒ¨ï¸ (2:17:14) Add to cart button (Server action in client component)
âŒ¨ï¸ (3:01:01) Navbar + footer
âŒ¨ï¸ (3:26:38) Cart page
âŒ¨ï¸ (3:53:50) User login (Next-Auth)
âŒ¨ï¸ (4:33:37) Merging user cart with anonymous cart
âŒ¨ï¸ (5:01:26) Pagination
âŒ¨ï¸ (5:25:56) Search functionality
âŒ¨ï¸ (5:32:48) Prisma extension
âŒ¨ï¸ (5:46:42) Deployment + social preview🎉 Thanks to our Champion and Sponsor supporters:
👾 davthecoder
👾 jedi-or-sith
👾 å—å®®åƒå½±
👾 Agustín Kussrow
👾 Nattira Maneerat
👾 Heather Wcislo
👾 Serhiy Kalinets
👾 Justin Hual
👾 Otis Morgan
👾 Oscar Rahnama—
Learn to code for free and get a developer job: https://www.freecodecamp.org
Read hundreds of articles on programming: https://freecodecamp.org/news