# tejppatel/novel-covid-tracker architecture

> Architecture diagram of the GitHub repository tejppatel/novel-covid-tracker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tejppatel/novel-covid-tracker
- Repository: https://github.com/tejppatel/novel-covid-tracker

## Overview

##### Project type and purpose
- This is an Ionic + Angular mobile (and PWA) application called “Novel-Covid-Tracker.”
- Its sole responsibility is to fetch and display COVID-19 statistics worldwide—by country, state, district—and render charts, maps, FAQs, news, and prevention guidelines.
- There is no custom backend in the repo; the app relies entirely on external REST APIs and local geo-assets.

##### File structure
- Top-level config files: angular.json, ionic.config.json, tsconfig*.json, package.json, etc.
- src/app contains Angular modules and lazy-loaded pages (about, faqs, prevention, world-statics, country-statics, state-details, district-details, tabs & tab1/tab2/tab3, pie-chart, mapdata.ts, and shared components like news, countries-summary-card, state-summary-card, district-summary-card).
- Each page folder consists of routing, module, .ts, .html, .scss, and unit test files.
- Shared services (e.g., worldstatics.service.ts, country-summary.service.ts, statewise.service.ts, districtwise.service.ts, news.service.ts) encapsulate HTTP calls to external APIs.
- No server-side code; this is purely a client application.

