Dashboard home (Admin)
Executive summary
Section titled “Executive summary”The admin home at /dashboard shows KPIs, analytics charts, and operational widgets from the dashboard API. It is the default landing route after successful login.
Goals and non-goals
Section titled “Goals and non-goals”| Goals | Non-goals |
|---|---|
| Orient admins to business health at a glance | Replace detailed reporting or BI exports |
| Link to underlying modules (orders, products, subscriptions) | Document every analytics SQL or metric definition |
Current platform behavior
Section titled “Current platform behavior”- Loads overview + analytics endpoints.
- Performance KPIs (first row): Revenue and Orders use admin B2B orders (paid & completed). Vendors is the count of vendors the admin can manage (options list). Master catalog products counts catalog templates only (
items.store_idis null), not store- or vendor-scoped SKUs. - Network & vendors KPIs (second row): Stores and Warehouses come from the analytics summary for the current scope. Subscriptions is the count of open platform vendor membership subscriptions in scope. Expiring soon counts those subscriptions whose
ends_atfalls within the next N days (same N as in the API; shown on tiles and in copy). - Charts: Revenue-by-day and orders-by-weekday are aligned with admin orders for the selected period and scope where the API implements that.
- Sales & inventory row: First column is vendors with platform packages expiring soon (soonest first, capped by the API). Top stores and top vendors remain revenue-based snapshots for the period (retail order context unless the API notes otherwise).
Sequence: happy path
Section titled “Sequence: happy path”- Sign in → redirect to
/dashboard. - Review KPI rows and charts for the selected period and optional store/vendor scope.
- Use View all on the expiring-packages widget to open membership subscriptions when you need renewals workflow.
Security and operations
Section titled “Security and operations”- Data respects admin modules and optional store/vendor filters when selected—empty widgets may mean no permission or no data, not necessarily “zero business”.
- If KPIs look wrong, verify API health, date range, and scope before escalating.
Test scenarios (UAT / QA)
Section titled “Test scenarios (UAT / QA)”| ID | Scenario | Expected |
|---|---|---|
| DH1 | Home after login | KPI blocks render without error |
| DH2 | Store or vendor scope | Numbers limited to selected store or vendor’s stores |
| DH3 | API failure | User-visible error or empty state, not infinite spinner |
/dashboard— default home after sign-in.
What you see
Section titled “What you see”The home screen loads overview and analytics from the admin dashboard API and renders:
| Block | Content |
|---|---|
| Performance KPIs | Revenue, Orders (admin B2B, paid & completed), Vendors, Master catalog products (templates only). |
| Network & vendors KPIs | Stores, Warehouses, Subscriptions (open platform vendor plans), Expiring soon (ending within N days). |
| Profit chart | Revenue by day, total vs prior window, and a short summary (store / product / warehouse counts from analytics when present). |
| Activity | Orders by weekday (ActiveDayChart). |
| Expiring soon panel | Short summary of how many open platform subscriptions end within N days. |
| Sales & inventory | Vendors expiring soon table (vendor, package, end time), Top stores, Top vendors. |
Implementation: apps/admin-web/src/app/dashboard/page.tsx, services in admin-dashboard.api.ts (/admin/dashboard/overview and /admin/dashboard/analytics).
Period and scope (behavior vs UI)
Section titled “Period and scope (behavior vs UI)”The page keeps internal state for reporting period (for example “Last 30 days”) and optional tenant scope (all, or narrowed by store or vendor ID). The default is a ~30-day window and no store/vendor filter. Period and scope are controlled from the home page UI (page.tsx).
Errors
Section titled “Errors”If overview loading fails, an inline alert shows a short message (from the API error or a generic fallback).
Where to go next
Section titled “Where to go next”- Orders — full order list and detail.
- Catalog and products — catalog management.
- Admin panel overview — navigation map.