← Back

Build an E-commerce Store

Create a full-stack e-commerce platform with product listings, shopping cart, and checkout functionality.

Sign in to track your progress

Step 1: Project Setup & Database Schema

Initialize your Next.js project and set up the database schema for products, users, and orders.

⏱️ 2-3 hours

🎥 Video Walkthrough

📝 Code

bash
npx create-next-app@latest ecommerce-store
cd ecommerce-store
npm install @prisma/client stripe @stripe/stripe-js
npx prisma init
prisma
model Product {
  id          String   @id @default(cuid())
  name        String
  description String
  price       Decimal  @db.Decimal(10, 2)
  imageUrl    String
  stock       Int
  category    String
  createdAt   DateTime @default(now())
}
💡 Hints (3 available)
Hint 1 (unlocks after 5min)

Make sure Node.js is installed (v18 or higher)

Hint 2 (unlocks after 10min)

Use npx to ensure latest create-next-app version

Hint 3 (unlocks after 15min)

Run "npx prisma generate" after creating schema

⚠️ Common Pitfalls:

  • Add DATABASE_URL to .env
  • Run prisma generate
  • Use Decimal for money

Step 2: Product Catalog Page

Build a responsive product grid.

⏱️ 3-4 hours

🎥 Video Walkthrough

📝 Code

typescript
const products = await prisma.product.findMany()
💡 Hints (2 available)
Hint 1 (unlocks after 5min)

Use async/await in server components

Hint 2 (unlocks after 10min)

Add loading.tsx for loading states

⚠️ Common Pitfalls:

  • Handle empty list
  • Add error boundaries

Step 3: Shopping Cart

Add cart functionality.

⏱️ 4-5 hours

🎥 Video Walkthrough

📝 Code

typescript
export const useCart = create((set) => ({ items: [] }))
💡 Hints (2 available)
Hint 1 (unlocks after 5min)

Consider using Zustand for state

Hint 2 (unlocks after 10min)

Persist to localStorage

⚠️ Common Pitfalls:

  • Validate cart on checkout
  • Handle quantity limits

Step 4: Stripe Integration

Set up payments.

⏱️ 5-6 hours

🎥 Video Walkthrough

📝 Code

typescript
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!)
💡 Hints (2 available)
Hint 1 (unlocks after 5min)

Get test keys from Stripe

Hint 2 (unlocks after 10min)

Never expose secret keys

⚠️ Common Pitfalls:

  • Use test cards
  • Handle webhooks

Step 5: Admin Dashboard

Manage orders.

⏱️ 6-7 hours

🎥 Video Walkthrough

📝 Code

typescript
const orders = await prisma.order.findMany()

⚠️ Common Pitfalls:

  • Add auth middleware
  • Role-based access

Step 6: Search & Filter

Add search.

⏱️ 3-4 hours

🎥 Video Walkthrough

📝 Code

typescript
where: { name: { contains: query } }

⚠️ Common Pitfalls:

  • Use URL params
  • Add debouncing

Step 7: Deploy to Vercel

Production deployment.

⏱️ 2-3 hours

🎥 Video Walkthrough

📝 Code

bash
vercel --prod

⚠️ Common Pitfalls:

  • Set environment variables
  • Configure CORS

Study Timer

🎯 Focus
25:00
Stay focused!
Total Study Time
0m
💡 Work: 25 min • Break: 5 min

🛠️ Technologies

Next.jsTypeScriptStripePostgreSQLTailwind CSS