Skip to content

๐Ÿ“Š Analytics โ€‹

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

Admin Dashboard

๐Ÿ“ˆ Dashboard Stats โ€‹

The stats endpoint returns current overview numbers:

GET /api/dashboard/stats
Authorization: Bearer <staff-token>

Returns:

MetricDescription
๐Ÿ“ฆ Total ordersAll-time order count
๐Ÿ’ฐ Total revenueSum of completed order totals
๐Ÿ‘ฅ Total customersRegistered customer count
โณ Pending ordersOrders awaiting confirmation
๐Ÿ“… Today's ordersOrders placed today
๐Ÿ’ต Today's revenueRevenue 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:

ParameterDescription
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.