This pull request implements a comprehensive security scan dashboard that displays historical scan metrics, overall contract health scores, and vulnerability trends over time for the Soroban Security Scanner.
- Built with Tailwind CSS for modern, responsive design
- Grid layout that adapts to different screen sizes
- Clean and professional UI with proper spacing and typography
- Weekly vulnerability breakdown chart showing trends over time
- Color-coded severity levels (Critical, High, Medium, Low)
- Interactive hover states showing detailed counts
- 8-week historical view with proper data aggregation
- Displays latest 10 scan results with status indicators
- Shows execution time in ms/s format
- Vulnerability count per scan
- Pass/Fail status with color-coded badges
- Timestamp formatting for easy readability
- Total vulnerability counts by severity level
- Overall scan metrics (total scans, pass rate, avg execution time)
- Accessible color scheme with proper contrast ratios
- Visual hierarchy with icons and proper spacing
- Filter metrics by timeframe (Last 7 Days, 30 Days, Year)
- Dropdown interface with calendar icon
- Integrated with state management for real-time updates
- Clean, accessible UI design
- Implemented with Zustand for efficient state management
- Cached dashboard data to reduce API calls
- Mock data generation for demonstration
- Loading states and error handling
- Critical: Red (#ef4444) - High contrast, WCAG compliant
- High: Orange (#f97316) - Clear distinction from critical
- Medium: Yellow (#eab308) - Good contrast with black text
- Low: Blue (#3b82f6) - Professional appearance
- All colors tested for accessibility compliance
frontend/
├── app/
│ ├── dashboard/
│ │ └── page.tsx # Main dashboard page
│ └── page.tsx # Updated home page with dashboard link
├── components/
│ └── dashboard/
│ ├── SummaryWidget.tsx # Vulnerability summary widget
│ ├── VulnerabilityTrendsChart.tsx # Weekly trends visualization
│ ├── RecentScansTable.tsx # Recent scans table
│ ├── DatePicker.tsx # Time filter component
│ └── index.ts # Component exports
└── store/
└── dashboardStore.ts # Zustand store for state management
- TypeScript interfaces for type safety
- Mock data generation for development
- Async data fetching with loading states
- Time filter management
- Responsive grid layout for severity counts
- Additional metrics display (total scans, pass rate, avg time)
- Color-coded severity indicators
- Custom bar chart implementation (no external chart library needed)
- Weekly data aggregation
- Responsive sizing and hover states
- Sortable by timestamp (newest first)
- Status badges with proper color coding
- Execution time formatting
- Responsive table design
- Navigate to
/dashboardto view the security dashboard - Use the date picker to filter data by timeframe
- View vulnerability trends in the weekly chart
- Monitor recent scan results in the table
- Check overall metrics in the summary widget
- All components are fully responsive
- Color schemes tested for accessibility
- Loading states implemented for better UX
- Error handling in place for data fetching
- Integration with real backend API
- Export functionality for reports
- Real-time updates with WebSocket
- Advanced filtering options
- Drill-down capabilities for detailed analysis
The dashboard provides:
- Overview: At-a-glance metrics and trends
- Detailed Analysis: Weekly vulnerability patterns
- Recent Activity: Latest scan results and status
- Time-based Filtering: Flexible date range selection
This implementation fully addresses the requirements in issue #7 and provides a solid foundation for security monitoring and analysis.