##### Essential architectural elements to capture
- Ionic Platform layer (tabs & navigation)
- Angular routing & lazy modules (e.g., country-details.module.ts loaded on demand)
- Shared services as singletons injected across pages
- External REST endpoints (base URLs configured per environment.ts)
- Local geo-assets consumption for map rendering
- Data flow direction (UI → Service → External → Service → UI)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Ionic-Angular Client
    subgraph "Ionic-Angular Client"
        subgraph "Presentation Layer (Pages & Components)"
            A1["Tabs Navigation"]:::frontend
            A2["About Page"]:::frontend
            A3["FAQs Page"]:::frontend
            A4["Prevention Page"]:::frontend
            A5["World Stats Page"]:::frontend
            A6["Country Stats Page"]:::frontend
            A7["State Details Page"]:::frontend
            A8["District Details Page"]:::frontend
            A9["Pie-Chart Component"]:::frontend
            A10["MapData Loader"]:::frontend
            A11["News Card Component"]:::frontend
            A12["Country Summary Card"]:::frontend
            A13["State Summary Card"]:::frontend
            A14["District Summary Card"]:::frontend
            A15["Explore Container"]:::frontend
        end
        subgraph "Services Layer"
            S1["World Statistics Service"]:::service
            S2["Country Statistics Service"]:::service
            S3["Statewise Data Service"]:::service
            S4["Districtwise Data Service"]:::service
            S5["News API Service"]:::service
            S6["Tab1 Data Service"]:::service
            S7["Tab2 Data Service"]:::service
        end
        subgraph "Assets & Config"
            D1["GeoJSON Asset"]:::asset
            D2["Map-metadata Script"]:::asset
            D3["Environment Config"]:::asset
        end
    end

    %% External Systems
    E1["COVID-19 Data API"]:::external
    E2["News API"]:::external

    %% Data Flows
    A1 -->|"navigates/calls"| S6
    A1 -->|"navigates/calls"| S7
    A2 -->|"renders static"| D3
    A3 -->|"renders static"| D3
    A4 -->|"renders static"| D3
    A5 -->|"calls"| S1
    A6 -->|"calls"| S2
    A7 -->|"calls"| S3
    A8 -->|"calls"| S4
    A9 -->|"binds data from"| S1
    A10 -->|"loads"| D1 & D2
    A11 -->|"binds data from"| S5
    A12 -->|"binds data from"| S2
    A13 -->|"binds data from"| S3
    A14 -->|"binds data from"| S4
    A15 -->|"generic wrapper"| A2 & A3 & A4

    S1 -->|"REST API calls"| E1
    S2 -->|"REST API calls"| E1
    S3 -->|"REST API calls"| E1
    S4 -->|"REST API calls"| E1
    S5 -->|"REST API calls"| E2
    S6 -->|"REST API calls"| E1
    S7 -->|"REST API calls"| E1

    E1 -->|"JSON responses"| S1 & S2 & S3 & S4 & S6 & S7
    E2 -->|"JSON responses"| S5

    S1 -->|"data models"| A5 & A9
    S2 -->|"data models"| A6 & A12
    S3 -->|"data models"| A7 & A13
    S4 -->|"data models"| A8 & A14
    S5 -->|"data models"| A11
    S6 -->|"data models"| A1
    S7 -->|"data models"| A1

    D1 & D2 -->|"static assets"| A10

    D3 -->|"configures endpoints"| S1 & S2 & S3 & S4 & S5 & S6 & S7

    %% Click Events
    click A1 "https://github.com/tejppatel/novel-covid-tracker/tree/master/src/app/tabs"
    click A2 "https://github.com/tejppatel/novel-covid-tracker/tree/master/src/app/about"
    click A3 "https://github.com/tejppatel/novel-covid-tracker/tree/master/src/app/faqs"
    click A4 "https://github.com/tejppatel/novel-covid-tracker/tree/master/src/app/prevention"
    click A5 "https://github.com/tejppatel/novel-covid-tracker/tree/master/src/app/world-statics"
    click A6 "https://github.com/tejppatel/novel-covid-tracker/tree/master/src/app/country-statics"
    click A7 "https://github.com/tejppatel/novel-covid-tracker/tree/master/src/app/state-details"
    click A8 "https://github.com/tejppatel/novel-covid-tracker/tree/master/src/app/district-details"
    click A9 "https://github.com/tejppatel/novel-covid-tracker/tree/master/src/app/pie-chart"
    click A10 "https://github.com/tejppatel/novel-covid-tracker/blob/master/src/app/mapdata.ts"
    click A11 "https://github.com/tejppatel/novel-covid-tracker/tree/master/src/app/components/news"
    click A12 "https://github.com/tejppatel/novel-covid-tracker/tree/master/src/app/countriessummarycard"
    click A13 "https://github.com/tejppatel/novel-covid-tracker/tree/master/src/app/statesummarycard"
    click A14 "https://github.com/tejppatel/novel-covid-tracker/tree/master/src/app/districtsummarycard"
    click A15 "https://github.com/tejppatel/novel-covid-tracker/tree/master/src/app/explore-container"
    click S1 "https://github.com/tejppatel/novel-covid-tracker/blob/master/src/app/world-statics/worldstatics.service.ts"
    click S2 "https://github.com/tejppatel/novel-covid-tracker/blob/master/src/app/country-statics/countrystatics.service.ts"
    click S3 "https://github.com/tejppatel/novel-covid-tracker/blob/master/src/app/statesummarycard/statewise.service.ts"
    click S4 "https://github.com/tejppatel/novel-covid-tracker/blob/master/src/app/districtsummarycard/districtwise.service.ts"
    click S5 "https://github.com/tejppatel/novel-covid-tracker/blob/master/src/app/components/news/news.service.ts"
    click S6 "https://github.com/tejppatel/novel-covid-tracker/blob/master/src/app/tab1/tab1.service.ts"
    click S7 "https://github.com/tejppatel/novel-covid-tracker/blob/master/src/app/tab2/tab2.service.ts"
    click D1 "https://github.com/tejppatel/novel-covid-tracker/blob/master/src/assets/ug-all.geo.ts"
    click D2 "https://github.com/tejppatel/novel-covid-tracker/blob/master/src/assets/mapdata.js"
    click D3 "https://github.com/tejppatel/novel-covid-tracker/blob/master/src/environments/environment.ts"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366d6,stroke-width:1px
    classDef service fill:#DFF7DF,stroke:#28a745,stroke-width:1px
    classDef asset fill:#F0F0F0,stroke:#6a737d,stroke-width:1px
    classDef external fill:#FFF4D6,stroke:#d73a49,stroke-width:1px
```
