How moonlightedd/ecg-heartbeat-classification works
This is an educational ECG heartbeat-classification application: users can inspect reported model results or upload ECG rows for validation, prediction, and result review. The frontend also provides dashboard, waveform/class-distribution views, and project information; the Python backend exposes health and batch-prediction endpoints. The sampled frontend shows the analysis page calling its API client and CSV utilities. Backend implementation details were not excerpted, so the model-artifact connection is shown as unverified.
Main entry points: App.tsx App navigation · EcgAnalysis.tsx ECG analysis · ModelPerformance.tsx Model performance · constants.ts Classes and metrics
Components 18
Frontend app
- App navigation
src/App.tsx - Page layout
src/components/layout/Layout.tsx - Sidebar navigation
src/components/layout/Sidebar.tsx - Dashboard
src/pages/Dashboard.tsx - Project information
src/pages/About.tsx
ECG analysis
- ECG analysis
src/pages/EcgAnalysis.tsx - CSV validation
src/lib/csv.ts - Prediction API client
src/lib/api.ts - Waveform chart
src/components/charts/WaveformChart.tsx - Class distribution chart
src/components/charts/BarChart.tsx
Model evaluation
- Model performance
src/pages/ModelPerformance.tsx - Model comparison chart
src/components/charts/ComparisonChart.tsx - Confusion matrix
src/components/charts/ConfusionMatrix.tsx - Classes and metrics
src/lib/constants.ts - Shared domain types
src/lib/types.ts
Prediction backend
- Python prediction API
backend/main.py - Serialized classifier
backend/ecg_random_forest.pkl.gz
Other components
- User
Connections 20
- User → App navigation: uses
- App navigation → Sidebar navigation: renders
src/App.tsx - App navigation → Page layout: renders
src/App.tsx - App navigation → Dashboard: routes to
src/App.tsx - App navigation → ECG analysis: routes to
src/App.tsx - App navigation → Model performance: routes to
src/App.tsx - App navigation → Project information: routes to
src/App.tsx - ECG analysis → CSV validation: parses and exports
src/pages/EcgAnalysis.tsx - ECG analysis → Prediction API client: requests predictions
src/pages/EcgAnalysis.tsx - ECG analysis → Waveform chart: renders
src/pages/EcgAnalysis.tsx - ECG analysis → Class distribution chart: renders
src/pages/EcgAnalysis.tsx - Prediction API client → Python prediction API: calls
README.md - Python prediction API → Serialized classifier: loads classifier
- Model performance → Model comparison chart: renders
src/pages/ModelPerformance.tsx - Model performance → Confusion matrix: renders
src/pages/ModelPerformance.tsx - Model performance → Classes and metrics: reads metrics
src/pages/ModelPerformance.tsx - Confusion matrix → Classes and metrics: reads class labels
src/components/charts/ConfusionMatrix.tsx - Dashboard → Classes and metrics: reads model data
src/pages/Dashboard.tsx - ECG analysis → Classes and metrics: uses class definitions
src/pages/EcgAnalysis.tsx - ECG analysis → Shared domain types: uses domain types
src/pages/EcgAnalysis.tsx