Build Full-ECommerce Website By Next.js, Drizzle, PostgreSQL ORM and Shadcn
|
|
Tech |
Next.js, PostgreSQL, Drizzle Orm, Shadcn, PayPal, Stripe |
UI |
Tailwind, Shadcn, recharts |
Database |
PostgreSQL, Drizzle Orm |
Payment |
PayPal, Stripe |
Deployment |
Github, Vercel |
Authentication |
Auth.js, Google Auth, Magic Link |
Others |
uploadthing, resend, zod |
![next postgresql amazona](https://github.com/basir/next-pg-shadcn-ecommerce/raw/main/public/assets/images/app.jpg)
Watch Video Tutorial
![next postgresql amazona](http://img.youtube.com/vi/M4DrCi8EuYE/0.jpg)
View Demo Website
https://next-pg-shadcn-ecommerce.vercel.app
What you will learn
- creating e-commerce website pages by next.js server components
- designing header, footer, sidebar, menu and search box by shadcn and tailwind
- quick view products in modals using nextjs parallel routes with intercepting routes
- create database models by drizzle orm and postgres database
- handling form inputs by react-hook-forms and zod data validator
- updating data by server actions without using any api
- managing shopping cart using http cookies on server side
- handling authentication and authorization by next-auth
- creating customer dashboard to update profile and track orders
- and implement a fully-functional admin dashboard with beautiful charts and handling products, orders and users
Run Locally
-
Clone repo
$ git clone git@github.com:basir/next-pg-shadcn-ecommerce.git
$ cd next-pg-shadcn-ecommerce
-
Create .env.local File
- duplicate .env.example and rename it to .env.local
-
Setup PostgreSQL
- Vercel PostgreSQL
- OR Local PostgreSQL
-
Install and Run
npm install
npm run dev
-
Seed Data
npx tsx ./db/seed
-
Admin Login
- Open http://localhost:3000
- Click Sign In button
- Enter admin email "admin@example.com" and password "123456" and click Sign In
Lessons
- Introduction
- Install tools
- Create next app
- create website layout
- list products
- setup drizzle orm and postgres database
- load products from database
- deploy on vercel
- create product details page
- implement authentication
- create new user
- implement add to cart
- create shopping cart page
- get shipping address
- select payment method
- place order
- create order details page
- pay order by PayPal
- create orders history page
- create user profile form
- create admin dashboard page
- list orders
- mark orders to paid and delivered
- list products
- edit products
- list users
- edit users
- add home page carousel and sidebar
- create search page
- rate and review products
- add dark and light theme
- pay order by Stripe
- email order receipt by Resend
- find shipping address on Google Map
- signin with magic link
- signin with google
Contact Developer
Email: basir.jafarzadeh@gmail.com