Skip to content

Repository files navigation

GoCart - Multi-Tenant E-commerce Platform

GoCart Logo

Multi-vendor e-commerce platform for the modern web
Shop, sell, and manage with ease. Built with Next.js, Prisma, Clerk, and more.


πŸ“‘ Quick Links


πŸ“‚ File & Data Flow Overview

flowchart TD
    APPLAYOUT["app/layout.jsx"]
    STOREPROVIDER["app/StoreProvider.js"]
    PUBLICLAYOUT["app/(public)/layout.jsx"]
    ADMINLAYOUT["app/admin/layout.jsx"]
    STORELAYOUT["app/store/layout.jsx"]
    PUBLICPAGES["app/(public)/*"]
    ADMINPAGES["app/admin/*"]
    STOREPAGES["app/store/*"]
    NAVBAR["components/Navbar.jsx"]
    FOOTER["components/Footer.jsx"]
    PRODUCTCARD["components/ProductCard.jsx"]
    ORDERITEM["components/OrderItem.jsx"]
    ADDRESSMODAL["components/AddressModal.jsx"]
    ADMINCOMP["components/admin/*"]
    STORECOMP["components/store/*"]
    STORE["lib/store.js"]
    CARTSLICE["lib/features/cart/cartSlice.js"]
    PRODUCTSLICE["lib/features/product/productSlice.js"]
    ADDRESSSLICE["lib/features/address/addressSlice.js"]
    RATINGS["lib/features/rating/ratingSlice.js"]
    CLERK["ClerkProvider"]
    MIDDLEWARE["middleware.ts"]
    PRISMA["lib/prisma.js"]
    SCHEMA["prisma/schema.prisma"]
    ASSETS["assets/assets.js"]
    APPLAYOUT --> CLERK
    CLERK --> STOREPROVIDER
    STOREPROVIDER --> STORE
    STORE --> CARTSLICE
    STORE --> PRODUCTSLICE
    STORE --> ADDRESSSLICE
    STORE --> RATINGS
    APPLAYOUT --> PUBLICLAYOUT
    APPLAYOUT --> ADMINLAYOUT
    APPLAYOUT --> STORELAYOUT
    PUBLICLAYOUT --> NAVBAR
    PUBLICLAYOUT --> FOOTER
    PUBLICLAYOUT --> PUBLICPAGES
    ADMINLAYOUT --> ADMINCOMP
    ADMINLAYOUT --> ADMINPAGES
    STORELAYOUT --> STORECOMP
    STORELAYOUT --> STOREPAGES
    PUBLICPAGES -->|"import/use"| PRODUCTCARD
    PUBLICPAGES -->|"import/use"| ORDERITEM
    PUBLICPAGES -->|"import/use"| ADDRESSMODAL
    ADMINPAGES -->|"import/use"| ADMINCOMP
    STOREPAGES -->|"import/use"| STORECOMP
    NAVBAR -->|"router.push"| PUBLICPAGES
    NAVBAR -->|"router.push"| PUBLICPAGES
    PUBLICPAGES -->|"useSelector"| CARTSLICE
    PUBLICPAGES -->|"useSelector"| PRODUCTSLICE
    PUBLICPAGES -->|"useSelector"| ADDRESSSLICE
    PUBLICPAGES -->|"useSelector"| RATINGS
    ADMINPAGES -->|"useSelector"| PRODUCTSLICE
    STOREPAGES -->|"useSelector"| PRODUCTSLICE
    STOREPAGES -->|"useSelector"| CARTSLICE
    STOREPAGES -->|"fetch"| ASSETS
    STOREPAGES -->|"fetch"| PRISMA
    ADMINPAGES -->|"fetch"| PRISMA
    MIDDLEWARE --> CLERK
    PRISMA --> SCHEMA
    STOREPROVIDER -->|"Provider"| PUBLICPAGES
    STOREPROVIDER -->|"Provider"| ADMINPAGES
    STOREPROVIDER -->|"Provider"| STOREPAGES
    PUBLICPAGES -->|"router.push"| PUBLICPAGES
    STOREPAGES -->|"router.push"| STOREPAGES
    ADMINPAGES -->|"router.push"| ADMINPAGES
