A production-ready, multi-tenant e-commerce platform with admin dashboard built with Next.js, TypeScript, and PostgreSQL.
This is a comprehensive SaaS e-commerce platform designed for scalability, multi-tenancy, and long-term maintainability. It includes:
- Storefront: Public-facing e-commerce site (SEO-friendly, SSR)
- Dashboard: Admin/seller dashboard for managing products, orders, and customers
- Multi-tenancy: Complete tenant isolation at the database and application level
- RBAC: Role-based access control with data-driven permissions
- Billing: Stripe integration with subscription plans and usage limits
This is a monorepo managed with Turborepo:
/apps
/storefront → Public e-commerce site
/dashboard → Admin / seller dashboard
/packages
/ui → Radix-wrapped UI components
/auth → Auth + tenant resolution
/billing → Stripe logic
/core → Domain models & utilities
- Frontend: Next.js 14 (App Router), React 18, TypeScript
- UI: Radix UI (wrapped), Tailwind CSS
- State: Zustand
- Backend: REST/Server Actions, PostgreSQL
- Payments: Stripe
- Monorepo: Turborepo
- Node.js >= 18.0.0
- npm >= 9.0.0
- PostgreSQL >= 14
npm installRun all apps in development mode:
npm run devOr run individual apps:
# Storefront (port 3000)
cd apps/storefront && npm run dev
# Dashboard (port 3001)
cd apps/dashboard && npm run devBuild all apps:
npm run buildnpm run type-checknpm run lint- COPILOT_INSTRUCTIONS.md - Base instructions for GitHub Copilot
- DATABASE_SCHEMA.md - PostgreSQL schema documentation
- ARCHITECTURE.md - Architecture decisions and patterns
- Complete tenant isolation at database level
- Server-side tenant resolution (never trust client)
- Subdomain-based tenant routing
- Product catalog with variants
- Inventory management
- Order processing and fulfillment
- Customer management
- Discount/coupon system
- Payment processing
- Product CRUD
- Inventory management
- Order management
- Payment tracking
- Fulfillment tracking
- Discount management
- User & role management
- Free, Starter, Professional, Enterprise tiers
- Usage-based limits (products, orders, users)
- Feature gates
- Stripe integration
- CSS variable-based theming
- Radix UI components (wrapped for consistency)
- Accessible by default
- Mobile-responsive
- TypeScript strict mode (no
any) - Composition over inheritance
- Small, focused functions
- JSDoc for public APIs
- Never place business logic in UI components
- Never use Radix components directly (use wrappers from
@ofroot/ui) - Every database operation must be tenant-scoped
- All mutations return typed results
- Errors must be structured
- Tenant isolation enforced server-side
- Row-level security on database
- Input validation (client + server)
- SQL injection prevention
- XSS protection
Proprietary - All rights reserved