How akshayysharma/covid19-tracker works
Main Components
• Frontend: This is a single-page React application.
• Entry Point: Represent the HTML shell in the public/index.html file.
• App Component: Display the high-level layout and routing, located in src/App.js.
• Components: Include Cards (for confirmed, recovered, deaths counts), Charts (line charts for global trend data), CountryPicker (for selecting a specific country), and Footer. These are all in the src/components folder.
• Styles: CSS Modules (e.g., App.module.css and component-specific CSS files) that style the individual components.
• API Integration:
• API Module: The src/api/index.js file handles fetching data from the external COVID-19 API (https://covid19.mathdro.id/api).
Relationships and Data Flow
• Start from Client Entry: The browser loads public/index.html which then loads the React application (referenced in src/index.js).
• UI Layout: The App component orchestrates and composes the individual UI components (Cards, Charts, CountryPicker, Footer).
• The App or relevant UI component (like Cards or Charts) sends a request to the API module.
• The API module retrieves data from the remote COVID‐19 API.
• The results are then passed back into the UI components to display updated information.
Important Architectural Patterns and Design Principles
• Modular Component Design: The application is neatly divided into separate, reusable components (each in its own directory with associated styling).
• Separation of Concerns: The codebase divides concerns between UI components and data fetching logic in the API module.
• Single Page Application (SPA): Although not explicitly using routing in the file tree, the structure supports an integrated interactive experience.
• Use of CSS Modules: Ensuring styles are scoped locally to components.
Incorporate Relevant Technologies
• React: The primary framework for building the UI.
• CSS Modules: For modular styling.
• JavaScript (with likely use of ES6+ features): Found in all source code.
• External API Service: https://covid19.mathdro.id/api providing the COVID-19 data.