79 lines
2.5 KiB
Markdown
79 lines
2.5 KiB
Markdown
# Dashboard
|
|
|
|
Admin, customer, and business dashboards for IranBay — one Next.js app; the `Host` header picks the experience.
|
|
|
|
| Host | App |
|
|
|------|-----|
|
|
| `http://localhost:3002` (or `admin.<root>`) | Superadmin |
|
|
| `http://customer.localhost:3002` (or `customer.<root>`) | Customer account |
|
|
| `http://business.localhost:3002` (or `business.<root>`) | Business owner |
|
|
|
|
Public site stays on the main domain (`ariyaway.com` → `website/`).
|
|
|
|
## Auth model
|
|
|
|
- **One shared login** on the customer host (`/login`).
|
|
- After login, everyone lands in the **customer** dashboard. Superadmins and
|
|
business owners open admin/business from links there.
|
|
- If the user **owns a business**, customer UI shows a link to the business dashboard (session handoff across subdomains).
|
|
- Visiting `business.*/login` redirects to the customer login.
|
|
- Superadmin login stays on the admin host.
|
|
|
|
```bash
|
|
# 1) Meshkee API (port 3010 — website already uses 3000)
|
|
cd "../MeshkeeApp Backend"
|
|
docker compose up -d
|
|
PORT=3010 npm run start:dev
|
|
|
|
# 2) Dashboard
|
|
cd ../dashboard
|
|
cp .env.example .env.local
|
|
npm install
|
|
npm run dev
|
|
```
|
|
|
|
## Env
|
|
|
|
| Variable | Local example | Prod example |
|
|
|----------|---------------|--------------|
|
|
| `NEXT_PUBLIC_ROOT_DOMAIN` | `localhost` | `ariyaway.com` |
|
|
| `NEXT_PUBLIC_CUSTOMER_DASHBOARD_HOST` | `customer.localhost:3002` | `customer.ariyaway.com` |
|
|
| `NEXT_PUBLIC_BUSINESS_DASHBOARD_HOST` | `business.localhost:3002` | `business.ariyaway.com` |
|
|
| `NEXT_PUBLIC_ADMIN_DASHBOARD_HOST` | `localhost:3002` | `admin.ariyaway.com` |
|
|
| `NEXT_PUBLIC_MESHKEE_API_URL` | Meshkee API base | same |
|
|
| `NEXT_PUBLIC_MARKETPLACE_API_URL` | `http://localhost:3001/api/v1` | marketplace API |
|
|
|
|
Modern browsers resolve `*.localhost` without a hosts file.
|
|
|
|
Prod: DNS `customer.*`, `business.*` (and optionally `admin.*`) → same dashboard deploy; TLS for those hosts.
|
|
|
|
## Routes
|
|
|
|
### Superadmin (`localhost:3002`)
|
|
|
|
| Route | Purpose |
|
|
|-------|---------|
|
|
| `/login` | Super admin login |
|
|
| `/` | Admin home |
|
|
| `/businesses` | Marketplace listings |
|
|
|
|
### Customer (`customer.localhost:3002`)
|
|
|
|
| Route | Purpose |
|
|
|-------|---------|
|
|
| `/login` | Shared customer + business-owner login |
|
|
| `/` | Customer home |
|
|
| `/profile` | Account profile (read-only for now) |
|
|
|
|
### Business (`business.localhost:3002`)
|
|
|
|
Clean URLs (rewritten to `app/business/*`). Login redirects to customer host.
|
|
|
|
| Route | Purpose |
|
|
|-------|---------|
|
|
| `/profile` | Meshkee business profile |
|
|
| `/products` | Product list |
|
|
| `/blog` | Blog list |
|
|
| `/portfolios` | Portfolio list |
|
|
| `/gallery` | Gallery list |
|