Dashboard Features
The dashboard displays seven key statistics cards with a comprehensive chart visualization:Statistics Cards
Each statistic card shows:- Title: The metric name
- Count: Current total
- Icon: Visual identifier
- Link: Direct navigation to filtered view
- Color: Distinctive background color
Available Metrics
Socios
Count of members with full membership status. Click to view all members.
No Socios
Count of non-members or inactive memberships. Click to view all non-members.
Actividades
Total number of activities in the system. Click to view all activities.
Proyectos
Total number of projects. Click to view all projects.
Activos
Count of active projects currently in progress.
Pendientes
Count of pending projects awaiting action.
Trabajadores
Number of users with worker role.
Statistics Service
The backend provides statistics through a dedicated service:Performance Optimization
Single Query
Single Query
All statistics are fetched in a single aggregated SQL query for optimal performance.
Caching
Caching
Statistics are cached for 5 minutes to reduce database load:
Safe Parsing
Safe Parsing
All counts are safely parsed to integers with fallback to 0.
Loading Statistics
The frontend loads statistics on component mount:Chart Visualization
The dashboard includes an interactive chart powered by Chart.js:Chart Configuration
Dark Mode Support
The dashboard automatically adapts to dark mode:- Light Mode: Dark text (#666) and subtle grid lines
- Dark Mode: Light text (#e0e0e0) and lighter grid lines
Navigation
Quick Filters
Each statistic card links to a filtered view:Access Control
Dashboard statistics require authentication and proper role:monitor or admin roles can access statistics.
Animations
Statistic cards animate on load for visual appeal:Best Practices
Error Handling
Always handle API errors gracefully and show fallback UI
Loading States
Display loading indicators while fetching statistics
Responsive Design
Ensure dashboard works well on all screen sizes
Performance
Leverage caching and optimized queries for fast load times
