# Component Relationship Diagram

```mermaid
graph TD
    subgraph "External"
        Client[HTTP Clients]
        GoogleMaps[Google Maps API]
        PG[(PostgreSQL)]
        FS[File System]
    end

    subgraph "SatelliteProvider"
        WebApi[WebApi<br/>Program.cs endpoints]
        Route[RouteManagement<br/>RouteService + RouteProcessingService]
        Region[RegionProcessing<br/>RegionService + Queue + Workers]
        Tile[TileDownloader<br/>GoogleMapsDownloaderV2 + TileService]
        DA[DataAccess<br/>Repositories + Migrations]
        Common[Common<br/>DTOs + Interfaces + Configs + GeoUtils]
    end

    Client -->|HTTP| WebApi
    WebApi --> Route
    WebApi --> Region
    WebApi --> Tile
    Route --> Region
    Route --> DA
    Region --> Tile
    Region --> DA
    Tile --> DA
    Tile -->|HTTPS| GoogleMaps
    Tile --> FS
    Region --> FS
    Route --> FS
    DA --> PG
    WebApi --> DA
    WebApi --> Common
    Route --> Common
    Region --> Common
    Tile --> Common
```

## Component Summary

| # | Component | Project | Responsibility |
|---|-----------|---------|---------------|
| 1 | Common | SatelliteProvider.Common | Shared DTOs, interfaces, configs, GeoUtils, common exceptions |
| 2 | DataAccess | SatelliteProvider.DataAccess | Database entities, Dapper repositories, DbUp migrations |
| 3 | TileDownloader | SatelliteProvider.Services.TileDownloader | Google Maps tile acquisition (GoogleMapsDownloaderV2), tile orchestration with caching (TileService) |
| 4 | RegionProcessing | SatelliteProvider.Services.RegionProcessing | Region request lifecycle (RegionService), in-process queue (RegionRequestQueue), background worker (RegionProcessingService) |
| 5 | RouteManagement | SatelliteProvider.Services.RouteManagement | Route creation + point interpolation + geofencing (RouteService), background worker (RouteProcessingService) |
| — | WebApi | SatelliteProvider.Api | HTTP endpoints, DI configuration, startup |

**Note**: the arrows `Region --> Tile` and `Route --> Region` in the diagram represent **logical** dependencies via interfaces (`ITileService`, `IRegionService`, `IRegionRequestQueue`) defined in `SatelliteProvider.Common`. There are NO compile-time `ProjectReference` entries between the three Layer-3 component csprojs — see `module-layout.md` § Allowed Dependencies.
