π Star this repository if you find this architecture helpful for your next marketplace! π
Overview β’ Capabilities β’ Architecture β’ Escrow Pipeline β’ Performance β’ Tech Stack β’ Quick Start β’ Testing
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.
| 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 |
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
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"]
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
- 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
- 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
- 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
git clone https://github.com/athil18/nexus-multi-vendor-ecommerce.git
cd nexus-multi-vendor-ecommercecp .env.example .env(Configure DATABASE_URL, JWT_SECRET, and STRIPE_SECRET_KEY in .env with your local values)
npm installnpm run db:generate
npm run db:migrate
npm run seed:runnpm run devOpen http://localhost:3000 in your browser.
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 buildnexus-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
Contributions are welcome! If you want to contribute:
- Fork the repository.
- Create a feature branch:
git checkout -b feature/amazing-feature. - Commit your changes:
git commit -m "feat: add amazing feature". - Push to the branch:
git push origin feature/amazing-feature. - Open a Pull Request.
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.