Skip to content

About

No description, website, or topics provided.

Resources

Contributing

Stars

6 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

36 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ NEXUS MULTI-VENDOR E-COMMERCE PLATFORM

High-Concurrency Marketplace Engine

GitHub Stars GitHub Forks Next.js 16 React 19 Tailwind CSS v4 Prisma Stripe Connect Lighthouse License


🌟 Star this repository if you find this architecture helpful for your next marketplace! 🌟

Overview β€’ Capabilities β€’ Architecture β€’ Escrow Pipeline β€’ Performance β€’ Tech Stack β€’ Quick Start β€’ Testing


πŸ’Ž Overview

Nexus is an open-source, full-stack multi-vendor marketplace platform built for extreme concurrency, sub-second delivery, and automated merchant settlements.

Engineered with Next.js 16 (App Router), React 19, Tailwind CSS v4, and Prisma ORM, Nexus unites a fast streaming storefront with a multi-tenant seller portal, admin moderation suite, automated Stripe Connect Escrow Splits, and background job processing via BullMQ and Redis.


πŸš€ Key Capabilities

Capability Legacy Marketplaces Nexus Platform ⚑
Interactivity (TBT) 300 – 900 ms click latency 0 ms Total Blocking Time (Ultra-responsive)
Visual Speed (LCP) 2.8 – 4.5s load time 968 ms (Sub-second Edge Streaming)
Initial JS Payload 800 – 1,500 KiB monolithic bundle 6.3 KiB (Zero unused script execution)
Vendor Settlement Manual month-end reconciliation Automated Multi-Vendor Stripe Escrow Splits
Modern Design Generic bootstrap templates Cinematic Glassmorphism, fluid motion & dark mode
Accessibility Inconsistent contrast & broken ARIA 100/100 WCAG 2.1 AA keyboard-navigable
Background Jobs Blocking synchronous HTTP tasks Distributed BullMQ Queues with Redis persistence

πŸ“Š Performance Benchmarks

Nexus maintains near-perfect scores across Google Lighthouse audits:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      GOOGLE LIGHTHOUSE 10.x AUDIT                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   PERFORMANCE    β”‚  ACCESSIBILITY   β”‚  BEST PRACTICES  β”‚      SEO      β”‚
β”‚     98 / 100     β”‚    100 / 100     β”‚     96 / 100     β”‚   100 / 100   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • ⚑ Sub-Second LCP (968 ms) – Instant initial paint powered by Next.js 16 Server Components
  • πŸ›‘ 0 ms Total Blocking Time (TBT) – Zero thread-blocking scripts or hydration bottlenecks
  • 🎯 0.0047 CLS – Layout-stable UI with strict dimensional containment
  • β™Ώ 100/100 Accessibility – High-contrast color tokens and comprehensive landmark navigation

πŸ—οΈ System Architecture

graph TD
    User["Web & Mobile Shoppers"] --> Storefront["Next.js 16 Storefront"]
    Admin["Merchants & Admins"] --> Dashboard["Enterprise Portal"]
    Storefront --> Gateway["API Routes & Edge Middleware"]
    Dashboard --> Gateway
    Gateway --> Services["Marketplace Core Services"]
    Services --> StripeEngine["Stripe Connect Escrow Engine"]
    Services --> WorkerQueue["BullMQ Background Workers"]
    Services --> Database["PostgreSQL 16 via Prisma ORM"]
    WorkerQueue --> Redis["Redis In-Memory Cache"]
Loading

πŸ’Έ Escrow Payment Pipeline

Nexus features an automated split payment workflow ensuring marketplace transparency, merchant trust, and dispute protection:

sequenceDiagram
    autonumber
    actor Customer as Customer
    participant Storefront as Storefront
    participant API as Order API
    participant Stripe as Stripe Connect
    participant Escrow as Escrow Vault
    actor VendorA as Vendor A
    actor VendorB as Vendor B
    participant Platform as Platform Fee

    Customer->>Storefront: Places Multi-Vendor Order ($110)
    Storefront->>API: POST /api/orders/checkout
    API->>Stripe: Create PaymentIntent
    Customer->>Stripe: Authorizes Payment
    Stripe-->>API: Webhook payment_intent.succeeded
    API->>Escrow: Lock Funds in Escrow
    Escrow->>Escrow: Calculate Splits & Deduct Platform Cut
    Note over Escrow: Fulfillment & Delivery Window
    Escrow->>VendorA: Transfer $63 (Vendor A Share)
    Escrow->>VendorB: Transfer $27 (Vendor B Share)
    Escrow->>Platform: Transfer $10 (Platform Take Rate)
    Escrow-->>API: Mark Order as Settled
Loading

πŸ› οΈ Tech Stack

Storefront & Client

  • Next.js 16.2.9 – App Router, Turbopack, Streaming Server Components, Metadata APIs
  • React 19.2.4 – Server Actions, useOptimistic, fine-grained hydration
  • Tailwind CSS v4 – Pure CSS variable theme tokens, GPU-accelerated utility primitives
  • Framer Motion 12 – Micro-interactions, layout transitions, and glassmorphic overlays
  • Zustand 5 – Zero-overhead client state container for shopping cart and user preferences

Backend & Infrastructure

  • PostgreSQL 16 – Multi-tenant schema, ACID transactional integrity, compound indexes
  • Prisma ORM 7.9 – Type-safe database queries, schema migrations, zero-downtime evolution
  • Stripe Connect & Webhooks – Custom merchant accounts, escrow holds, payout split routines
  • BullMQ 5.78 + Redis 7 – High-throughput background workers for email and webhook processing
  • AWS S3 SDK v3 – Presigned secure asset uploads and responsive image delivery
  • Sentry 10.58 – Distributed tracing, real-user monitoring, and error reporting

Security & Standards

  • JWT & HTTP-Only Refresh Cookies – 15-minute access tokens with auto-rotation
  • Zod 4.4 Runtime Contracts – Strict ingress/egress validation across every API route
  • Role-Based Access Control (RBAC) – Multi-tiered permissions (admin, seller, customer)
  • WCAG 2.1 AA & Section 508 – 4.5:1 minimum text contrast, ARIA dialog landmarks, keyboard skip links

⚑ Quick Start

1. Clone the Repository

git clone https://github.com/athil18/nexus-multi-vendor-ecommerce.git
cd nexus-multi-vendor-ecommerce

2. Configure Environment

cp .env.example .env

(Configure DATABASE_URL, JWT_SECRET, and STRIPE_SECRET_KEY in .env with your local values)

3. Install Dependencies

npm install

4. Setup Database & Seed Catalog

npm run db:generate
npm run db:migrate
npm run seed:run

5. Launch Development Server

npm run dev

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


πŸ§ͺ Testing Suite

Nexus includes a comprehensive test suite covering all layers:

# Unit & Component Tests
npm run test

# Backend Integration Tests (Database & API)
npm run test:backend

# End-to-End Playwright Tests (Full checkout & mobile viewports)
npm run test:e2e

# Production Build Verification
npm run build

πŸ“‚ Project Structure

nexus-multi-vendor-ecommerce/
β”œβ”€β”€ .github/                      # CI/CD Workflows & Automation
β”œβ”€β”€ docs/                         # Architecture guides & benchmark reports
β”œβ”€β”€ prisma/                       # PostgreSQL schema & migration history
β”œβ”€β”€ public/                       # Static assets & product SVG illustrations
β”œβ”€β”€ scripts/                      # Database backups, restore, and audits
β”œβ”€β”€ seeds/                        # Realistic demo catalog & merchant seeders
β”œβ”€β”€ src/                          # Application source code
β”‚   β”œβ”€β”€ app/                      # Next.js App Router (Storefront, Portals, API)
β”‚   β”œβ”€β”€ components/               # Modern UI components & Design tokens
β”‚   β”œβ”€β”€ core/                     # Domain ports & clean architecture interfaces
β”‚   β”œβ”€β”€ infrastructure/           # Prisma repositories & BullMQ queue provider
β”‚   β”œβ”€β”€ lib/                      # Auth, Stripe, Redis, Rate limiting, Logger
β”‚   β”œβ”€β”€ models/                   # Domain entities
β”‚   β”œβ”€β”€ services/                 # Business logic (Order, Payment, Auth, Store)
β”‚   └── store/                    # Zustand state management
β”œβ”€β”€ test/                         # Unit, component & integration tests
β”œβ”€β”€ e2e/                          # Playwright end-to-end test suite
β”œβ”€β”€ .dockerignore
β”œβ”€β”€ .env.example                  # Safe configuration template
β”œβ”€β”€ .gitignore                    # Git ignore rules
β”œβ”€β”€ docker-compose.yml            # Local PostgreSQL + Redis containers
β”œβ”€β”€ eslint.config.mjs
β”œβ”€β”€ LICENSE                       # MIT License
β”œβ”€β”€ next.config.ts
β”œβ”€β”€ package.json                  # Application dependencies & scripts
β”œβ”€β”€ playwright.config.ts
β”œβ”€β”€ postcss.config.mjs
β”œβ”€β”€ README.md                     # Project documentation
β”œβ”€β”€ tsconfig.json
└── vitest.config.ts

🀝 Contributing

Contributions are welcome! If you want to contribute:

  1. Fork the repository.
  2. Create a feature branch: git checkout -b feature/amazing-feature.
  3. Commit your changes: git commit -m "feat: add amazing feature".
  4. Push to the branch: git push origin feature/amazing-feature.
  5. Open a Pull Request.

🌟 Stargazers

If you find this repository valuable, please consider giving it a Star ⭐! It helps support ongoing open-source development.

Maintained by Mohamed Aathil R

Released under the MIT License.

About

No description, website, or topics provided.

Resources

Contributing

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages