Jaipur Handloomia — self-hosted commerce platform (SOURCE)
==========================================================

YOUR SETUP (two subdomains under one domain):
  Storefront (the shop)            -> app.jaipurhandloomia.com
  Backend (API + admin dashboard)  -> api.jaipurhandloomia.com
Create api.jaipurhandloomia.com in cPanel > Subdomains (one click).

WHAT THIS IS
  platform/backend     Medusa commerce engine (store API + admin dashboard)
  platform/storefront  Next.js shop (what your customers see)
  deploy/              deployment runbook + env templates + packaging script
  data/                your 25 marketing agents' history (imported during setup)
  docs/platform/       full architecture & roadmap

IMPORTANT — please read
  A Node.js app does NOT run just by uploading files. After you extract this in
  cPanel File Manager, run a ONE-TIME setup in cPanel > Terminal
  (install -> migrate -> seed -> build -> start). The zip only carries the code.

  >>> Follow deploy/CPANEL-DEPLOY.md from top to bottom. <<<

REQUIREMENTS: Node.js 20+ ("Setup Node.js App") and PostgreSQL ("PostgreSQL Databases").

SHORT VERSION (full details + exact values in deploy/CPANEL-DEPLOY.md)
  1) cPanel > PostgreSQL Databases: create db + user (All Privileges).
  2) cPanel > Subdomains: ensure app. and api. subdomains exist.
  3) cPanel > Terminal:
       cd ~/<extracted-folder>/platform/backend
       cp .env.template .env     # set DATABASE_URL, secrets, and:
                                 #   STORE_CORS=https://app.jaipurhandloomia.com
                                 #   ADMIN_CORS=https://api.jaipurhandloomia.com
                                 #   AUTH_CORS=https://api.jaipurhandloomia.com,https://app.jaipurhandloomia.com
       npm install
       npx medusa db:migrate
       npx medusa exec ./src/scripts/import-agent-runs.ts
       npx medusa exec ./src/scripts/seed.ts        # prints your publishable key (pk_...)
       npx medusa user -e you@yourshop.com -p 'YourPassword'
       npm run build
  4) cPanel > Setup Node.js App: Application root = platform/backend/.medusa/server
       (run `npm install --omit=dev` inside it; start: npx medusa start); URL = api.jaipurhandloomia.com
  5) Storefront:
       cd ~/<extracted-folder>/platform/storefront
       cp .env.template .env.local   # set:
                                     #   MEDUSA_BACKEND_URL=https://api.jaipurhandloomia.com
                                     #   NEXT_PUBLIC_BASE_URL=https://app.jaipurhandloomia.com
                                     #   NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY=pk_...   (from step 3)
       npm install && npm run build
       Setup Node.js App: root = platform/storefront, start: npm run start; URL = app.jaipurhandloomia.com
  6) Run AutoSSL on both subdomains. Add Razorpay keys when ready (runbook section 8).

LATER, SWITCHING TO YOUR MAIN DOMAIN: update the CORS + the two storefront URLs and
rebuild the storefront (npm run build) — those URLs are baked in at build time. See the
"Your domains" section in deploy/CPANEL-DEPLOY.md.

Checkout works immediately with the built-in Manual/test method.
