{"repo":"hannidinh/lexi","free":true,"listed":false,"github":"https://github.com/hannidinh/lexi","clone":"git clone https://github.com/hannidinh/lexi.git","description":"Code With Antonio: Build and Deploy a Multi-Vendor E-Commerce Marketplace with Nextjs, React & Stripe Connect (2025)","language":"TypeScript","stars":12,"topics":["mongodb-atlas","multi-vendor-ecommerce","nextjs","payloadcms","react"],"license":null,"category":"ecommerce","readme_excerpt":"Lexi - Multi-Tenant E-Commerce Platform A comprehensive multi-tenant e-commerce platform where creators can set up their own storefronts, sell digital products, and get paid through Stripe Connect. Built with Next.js 15, Payload CMS, and modern web technologies. 🏗️ Multi-Tenant Architecture How It Works This platform uses a shared database with tenant isolation approach, not separate databases per tenant: Architecture Components ✅ Single Frontend + Single Backend + Single Database - One Next.js application serves all tenants - One PayloadCMS backend handles all data - One MongoDB database stores everything 🔒 Tenant Isolation Through Data Fields Instead of separate databases, each tenant-specific record includes a tenant field: 🎭 PayloadCMS Multi-Tenant Plugin The @payloadcms/plugin-multi-tenant plugin automatically: - Adds tenant fields to specified collections - Filters queries to show only current tenant's data - Handles access control based on user-tenant relationships 🌐 Subdomain Routing Middleware handles subdomain routing seamlessly: - creator1.yourdomain.com → Shows only Creator1's products - creator2.yourdomain.com → Shows only Creator2's products - Same codebase, different data context! Data Filtering Process When someone visits john.yourdomain.com : 1. Middleware extracts \"john\" from subdomain 2. Database Query finds tenant where slug = \"john\" 3. PayloadCMS Plugin automatically filters all queries: User-Tenant Relationships Users can be associated with multiple ","default_branch":null,"files":null,"tree":[],"storefront":"/r/hannidinh","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/hannidinh/lexi/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}