EcomCloud — Multi-Tenant E-Commerce Platform
ecomcloud/
├── backend/ # NestJS API
├── frontend/ # Next.js 14 Dashboard
├── supabase-schema.sql
├── docker-compose.yml
└── .github/workflows/ci.yml
Create a project at https://supabase.com
Go to SQL Editor → New Query
Paste and run supabase-schema.sql
Copy your SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY from Project Settings → API
cd backend
cp .env.example .env
# Fill in your .env values
npm install
npm run start:dev
API runs on http://localhost:4000
Swagger docs at http://localhost:4000/api/docs
cd frontend
cp .env.example .env
# Fill in your .env values
npm install
npm run dev
Dashboard runs on http://localhost:3000
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env
# Fill in both .env files
docker-compose up --build
Variable
Description
SUPABASE_URL
Your Supabase project URL
SUPABASE_SERVICE_ROLE_KEY
Service role key (not anon key)
JWT_SECRET
Any long random string
STRIPE_SECRET_KEY
Stripe secret key (sk_test_...)
PORT
API port (default 4000)
FRONTEND_URL
Frontend URL for CORS
Variable
Description
NEXT_PUBLIC_API_URL
Backend URL (http://localhost:4000 )
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
Stripe publishable key (pk_test_...)
Method
Endpoint
Description
POST
/auth/register
Register user / store
POST
/auth/login
Login, get JWT
GET
/dashboard/overview
Stats overview
GET
/dashboard/revenue-chart
7-day revenue
GET
/dashboard/recent-orders
Last 10 orders
GET
/tenants
List tenants
GET
/tenants/:id/stats
Tenant stats
GET
/tenants/:id/products
List products
POST
/tenants/:id/products
Create product
PUT
/tenants/:id/products/:pid
Update product
DELETE
/tenants/:id/products/:pid
Delete product
GET
/tenants/:id/orders
List orders
POST
/tenants/:id/orders
Create order + Stripe intent
POST
/tenants/:id/orders/:oid/confirm
Confirm payment
PUT
/tenants/:id/orders/:oid/status
Update status
admin — sees all stores, all orders, all analytics
store_owner — sees only their own store's data