Loading

Figure: Major file/module connections, Redux state, Clerk auth, and navigation/data flow. Arrows show imports, usage, and data/API flow between files.

Purpose and Scope

GoCart is a sophisticated multi-vendor e-commerce platform that enables customers to shop from multiple stores, store owners to manage their own products and orders, and admins to oversee the entire marketplace. The system provides three distinct user experiences:

  • Public Interface: Customer browsing, shopping cart management, and order placement
  • Store Owner Interface: Product management, inventory control, and order fulfillment
  • Admin Interface: Platform management, store approval, and system-wide analytics

The platform supports complex multi-vendor scenarios, including separate order processing per store, individual store ratings, coupon management, and comprehensive order tracking across different vendors.


πŸ› οΈ Technology Stack

GoCart leverages a modern, robust technology stack to deliver a seamless, scalable, and secure multi-vendor e-commerce experience. Each technology is carefully chosen for its strengths and role in the platform:

Layer Technology Version Purpose & Why We Use It
Framework Next.js 15.3.5 Full-stack React framework with App Router for SSR, routing, and API routes
Frontend React 19.0.0 Component-based UI library for building interactive interfaces
State Management Redux Toolkit 2.8.2 Predictable, scalable global state management
Authentication Clerk 6.32.0 Secure, modern authentication and user/session management
Database PostgreSQL - Reliable, scalable relational database
ORM Prisma - Type-safe database access and schema management
Styling Tailwind CSS 4.x Utility-first CSS for rapid, responsive, and consistent UI
Icons Lucide React 0.525.0 Modern, customizable icon library
Notifications React Hot Toast 2.5.2 Toast notifications for user feedback
Charts Recharts 3.1.2 Data visualization for analytics and dashboards
Date Handling Date-fns 4.1.0 Modern date utility functions

πŸ–ΌοΈ Screenshots & GIFs

Public Store Store Owner Dashboard Admin Panel

Want to showcase your store or feature? Submit your screenshots or GIFs via a pull request!


🎯 Purpose & Scope

GoCart is a next-generation, multi-vendor e-commerce platform designed for:

  • Customers:
    • Browse and search products across multiple stores
    • Manage shopping cart and place orders
    • Track orders and leave product/store reviews
  • Store Owners:
    • Create and manage their own store
    • Add, edit, and manage products and inventory
    • Fulfill and track orders, view analytics
  • Admins:
    • Approve and manage stores
    • Oversee platform-wide analytics and user management
    • Manage coupons, promotions, and platform settings

GoCart is built for scalability, modularity, and a seamless user experience, making it ideal for both small businesses and large marketplaces.


✨ Features

Feature Customer Store Owner Admin
Product Browsing & Search βœ… βœ… βœ…
Shopping Cart βœ… βœ… ❌
Order Placement & Tracking βœ… βœ… βœ…
Store Management ❌ βœ… βœ…
Product Management ❌ βœ… βœ…
Order Fulfillment ❌ βœ… βœ…
Analytics Dashboard ❌ βœ… βœ…
Reviews & Ratings βœ… βœ… βœ…
Coupon Management ❌ ❌ βœ…
Store Approval ❌ ❌ βœ…
User Management ❌ ❌ βœ…
Responsive Design βœ… βœ… βœ…

πŸ—οΈ Architecture

GoCart is architected for modularity and scalability, with clear separation between public, store owner, and admin interfaces. Centralized state management and a robust database schema ensure data consistency and performance.

High-Level System Architecture

flowchart TB
    subgraph Frontend
        Public["Public Interface"]
        StoreOwner["Store Owner Interface"]
        Admin["Admin Interface"]
    end
    subgraph Backend
        Redux["Redux Store"]
        Prisma["Prisma ORM"]
        DB["PostgreSQL DB"]
        Clerk["Clerk Auth"]
    end
    Public --> Redux
    StoreOwner --> Redux
    Admin --> Redux
    Redux --> Prisma
    Prisma --> DB
    Public -.-> Clerk
    StoreOwner -.-> Clerk
    Admin -.-> Clerk
    Clerk --> Redux
