# r0b0tt/covid19-scraper architecture

> Architecture diagram of the GitHub repository r0b0tt/covid19-scraper, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/r0b0tt/covid19-scraper
- Repository: https://github.com/r0b0tt/covid19-scraper

## Overview

##### Web Scraping Layer
- 'spiders' directory which contains the web crawlers
- Currently shows who.py, likely scraping WHO (World Health Organization) data

##### API Service Layer
- Flask application (app.py)
- Services directory structure
- FAQs service module
- Use a hexagon or rectangle to represent the API endpoints

##### Infrastructure Components
- Docker container environment
- Gunicorn WSGI server (from bin/gunicorn.sh)
- Environment configuration (.env)

##### External Systems (Top Layer)
- Use cloud symbols or external system rectangles

##### Scraping Layer (Middle-Top Layer)
- Who.py spider module

##### Application Layer (Middle Layer)
- Services module structure
- FAQs service

##### Infrastructure Layer (Bottom Layer)
- Gunicorn WSGI server
- Configuration components

- External Systems: Light gray
- Scraping Components: Green
- API Services: Blue
- Infrastructure: Orange

Specific Elements to Include:
##### Environment configuration influence

Important Relationships to Highlight:
##### Infrastructure support for the application

- Data flow direction indicators
- Component type symbols
- Infrastructure boundaries
- External system indicators

Level of Detail:
- Keep the main components visible but don't drill down into individual code files
- Service architecture and data flow
- Separation between scraping and API serving
- Containerization boundary

Additional Notes:
- A note about the Python 3.7+ requirement
- HTTP port exposure (5000)
- REST API nature of the service

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph External
        WHO[WHO Website]:::external
    end

    subgraph Scraping
        Spider["Web Spider\n(who.py)"]:::scraper
    end

    subgraph Application
        Flask["Flask Application\n(app.py)"]:::app
        Services["Services Layer"]:::service
        FAQs["FAQs Service"]:::service
        FAQsData["FAQs Data\n(YAML)"]:::data
    end

    subgraph Infrastructure
        Docker["Docker Container"]:::infra
        Gunicorn["Gunicorn WSGI"]:::infra
        EnvConfig["Environment\nConfiguration"]:::infra
        Dependencies["Dependencies"]:::infra
    end

    WHO --> Spider
    Spider --> Flask
    Flask --> Services
    Services --> FAQs
    FAQs --> FAQsData
    EnvConfig --> Flask
    Flask --> Gunicorn
    Dependencies --> Flask
    Docker -.-> |contains| Flask
    Docker -.-> |contains| Gunicorn

    classDef external fill:#D3D3D3,stroke:#333
    classDef scraper fill:#90EE90,stroke:#333
    classDef app fill:#87CEEB,stroke:#333
    classDef service fill:#ADD8E6,stroke:#333
    classDef data fill:#FFE4B5,stroke:#333
    classDef infra fill:#FFA500,stroke:#333

    click Spider "https://github.com/r0b0tt/covid19-scraper/blob/master/spiders/who.py"
    click Flask "https://github.com/r0b0tt/covid19-scraper/blob/master/app.py"
    click FAQs "https://github.com/r0b0tt/covid19-scraper/blob/master/services/faqs/views.py"
    click Gunicorn "https://github.com/r0b0tt/covid19-scraper/blob/master/bin/gunicorn.sh"
    click Docker "https://github.com/r0b0tt/covid19-scraper/tree/master/Dockerfile"
    click EnvConfig "https://github.com/r0b0tt/covid19-scraper/blob/master/.env.example"
    click FAQsData "https://github.com/r0b0tt/covid19-scraper/blob/master/docs/faqs/all_faqs.yml"
    click Dependencies "https://github.com/r0b0tt/covid19-scraper/blob/master/requirements.txt"
```
