main
Co-authored-by: Cursor <cursoragent@cursor.com>
Marketplace API
NestJS API for the IranBay marketplace gate.
Architecture (Meshkee)
Two different Meshkee “business” concepts:
-
IranBay platform tenant (
iranbay.com) — auth only. Customer accounts from IranBay login/register are linked here viabusiness_customers. Not a Meshkee storefront. Bootstrap:npm run bootstrap:iranbay(needs Meshkee superadmin token). -
Producer shops — each shop that registers on IranBay becomes a separate Meshkee business + an IranBay marketplace listing (
POST /businesses/register-shop).
Marketplace DB stores only listing controls:
meshkee_business_id, slug, status, is_featured, sort_weight.
Name, categories, and profile content live in Meshkee.
Setup
cd backend
cp .env.example .env
docker compose up -d
npm install
npm run prisma:generate
npm run db:migrate
npm run start:dev
API: http://localhost:3001/api/v1
Required for shop self-register / Meshkee write-through:
MESHKEE_API_URL=https://api.meshkee.com/api/v1
MESHKEE_API_TOKEN= # Meshkee superadmin access token
Bootstrap platform tenant:
MESHKEE_API_TOKEN=… \
MESHKEE_SUPERADMIN_CELL=+98… \
MESHKEE_SUPERADMIN_PASSWORD=… \
npm run bootstrap:iranbay
Routes (v1)
| Method | Path | Notes |
|---|---|---|
GET |
/businesses |
Marketplace listings |
GET |
/businesses/:slug |
Listing by slug |
GET |
/businesses/by-id/:id |
Listing by id |
POST |
/businesses/register-shop |
Auth user → new Meshkee shop + IranBay listing |
POST |
/businesses |
Link existing Meshkee business (admin) |
PATCH |
/businesses/:id |
Marketplace fields; name/slug/category → Meshkee |
DELETE |
/businesses/:id |
Remove listing |
Languages
TypeScript
83.4%
JavaScript
7.9%
PLpgSQL
7.1%
Shell
1.6%