Skip to content

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

LayerTechnology
FrameworkNext.js 15 (App Router, Turbopack)
AuthClerk
DatabaseNeon (Serverless PostgreSQL)
ORMPrisma
PaymentsStripe
Image HostingImageKit
Background JobsInngest
State ManagementRedux Toolkit
ChartsRecharts
StylingTailwind 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=""# ClerkNEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=""CLERK_SECRET_KEY=""NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-inNEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up# Admin (comma-separated emails)ADMIN_EMAIL=""# StripeSTRIPE_SECRET_KEY=""NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=""STRIPE_WEBHOOK_SECRET=""# ImageKitIMAGEKIT_PUBLIC_KEY=""IMAGEKIT_PRIVATE_KEY=""IMAGEKIT_URL_ENDPOINT=""# InngestINNGEST_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

RoleHow it's determined
ShopperAny signed-in Clerk user
SellerUser has an approved store in the database
AdminUser'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

CommandDescription
npm run devStart dev server with Turbopack
npm run buildGenerate Prisma client + build Next.js
npm run startStart production server
npm run lintRun 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

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages