Skip to content

A full-stack multi-vendor e-commerce marketplace built with Next.js 15, featuring seller storefronts, Stripe payments, admin controls, real-time order tracking, and role-based access.

Notifications You must be signed in to change notification settings

kpcode11/GoCart

Repository files navigation

GoCart

A full-stack multi-vendor e-commerce marketplace built with Next.js 15, where sellers can open stores, list products, and accept orders — while admins oversee the platform.


Features

Shoppers

  • Browse products by category or keyword search
  • Add to cart and save for later
  • Apply discount coupons (public, new-user, or member-exclusive)
  • Checkout with Stripe (online) or Cash on Delivery
  • Save multiple delivery addresses
  • Track order status in real time
  • Leave ratings & reviews on purchased products

Sellers

  • Apply to open a store with a custom username and branding
  • Manage product listings (add, edit, toggle stock)
  • Upload product images via ImageKit
  • View store orders and revenue with an analytics chart
  • Manage store profile and settings

Admins

  • Approve or reject store applications
  • Toggle store active/inactive status
  • Create and manage discount coupons
  • Platform-wide dashboard overview

Tech Stack

Layer Technology
Framework Next.js 15 (App Router, Turbopack)
Auth Clerk
Database Neon (Serverless PostgreSQL)
ORM Prisma
Payments Stripe
Image Hosting ImageKit
Background Jobs Inngest
State Management Redux Toolkit
Charts Recharts
Styling Tailwind CSS v4

Data Models

User ──< Rating
User ──< Address
User ──1 Store ──< Product
                  Store ──< Order ──< OrderItem
Coupon (standalone)
  • User – synced from Clerk via Inngest webhooks
  • Store – seller's shop, requires admin approval (pendingapproved)
  • Product – belongs to a store, supports multiple images
  • Order – statuses: ORDER_PLACEDPROCESSINGSHIPPEDDELIVERED
  • Coupon – supports forNewUser, forMember, and isPublic flags

Getting Started

Prerequisites

1. Clone & Install

git clone https://github.com/your-username/gocart.git
cd gocart
npm install

2. Configure Environment Variables

Create a .env file in the root and fill in the following:

# Database (Neon)
DATABASE_URL=""
DIRECT_URL=""

# Clerk
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=""
CLERK_SECRET_KEY=""
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up

# Admin (comma-separated emails)
ADMIN_EMAIL=""

# Stripe
STRIPE_SECRET_KEY=""
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=""
STRIPE_WEBHOOK_SECRET=""

# ImageKit
IMAGEKIT_PUBLIC_KEY=""
IMAGEKIT_PRIVATE_KEY=""
IMAGEKIT_URL_ENDPOINT=""

# Inngest
INNGEST_EVENT_KEY=""
INNGEST_SIGNING_KEY=""

3. Set Up the Database

npx prisma migrate dev

4. Run the Development Server

npm run dev

Open http://localhost:3000 in your browser.

For background jobs, run the Inngest dev server in a separate terminal:

npx inngest-cli@latest dev

Project Structure

gocart/
├── app/
│   ├── (public)/          # Shopper-facing pages (home, shop, cart, orders…)
│   ├── store/             # Seller dashboard pages
│   ├── admin/             # Admin panel pages
│   └── api/               # Next.js API route handlers
├── components/            # Shared UI components
├── inngest/               # Background job functions (Clerk webhook sync)
├── lib/                   # Prisma client, Redux store
├── middlewares/           # authAdmin, authSeller helpers
├── prisma/                # Prisma schema
└── configs/               # ImageKit config

Role-Based Access

Role How it's determined
Shopper Any signed-in Clerk user
Seller User has an approved store in the database
Admin User's email is listed in ADMIN_EMAIL env variable

Access to /store and /admin routes is protected by server-side middleware (authSeller.js / authAdmin.js). Navigation links in the Navbar appear automatically based on the user's role.


Scripts

Command Description
npm run dev Start dev server with Turbopack
npm run build Generate Prisma client + build Next.js
npm run start Start production server
npm run lint Run ESLint

License

This project is private and not licensed for public distribution.

About

A full-stack multi-vendor e-commerce marketplace built with Next.js 15, featuring seller storefronts, Stripe payments, admin controls, real-time order tracking, and role-based access.

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages