Overview
The PC Fix admin dashboard provides a powerful command center for managing the entire e-commerce operation. It features real-time business intelligence, interactive charts, automated alerts, and comprehensive CRUD operations for all platform entities.Dashboard Intelligence
Key Performance Indicators
The dashboard displays four critical KPIs that update in real-time:packages/api/src/modules/stats/stats.service.ts
Dashboard KPI Cards
Monthly Revenue
Gross revenue for current month from approved/shipped/delivered orders. Click to view detailed sales.
Low Stock Products
Count of products with ≤5 units in stock. Click to view filtered product list.
Pending Review
Orders awaiting payment verification by admin. Click to view pending orders.
Support Tickets
Unanswered technical support inquiries. Click to view support queue.
Interactive Charts
Sales Trend Chart (30 Days)
Area chart showing daily sales volume and revenue:packages/api/src/modules/stats/stats.service.ts
Top Products Chart
Bar chart displaying the 5 best-selling products in the last 30 days:packages/api/src/modules/stats/stats.service.ts
Dead Stock Management
Inactive Product Detection
The dashboard identifies products that haven’t sold in 90+ days:packages/web/src/components/admin/dashboard/DashboardIntelligence.tsx
Flash Sale Creation
Admins can instantly create discounts for slow-moving products directly from the dashboard:packages/web/src/components/admin/dashboard/DashboardIntelligence.tsx
Maintenance Mode
Site-Wide Control
Admins can toggle maintenance mode to temporarily disable the storefront:packages/web/src/components/admin/dashboard/DashboardIntelligence.tsx
packages/api/prisma/schema.prisma
Admin Pages
The admin panel includes dedicated pages for managing different aspects of the platform:Available Admin Pages
Dashboard
Main intelligence center with metrics and charts
Products
Product catalog management and inventory
Sales
Order management and payment verification
Categories
Product category hierarchy management
Brands
Brand management with logo uploads
Support
Technical support ticket management
Configuration
System settings and payment configurations
POS
Point of Sale for in-store transactions
Sales Management
Order Filtering
Admins can filter orders by various criteria:packages/api/src/modules/sales/sales.service.ts
Monthly Balance Report
Revenue breakdown by products vs. services:packages/api/src/modules/sales/sales.service.ts
Point of Sale (POS)
Manual Sale Creation
Admins can create in-store sales with custom pricing:packages/api/src/modules/sales/sales.service.ts
Dashboard Statistics
Basic Stats Endpoint
Quick overview statistics for the dashboard:packages/api/src/modules/stats/stats.service.ts
Access Control
Role-Based Authorization
Admin routes are protected by role verification:role: 'ADMIN' before granting access to admin endpoints.
Real-Time Features
Live KPIs
Dashboard metrics update on page load with current data
Click-Through Actions
KPI cards link directly to relevant filtered views
Chart Interactions
Charts are clickable to drill down into specific dates
Instant Discounts
Apply flash sales to dead stock products instantly
API Endpoints
Performance Optimizations
- Batch Queries: Dashboard statistics use
$transactionto fetch multiple metrics in parallel - Indexed Queries: Database indexes on
estado,fecha, anddeletedAtspeed up analytics - Lazy Loading: Charts load data asynchronously after initial page render
- Caching: Stats endpoint can be cached for faster subsequent loads