Loading

Figure: Modular interfaces, centralized state, and authentication flow.

User Flow Diagram

flowchart TD
    Visitor["Visitor"] -->|"Sign Up / Sign In"| Clerk["Clerk Auth"]
    Clerk -->|"Authenticated"| Customer["Customer"]
    Clerk -->|"Authenticated as Store Owner"| StoreOwner["Store Owner"]
    Clerk -->|"Authenticated as Admin"| Admin["Admin"]
    Customer -->|"Browse, Shop, Order"| PublicUI["Public Interface"]
    StoreOwner -->|"Manage Store, Products, Orders"| StoreUI["Store Owner Interface"]
    Admin -->|"Approve Stores, Manage Platform"| AdminUI["Admin Interface"]
Loading

Figure: User authentication and interface access flow.


πŸ” How It Works

1. Customer Checkout Flow

A customer browses products, adds items to the cart, and completes checkout with address and payment selection.

sequenceDiagram
    participant C as Customer
    participant UI as Public UI
    participant Redux as Redux Store
    participant API as API/Server Actions
    participant DB as Database
    C->>UI: Browse products
    UI->>Redux: Fetch product list
    Redux->>API: GET /api/products
    API->>DB: Query products
    DB-->>API: Products data
    API-->>Redux: Products data
    Redux-->>UI: Show products
    C->>UI: Add to cart
    UI->>Redux: Update cart state
    C->>UI: Checkout
    UI->>Redux: Collect address/payment
    Redux->>API: POST /api/orders
    API->>DB: Create order
    DB-->>API: Order confirmation
    API-->>Redux: Order confirmation
    Redux-->>UI: Show order success
Loading

2. Store Approval (Admin)

A new store is created by a user and must be approved by an admin before going live.

sequenceDiagram
    participant U as User
    participant UI as Store Owner UI
    participant API as API/Server Actions
    participant DB as Database
    participant Admin as Admin UI
    U->>UI: Create store
    UI->>API: POST /api/stores
    API->>DB: Save store (pending)
    Admin->>Admin: Review pending stores
    Admin->>API: POST /api/admin/approve
    API->>DB: Update store status (active)
    Admin-->>UI: Store approved
Loading

3. Admin Analytics Flow

Admin views platform-wide analytics, including sales, orders, and store performance.

sequenceDiagram
    participant Admin as Admin
    participant AdminUI as Admin UI
    participant API as API/Server Actions
    participant DB as Database
    Admin->>AdminUI: Open dashboard
    AdminUI->>API: GET /api/analytics
    API->>DB: Aggregate sales/orders data
    DB-->>API: Analytics data
    API-->>AdminUI: Analytics data
    AdminUI-->>Admin: Show charts/metrics
Loading

πŸš€ Deployment Guide

Deploying to Vercel (Recommended)

  1. Fork or clone the repository to your GitHub account.
  2. Create a new project on Vercel.
  3. Connect your GitHub repo and import the GoCart project.
  4. Set environment variables in the Vercel dashboard:
    • DATABASE_URL (your PostgreSQL connection string)
    • DIRECT_URL (optional, for direct DB access)
    • NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY (from Clerk dashboard)
    • CLERK_SECRET_KEY (from Clerk dashboard)
    • Any other variables from .env.example
  5. Provision a PostgreSQL database (e.g., Neon, Supabase, Railway).
  6. Run database migrations:
    • You may need to run npx prisma migrate deploy in the Vercel dashboard or via a GitHub Action.
  7. Deploy! Vercel will build and deploy your app automatically.

Other Platforms

  • Netlify: Similar steps, but ensure Next.js SSR is supported (Netlify Edge Functions or similar).
  • Custom VPS:
    • Clone the repo, set up Node.js, install dependencies, configure environment, and use a process manager (e.g., PM2).

