๐ Analytics โ
The admin dashboard provides real-time statistics and date-range analytics for restaurant operations.

๐ Dashboard Stats โ
The stats endpoint returns current overview numbers:
GET /api/dashboard/stats
Authorization: Bearer <staff-token>Returns:
| Metric | Description |
|---|---|
| ๐ฆ Total orders | All-time order count |
| ๐ฐ Total revenue | Sum of completed order totals |
| ๐ฅ Total customers | Registered customer count |
| โณ Pending orders | Orders awaiting confirmation |
| ๐ Today's orders | Orders placed today |
| ๐ต Today's revenue | Revenue from today's orders |
๐ Analytics โ
The analytics endpoint returns time-series data for charts:
GET /api/dashboard/analytics?startDate=2025-01-01&endDate=2025-01-31
Authorization: Bearer <staff-token>Query parameters:
| Parameter | Description |
|---|---|
startDate | ๐ Start of date range (ISO date) |
endDate | ๐ End of date range (ISO date) |
Returns daily aggregated data including orders, revenue, and new customers.
๐ Admin Dashboard Charts โ
The admin frontend uses Recharts to render:
- ๐ Revenue over time (line chart)
- ๐ Orders over time (bar chart)
- ๐ฅง Order status distribution (pie chart)
๐ Access โ
Analytics endpoints require staff authentication. All staff roles (STAFF, MANAGER, SUPER_ADMIN) can view dashboard stats and analytics.
๐ก API โ
See Dashboard API for the complete endpoint reference.