Actions
Bug #13
openCOVID-19 Tracker — Full Modernization (API Fix + UX + Refactor + Tests)
Status:
New
Priority:
Normal
Assignee:
-
Start date:
08/19/2026
Due date:
% Done:
0%
Estimated time:
Description
User Story¶
As a user of the COVID-19 statistics dashboard, I want to see accurate, live COVID-19 case data with proper loading/error feedback and a stable UI, so that I can monitor global and country-specific pandemic statistics without encountering blank pages or silent failures.
Scope¶
In Scope
-
P1 — Critical API fix: Replace the permanently dead
covidtracking.comAPI withdisease.sh; fix allcatchblocks thatreturn error(Error instances must never be passed as component props). -
P2 — UX error/loading states: Add
LoadingSpinner,ErrorBanner, and a top-levelErrorBoundaryfor clear failure feedback. -
P3 — Component refactor: Convert
App.jsto functional with three custom hooks (useCovid19Stats,useCountries,useDailyData) usingAbortControllercleanup. Fix mislabelled headings. - P4 — Dependency upgrade (isolated branch): React 16→18, MUI v4→v5, chart.js 2→4, axios 0.19→1.x, react-scripts 4→5.
- P5 — Testing + PropTypes: API unit tests, component tests, integration test, PropTypes on all components.
Out of Scope
- Backend API hosting, new chart types, internationalisation.
Acceptance Criteria¶
-
AC-01: Global case totals from
disease.shdisplay; line chart renders historical data without console errors. -
AC-02: No
catchblock returns an Error object; all returnnull; no runtimeTypeErrorfrom.map()on an Error. - AC-03: Loading spinner visible during fetches; error banner with retry displayed on failure.
-
AC-04:
ErrorBoundarycatches unexpected render errors without full-page crash. -
AC-05:
App.jsxis functional; three custom hooks introduced; alluseEffectasync calls cancel on unmount. - AC-06: Heading shows "Country: {name}" when country selected, "Global" otherwise; default dropdown label is "Worldwide".
-
AC-07:
REACT_APP_API_URLenv variable drives base URL; no hardcoded domain. -
AC-08: Dependency upgrade branch passes
npm run buildwith zero errors. -
AC-09:
npm testpasses with ≥80% coverage forsrc/api/index.jsand all four components. - AC-10: All components declare PropTypes; no PropTypes console warnings.
Technical Notes¶
-
Dead API replaced:
covidtracking.com→disease.sh(global:/v3/covid-19/all, countries:/v3/covid-19/countries, historical:/v3/covid-19/historical/all?lastdays=120) -
StatsSnapshotshape preserved to minimise blast radius in child components. -
disease.shhistorical endpoint returns{cases: {date: N}}— adapter transforms to existingDailyEntry[]array format. -
All three custom hooks use
AbortController+ cancelled flag to prevent setState-on-unmount. -
encodeURIComponent(country)closes A03 injection pattern. - Critical path: T-01 → T-07/T-08/T-09 → T-10 → T-11/T-12/T-13 → T-22
- Parallel start: T-01, T-03, T-04, T-15 can all begin simultaneously.
Labels: ai-created, modernization, react, bug-fix, covid19-tracker
Labels: ai-created, modernization, react, bug-fix, covid19-tracker
No data to display
Actions