Dashboard¶
Source: pharmanet-admin/src/pages/Dashboard/Dashboard.jsx
Overview¶
The dashboard provides a high-level view of platform metrics with real-time data.
KPIs¶
| Metric | Source |
|---|---|
| Total Users | dashboardService.getStats() |
| Total Sellers (Pharmacies) | dashboardService.getStats() |
| Total Products | dashboardService.getStats() |
| Pending Prescriptions | dashboardService.getStats() |
| Revenue Overview | dashboardService.getStats() |
Each KPI card shows: current value, trend arrow (up/down), and percentage change.
Charts¶
| Chart | Type | Data Source |
|---|---|---|
| Revenue Overview | AreaChart | Latest orders |
| Sales by Category | PieChart | Order items by category |
| Daily Sales Volume | BarChart | Order totals by day |
Components¶
| Component | File | Description |
|---|---|---|
StatsCards |
components/dashboard/StatsCards.jsx |
KPI metric grid |
RevenueChart |
components/dashboard/RevenueChart.jsx |
Revenue area chart |
SalesChart |
components/dashboard/SalesChart.jsx |
Daily sales bar chart |
QuickActions |
components/dashboard/QuickActions.jsx |
Common action shortcuts |
RecentActivity |
components/dashboard/RecentActivity.jsx |
Recent orders list |
Data Flow¶
// Dashboard.jsx
useEffect(() => {
dispatch(fetchDashboardStats());
dispatch(fetchDashboardOverview());
}, [dispatch]);
const { stats, overview, loading } = useSelector(state => state.dashboard);
Related¶
- Reports — Detailed reporting