# lwandinxumalo/retail-compare architecture

> Architecture diagram of the GitHub repository lwandinxumalo/retail-compare, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lwandinxumalo/retail-compare
- Repository: https://github.com/lwandinxumalo/retail-compare

## Overview

The README describes a retail price-tracking product: a scraper submits prices, the API ingests them and detects watchlist drops, and the mobile client browses prices and receives alerts. However, the sampled implementation is largely a MAUI and ASP.NET scaffold; the retail workflow and its integrations are documented, not verified in source. The graph separates those documented capabilities from the visible weather sample and startup wiring.

Main entry points: [`RetailCompare.App`](https://github.com/lwandinxumalo/retail-compare/tree/main/RetailCompare.App) (MAUI app), [`RetailCompare.API`](https://github.com/lwandinxumalo/retail-compare/tree/main/RetailCompare.API) (REST API), [`RetailCompare.App/App.xaml.cs`](https://github.com/lwandinxumalo/retail-compare/blob/main/RetailCompare.App/App.xaml.cs) (App entry), [`RetailCompare.API/Controllers/WeatherForecastController.cs`](https://github.com/lwandinxumalo/retail-compare/blob/main/RetailCompare.API/Controllers/WeatherForecastController.cs) (Weather endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile client"]
  node_mobile_app["MAUI app<br/>[RetailCompare.App]"]
  node_mobile_ui["App shell and UI<br/>[AppShell.xaml.cs]"]
  node_offline_cache[("Offline cache<br/>[RetailCompare.App]")]
  node_push_listener["Push listener<br/>[RetailCompare.App]"]
  node_shared_dtos["Shared DTOs"]
  node_app_entry["App entry<br/>[App.xaml.cs]"]
end

subgraph group_backend["Price API"]
  node_api["REST API<br/>[RetailCompare.API]"]
  node_ingestion["Batch ingestion<br/>[RetailCompare.API]"]
  node_price_engine["Drop detection<br/>[RetailCompare.API]"]
  node_watchlists[("User watchlists<br/>[RetailCompare.API]")]
end

subgraph group_integrations["External systems"]
  node_retail_db[("Price database")]
  node_fcm["Firebase messaging"]
end

subgraph group_sample["Scaffold sample"]
  node_weather_controller["Weather endpoint"]
  node_weather_model["Forecast model<br/>[WeatherForecast.cs]"]
  node_api_startup["API startup<br/>[Program.cs]"]
  node_maui_startup["MAUI startup<br/>[MauiProgram.cs]"]
end

node_user(("Mobile user"))
node_scraper(("Scraper agent"))

node_user -->|"uses"| node_mobile_app
node_mobile_app -->|"HTTP requests"| node_api
node_scraper -->|"submits batches"| node_ingestion
node_api -.->|"routes ingestion"| node_ingestion
node_ingestion -->|"writes prices"| node_retail_db
node_price_engine -->|"checks"| node_watchlists
node_price_engine -->|"sends drop alerts"| node_fcm
node_api -->|"reads and writes"| node_retail_db
node_mobile_app -->|"caches for offline use"| node_offline_cache
node_fcm -->|"delivers alerts"| node_push_listener
node_push_listener -->|"routes to drop screens"| node_mobile_ui
node_mobile_app -->|"uses DTOs"| node_shared_dtos
node_api -->|"uses DTOs"| node_shared_dtos
node_api_startup -->|"maps controllers"| node_weather_controller
node_weather_controller -->|"creates forecasts"| node_weather_model
node_maui_startup -->|"configures app"| node_app_entry
node_app_entry -.->|"opens shell"| node_mobile_ui

click node_mobile_app "https://github.com/lwandinxumalo/retail-compare/tree/main/RetailCompare.App"
click node_mobile_ui "https://github.com/lwandinxumalo/retail-compare/blob/main/RetailCompare.App/AppShell.xaml.cs"
click node_offline_cache "https://github.com/lwandinxumalo/retail-compare/tree/main/RetailCompare.App"
click node_push_listener "https://github.com/lwandinxumalo/retail-compare/tree/main/RetailCompare.App"
click node_shared_dtos "https://github.com/lwandinxumalo/retail-compare/tree/main/RetailCompare.Shared"
click node_api "https://github.com/lwandinxumalo/retail-compare/tree/main/RetailCompare.API"
click node_ingestion "https://github.com/lwandinxumalo/retail-compare/tree/main/RetailCompare.API"
click node_price_engine "https://github.com/lwandinxumalo/retail-compare/tree/main/RetailCompare.API"
click node_watchlists "https://github.com/lwandinxumalo/retail-compare/tree/main/RetailCompare.API"
click node_weather_controller "https://github.com/lwandinxumalo/retail-compare/blob/main/RetailCompare.API/Controllers/WeatherForecastController.cs"
click node_weather_model "https://github.com/lwandinxumalo/retail-compare/blob/main/RetailCompare.API/WeatherForecast.cs"
click node_api_startup "https://github.com/lwandinxumalo/retail-compare/blob/main/RetailCompare.API/Program.cs"
click node_maui_startup "https://github.com/lwandinxumalo/retail-compare/blob/main/RetailCompare.App/MauiProgram.cs"
click node_app_entry "https://github.com/lwandinxumalo/retail-compare/blob/main/RetailCompare.App/App.xaml.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mobile_app,node_mobile_ui,node_offline_cache,node_push_listener,node_shared_dtos,node_app_entry,node_user toneBlue
class node_api,node_ingestion,node_price_engine,node_watchlists toneAmber
class node_retail_db,node_fcm toneMint
class node_weather_controller,node_weather_model,node_api_startup,node_maui_startup toneRose
class node_scraper toneIndigo
```

## Components

### Mobile client

- [MAUI app](https://github.com/lwandinxumalo/retail-compare/tree/main/RetailCompare.App): `RetailCompare.App`
- [App shell and UI](https://github.com/lwandinxumalo/retail-compare/blob/main/RetailCompare.App/AppShell.xaml.cs): `RetailCompare.App/AppShell.xaml.cs`
- [Offline cache](https://github.com/lwandinxumalo/retail-compare/tree/main/RetailCompare.App): `RetailCompare.App`
- [Push listener](https://github.com/lwandinxumalo/retail-compare/tree/main/RetailCompare.App): `RetailCompare.App`
- [Shared DTOs](https://github.com/lwandinxumalo/retail-compare/tree/main/RetailCompare.Shared): `RetailCompare.Shared`
- [App entry](https://github.com/lwandinxumalo/retail-compare/blob/main/RetailCompare.App/App.xaml.cs): `RetailCompare.App/App.xaml.cs`

### Price API

- [REST API](https://github.com/lwandinxumalo/retail-compare/tree/main/RetailCompare.API): `RetailCompare.API`
- [Batch ingestion](https://github.com/lwandinxumalo/retail-compare/tree/main/RetailCompare.API): `RetailCompare.API`
- [Drop detection](https://github.com/lwandinxumalo/retail-compare/tree/main/RetailCompare.API): `RetailCompare.API`
- [User watchlists](https://github.com/lwandinxumalo/retail-compare/tree/main/RetailCompare.API): `RetailCompare.API`

### External systems

- **Price database**
- **Firebase messaging**

### Scaffold sample

- [Weather endpoint](https://github.com/lwandinxumalo/retail-compare/blob/main/RetailCompare.API/Controllers/WeatherForecastController.cs): `RetailCompare.API/Controllers/WeatherForecastController.cs`
- [Forecast model](https://github.com/lwandinxumalo/retail-compare/blob/main/RetailCompare.API/WeatherForecast.cs): `RetailCompare.API/WeatherForecast.cs`
- [API startup](https://github.com/lwandinxumalo/retail-compare/blob/main/RetailCompare.API/Program.cs): `RetailCompare.API/Program.cs`
- [MAUI startup](https://github.com/lwandinxumalo/retail-compare/blob/main/RetailCompare.App/MauiProgram.cs): `RetailCompare.App/MauiProgram.cs`

### Other components

- **Mobile user**
- **Scraper agent**

## Connections

- Mobile user → MAUI app: uses (evidence: `README.md`)
- MAUI app → REST API: HTTP requests (evidence: `README.md`)
- Scraper agent → Batch ingestion: submits batches (evidence: `README.md`)
- REST API → Batch ingestion: routes ingestion
- Batch ingestion → Price database: writes prices (evidence: `README.md`)
- Drop detection → User watchlists: checks (evidence: `README.md`)
- Drop detection → Firebase messaging: sends drop alerts (evidence: `README.md`)
- REST API → Price database: reads and writes (evidence: `README.md`)
- MAUI app → Offline cache: caches for offline use (evidence: `README.md`)
- Firebase messaging → Push listener: delivers alerts (evidence: `README.md`)
- Push listener → App shell and UI: routes to drop screens (evidence: `README.md`)
- MAUI app → Shared DTOs: uses DTOs (evidence: `README.md`)
- REST API → Shared DTOs: uses DTOs (evidence: `README.md`)
- API startup → Weather endpoint: maps controllers (evidence: `RetailCompare.API/Program.cs`)
- Weather endpoint → Forecast model: creates forecasts (evidence: `RetailCompare.API/Controllers/WeatherForecastController.cs`)
- MAUI startup → App entry: configures app (evidence: `RetailCompare.App/MauiProgram.cs`)
- App entry → App shell and UI: opens shell