Tips

  • Always keep your environment variables secure.
  • Use a managed PostgreSQL service for reliability.
  • For production, set NODE_ENV=production.
  • Monitor logs and errors via your hosting provider’s dashboard.

Need help? Open an issue or discussion on GitHub!


πŸ‘€ User Role Access Flow

%% User role access and permissions
flowchart TB
    U[User] -->|Browse, Shop| Public[Public Interface]
    U -->|Owns Store| StoreOwner[Store Owner Interface]
    U -->|Is Admin| Admin[Admin Interface]
    StoreOwner -->|Manages| Store[Store]
    Store -->|Sells| Product[Product]
    Public -->|Places| Order[Order]
    Admin -->|Approves| Store
    Admin -->|Manages| Coupon[Coupon]
    Admin -->|Views| Analytics[Analytics]
Loading

Figure: User role flow and permissions across the platform.


πŸ—„οΈ Detailed Data Model (Entity Relationship)

erDiagram
    USER ||--o{ RATING : writes
    USER ||--o{ ADDRESS : has
    USER ||--o| STORE : owns
    USER ||--o{ ORDER : places
    STORE ||--o{ PRODUCT : sells
    STORE ||--o{ ORDER : receives
    PRODUCT ||--o{ RATING : receives
    PRODUCT ||--o{ ORDERITEM : included_in
    ORDER ||--o{ ORDERITEM : contains
    ORDER ||--|| ADDRESS : ships_to
    ADDRESS }o--|| USER : belongs_to
    STORE ||--o{ COUPON : offers
    ORDER ||--o| COUPON : uses
Loading

Figure: Entity relationship diagram for users, stores, products, orders, and coupons.


πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • PostgreSQL database
  • Clerk account for authentication

Installation

  1. Clone the repository

    git clone https://github.com/bloodwraith8851/gocart.git
    cd gocart
  2. Install dependencies

    npm install
  3. Set up environment variables

    cp .env.example .env.local

    Configure your database URL, Clerk keys, and other environment variables.

  4. Set up the database

    npx prisma migrate dev
    npx prisma generate
  5. Run the development server

    npm run dev

Development Workflow

  1. Database Management

    • Use Prisma Studio: npx prisma studio
    • Reset database: npx prisma migrate reset
  2. State Management

    • Redux DevTools integration for debugging
    • Slice-based state organization
  3. Authentication

    • Clerk dashboard for user management
    • Middleware-based route protection

πŸ”§ Configuration

Environment Variables

DATABASE_URL="postgresql://..."
DIRECT_URL="postgresql://..."
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="pk_..."
CLERK_SECRET_KEY="sk_..."
NEXT_PUBLIC_CURRENCY_SYMBOL="$"

Database Configuration 22

πŸ“Š Data Models

Order Status Flow 23

Payment Methods 24

🎯 Features in Detail

Customer Experience

  • Browse products by categories
  • Advanced search functionality
  • Shopping cart with quantity management
  • Secure checkout process
  • Order tracking and history
  • Product reviews and ratings

Seller Dashboard

  • Store profile management
  • Product inventory control
  • Order fulfillment tracking
  • Sales analytics and reporting
  • Customer review management

Administrative Control

  • Store approval workflow
  • Platform-wide analytics
  • Coupon and promotion management
  • User account oversight
  • Revenue tracking

πŸ›‘οΈ Security Features

  • Authentication: Clerk-based secure authentication
  • Route Protection: Middleware-based access control
  • Data Validation: Prisma schema validation
  • SQL Injection Protection: Prisma ORM safety
  • CSRF Protection: Next.js built-in protection

πŸ“± Responsive Design

  • Mobile-first responsive design
  • Tailwind CSS utility classes
  • Flexible grid layouts
  • Touch-friendly interfaces
  • Progressive Web App capabilities

πŸ”„ State Management Architecture

Redux Store Structure 25

The application uses Redux Toolkit for predictable state management with separate slices for different features, ensuring scalable and maintainable code architecture.

Notes

This README provides a comprehensive overview of the GoCart e-commerce platform based on the current codebase structure. The project demonstrates modern web development practices with a focus on scalability, maintainability, and user experience. The multi-tenant architecture allows for easy expansion and customization for different business needs.

The platform currently uses dummy data for development purposes but is structured to integrate with real APIs and services for production deployment. The modular component architecture and type-safe database schema make it suitable for enterprise-level e-commerce solutions.

Citations

File: app/layout.jsx (L1-7)

import { Outfit } from "next/font/google";
import { Toaster } from "react-hot-toast";
import StoreProvider from "@/app/StoreProvider";
import "./globals.css";
import { ClerkProvider } from "@clerk/nextjs";

const outfit = Outfit({ subsets: ["latin"], weight: ["400", "500", "600"] });

File: app/layout.jsx (L9-12)

export const metadata = {
    title: "GoCart. - Shop smarter",
    description: "GoCart. - Shop smarter",
};

File: app/layout.jsx (L16-26)

        <ClerkProvider>
            <html lang="en">
                <body className={`${outfit.className} antialiased`}>
                    <StoreProvider>
                        <Toaster />
                        {children}
                    </StoreProvider>
                </body>
            </html>
        </ClerkProvider>
    );

File: lib/store.js (L1-15)

import { configureStore } from '@reduxjs/toolkit'
import cartReducer from './features/cart/cartSlice'
import productReducer from './features/product/productSlice'
import addressReducer from './features/address/addressSlice'
import ratingReducer from './features/rating/ratingSlice'

export const makeStore = () => {
    return configureStore({
        reducer: {
            cart: cartReducer,
            product: productReducer,
            address: addressReducer,
            rating: ratingReducer,
        },
    })

File: prisma/schema.prisma (L1-10)

generator client {
    provider        = "prisma-client-js"
    previewFeatures = ["driverAdapters"]
}

datasource db {
    provider  = "postgresql"
    url       = env("DATABASE_URL")
    directUrl = env("DIRECT_URL")
}

File: prisma/schema.prisma (L13-25)

model User {
    id    String @id
    name  String
    email String
    image String
    cart  Json   @default("{}")

    // Relations
    ratings     Rating[]
    Address     Address[]
    store       Store?
    buyerOrders Order[]   @relation("BuyerRelation")
}

File: prisma/schema.prisma (L28-45)

model Product {
    id          String   @id @default(cuid())
    name        String
    description String
    mrp         Float
    price       Float
    images      String[]
    category    String
    inStock     Boolean  @default(true)
    storeId     String
    createdAt   DateTime @default(now())
    updatedAt   DateTime @updatedAt

    // Relations
    store      Store       @relation(fields: [storeId], references: [id], onDelete: Cascade)
    orderItems OrderItem[]
    rating     Rating[]
}

File: prisma/schema.prisma (L47-52)

enum OrderStatus {
    ORDER_PLACED
    PROCESSING
    SHIPPED
    DELIVERED
}

File: prisma/schema.prisma (L54-57)

enum PaymentMethod {
    COD
    STRIPE
}

File: prisma/schema.prisma (L60-79)

model Order {
    id            String        @id @default(cuid())
    total         Float
    status        OrderStatus   @default(ORDER_PLACED)
    userId        String
    storeId       String
    addressId     String
    isPaid        Boolean       @default(false)
    paymentMethod PaymentMethod
    createdAt     DateTime      @default(now())
    updatedAt     DateTime      @updatedAt
    isCouponUsed  Boolean       @default(false)
    coupon        Json          @default("{}")
    orderItems    OrderItem[]

    // Relations
    user    User    @relation("BuyerRelation", fields: [userId], references: [id])
    store   Store   @relation(fields: [storeId], references: [id])
    address Address @relation(fields: [addressId], references: [id])
}

File: prisma/schema.prisma (L145-162)

model Store {
    id          String   @id @default(cuid())
    userId      String   @unique
    name        String
    description String
    username    String   @unique
    address     String
    status      String   @default("pending")
    isActive    Boolean  @default(false)
    logo        String
    email       String
    contact     String
    createdAt   DateTime @default(now())
    updatedAt   DateTime @updatedAt

    Product Product[]
    Order   Order[]
    user    User      @relation(fields: [userId], references: [id])

File: middleware.ts (L1-12)

import { clerkMiddleware } from '@clerk/nextjs/server';

export default clerkMiddleware();

export const config = {
  matcher: [
    // Skip Next.js internals and all static files, unless found in search params
    '/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)',
    // Always run for API routes
    '/(api|trpc)(.*)',
  ],
};

File: app/(public)/layout.jsx (L6-16)

export default function PublicLayout({ children }) {

    return (
        <>
            <Banner />
            <Navbar />
            {children}
            <Footer />
        </>
    );
}

File: app/(public)/page.jsx (L8-18)

export default function Home() {
    return (
        <div>
            <Hero />
            <LatestProducts />
            <BestSelling />
            <OurSpecs />
            <Newsletter />
        </div>
    );
}

File: components/Navbar.jsx (L24-52)

    return (
        <nav className="relative bg-white">
            <div className="mx-6">
                <div className="flex items-center justify-between max-w-7xl mx-auto py-4  transition-all">

                    <Link href="/" className="relative text-4xl font-semibold text-slate-700">
                        <span className="text-green-600">go</span>cart<span className="text-green-600 text-5xl leading-0">.</span>
                        <p className="absolute text-xs font-semibold -top-1 -right-8 px-3 p-0.5 rounded-full flex items-center gap-2 text-white bg-green-500">
                            plus
                        </p>
                    </Link>

                    {/* Desktop Menu */}
                    <div className="hidden sm:flex items-center gap-4 lg:gap-8 text-slate-600">
                        <Link href="/">Home</Link>
                        <Link href="/shop">Shop</Link>
                        <Link href="/">About</Link>
                        <Link href="/">Contact</Link>

                        <form onSubmit={handleSearch} className="hidden xl:flex items-center w-xs text-sm gap-2 bg-slate-100 px-4 py-3 rounded-full">
                            <Search size={18} className="text-slate-600" />
                            <input className="w-full bg-transparent outline-none placeholder-slate-600" type="text" placeholder="Search products" value={search} onChange={(e) => setSearch(e.target.value)} required />
                        </form>

                        <Link href="/cart" className="relative flex items-center gap-2 text-slate-600">
                            <ShoppingCart size={18} />
                            Cart
                            <button className="absolute -top-1 left-3 text-[8px] text-white bg-slate-600 size-3.5 rounded-full">{cartCount}</button>
                        </Link>

File: app/store/page.jsx (L23-28)

    const dashboardCardsData = [
        { title: 'Total Products', value: dashboardData.totalProducts, icon: ShoppingBasketIcon },
        { title: 'Total Earnings', value: currency + dashboardData.totalEarnings, icon: CircleDollarSignIcon },
        { title: 'Total Orders', value: dashboardData.totalOrders, icon: TagsIcon },
        { title: 'Total Ratings', value: dashboardData.ratings.length, icon: StarIcon },
    ]

File: components/store/StoreLayout.jsx (L29-39)

    ) : isSeller ? (
        <div className="flex flex-col h-screen">
            <SellerNavbar />
            <div className="flex flex-1 items-start h-full overflow-y-scroll no-scrollbar">
                <SellerSidebar storeInfo={storeInfo} />
                <div className="flex-1 h-full p-5 lg:pl-12 lg:pt-12 overflow-y-scroll">
                    {children}
                </div>
            </div>
        </div>
    ) : (

File: app/admin/page.jsx (L21-26)

    const dashboardCardsData = [
        { title: 'Total Products', value: dashboardData.products, icon: ShoppingBasketIcon },
        { title: 'Total Revenue', value: currency + dashboardData.revenue, icon: CircleDollarSignIcon },
        { title: 'Total Orders', value: dashboardData.orders, icon: TagsIcon },
        { title: 'Total Stores', value: dashboardData.stores, icon: StoreIcon },
    ]

File: components/admin/AdminLayout.jsx (L26-34)

        <div className="flex flex-col h-screen">
            <AdminNavbar />
            <div className="flex flex-1 items-start h-full overflow-y-scroll no-scrollbar">
                <AdminSidebar />
                <div className="flex-1 h-full p-5 lg:pl-12 lg:pt-12 overflow-y-scroll">
                    {children}
                </div>
            </div>
        </div>

File: lib/features/cart/cartSlice.js (L3-15)

const cartSlice = createSlice({
    name: 'cart',
    initialState: {
        total: 0,
        cartItems: {},
    },
    reducers: {
        addToCart: (state, action) => {
            const { productId } = action.payload
            if (state.cartItems[productId]) {
                state.cartItems[productId]++
            } else {
                state.cartItems[productId] = 1

File: assets/assets.js (L31-31)

export const categories = ["Headphones", "Speakers", "Watch", "Earbuds", "Mouse", "Decoration"];

File: app/StoreProvider.js (L6-13)

export default function StoreProvider({ children }) {
  const storeRef = useRef(undefined)
  if (!storeRef.current) {
    // Create the store instance the first time this renders
    storeRef.current = makeStore()
  }

  return <Provider store={storeRef.current}>{children}</Provider>

πŸ“š API Reference

GoCart exposes a set of RESTful API endpoints and server actions for data access and management. Below are some example endpoints (expand as you add more):

Endpoint Method Description Request Body / Params Response Example
/api/products GET Get all products - [ { id, name, price, ...} ]
/api/products/:id GET Get product by ID id (URL param) { id, name, price, ... }
/api/orders POST Create a new order { cart, address, payment } { orderId, status, ... }
/api/orders/:id GET Get order details id (URL param) { orderId, items, ... }
/api/stores POST Create a new store { name, description, ... } { storeId, status, ... }
/api/admin/approve POST Approve a store (admin only) { storeId } { success: true }

For a full list of endpoints and server actions, see the /app/api/ directory and server action files.


πŸ—ΊοΈ Roadmap

  • RESTful API endpoints for all resources
  • Real payment gateway integration (Stripe, PayPal, etc.)
  • Storefront themes and customization
  • Advanced analytics and reporting
  • Mobile app (React Native)
  • Multi-language and localization support
  • More admin controls and moderation tools
  • Automated tests & CI/CD integration
  • Webhooks and third-party integrations
  • Performance and accessibility improvements

πŸ“ License & Credits

MIT License


πŸ“¬ Contact

We welcome feedback, questions, and collaboration!


⚑ Performance & Security Notes

Performance:

  • Uses Next.js Server-Side Rendering (SSR) for fast, SEO-friendly pages.
  • Centralized state management with Redux Toolkit for efficient UI updates.
  • Modular codebase and code-splitting for faster load times.
  • Supports caching strategies for API/data fetching (can be extended for production).

Security:

  • Clerk authentication for secure user/session management.
  • Prisma ORM for type-safe, injection-resistant database access.
  • Middleware-based route protection for admin/store areas.
  • Data validation on both client and server.
  • Environment variables for sensitive config (never hard-coded).

Always keep dependencies up to date and monitor for security advisories!


πŸ“ Changelog

Version Date Changes
1.0.0 2025-09-16 Initial release: core features, multi-vendor
1.1.0 2025-09-18 Added admin dashboard, store approval
1.2.0 2025-09-20 Improved documentation, added diagrams
1.3.0 2025-09-22 Added deployment guide, FAQ, and roadmap

Contributors: Please update the changelog with each significant PR!


🌟 Showcase / Used By

Project/Company Description Link
Your Project Here! Example: Electronics marketplace Demo

Are you using GoCart in production? Add your site here via a pull request!


🌐 Internationalization (i18n)

GoCart is designed with future support for multiple languages in mind. To add or improve internationalization:

  • Recommended Libraries:
  • Translation Structure:
    • Store translation files (e.g., en.json, es.json) in a /locales directory
    • Use language keys in all UI components
    • Detect and switch languages based on user preference or browser settings
  • Contributing:
    • Want to add a new language? Fork the repo and submit your translation files via PR!

Help make GoCart accessible to users around the world!


About

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages