# vathapann/riderprofit architecture

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

- Interactive diagram: https://gitdiagram.com/vathapann/riderprofit
- Repository: https://github.com/vathapann/riderprofit

## Overview

RiderProfit is a Blazor application for delivery riders to record shifts, trips, vehicles and expenses, then review profitability and plan future work. The main workflow is authenticated rider activity entering shift and expense services, persistence in EF Core, and use of trip conditions to inform planning. Screenshot-based Uber Eats trip import and external weather/holiday lookups are distinct supporting capabilities. The supplied tree contains no UI, dashboard, financial-year summary or prediction implementation files, so those documented capabilities are represented only where a source path is supportable; their internal wiring is not inferred.

Main entry points: [`RiderProfit/Program.cs`](https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Program.cs) (Blazor app), [`RiderProfit/Data/ApplicationDbContext.cs`](https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Data/ApplicationDbContext.cs) (EF data store), [`RiderProfit/Services/TripConditionsService.cs`](https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/TripConditionsService.cs) (Trip conditions), [`RiderProfit/Services/Import/UberEatsScreenshotImporter.cs`](https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/Import/UberEatsScreenshotImporter.cs) (Screenshot importer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Accounts"]
  node_webapp["Blazor app<br/>[Program.cs]"]
  node_identity_services["Identity services"]
  node_profile["Rider profile<br/>[ApplicationUser.cs]"]
end

subgraph group_records["Rider records"]
  node_shift_service["Shift service<br/>[ShiftService.cs]"]
  node_shift_trip["Shifts and trips<br/>[Shift.cs]"]
  node_trip_service["Trip service<br/>[TripService.cs]"]
  node_expense_service["Expense service<br/>[ExpenseService.cs]"]
  node_expenses["Expenses<br/>[Expense.cs]"]
  node_vehicle_service["Vehicle service<br/>[VehicleService.cs]"]
  node_vehicles["Vehicle profiles<br/>[Vehicle.cs]"]
  node_platform_service["Platform service<br/>[PlatformService.cs]"]
  node_platforms["Delivery platforms<br/>[Platform.cs]"]
end

subgraph group_insights["Planning inputs"]
  node_planner_conditions["Trip conditions"]
end

subgraph group_integrations["Import and APIs"]
  node_holiday_api["Holiday lookup"]
  node_weather_api["Weather lookup"]
  node_screenshot_import["Screenshot importer"]
  node_screenshot_parser["Trip parser"]
  node_ocr["Azure OCR"]
end

subgraph group_persistence["Persistence"]
  node_database[("EF data store")]
end

node_rider(("Rider"))

node_rider -->|"uses"| node_webapp
node_webapp -->|"configures"| node_identity_services
node_webapp -->|"configures"| node_database
node_webapp -->|"registers"| node_shift_service
node_webapp -->|"registers"| node_trip_service
node_webapp -->|"registers"| node_expense_service
node_webapp -->|"registers"| node_vehicle_service
node_webapp -->|"registers"| node_platform_service
node_webapp -->|"registers"| node_screenshot_import
node_webapp -->|"registers"| node_ocr
node_webapp -->|"registers"| node_planner_conditions
node_webapp -->|"registers"| node_holiday_api
node_webapp -->|"registers"| node_weather_api
node_shift_service -->|"reads and writes"| node_database
node_trip_service -->|"reads and writes"| node_database
node_expense_service -->|"reads and writes"| node_database
node_vehicle_service -->|"reads and writes"| node_database
node_platform_service -->|"reads and writes"| node_database
node_planner_conditions -->|"reads profile"| node_database
node_planner_conditions -->|"checks holidays"| node_holiday_api
node_planner_conditions -->|"checks weather"| node_weather_api
node_screenshot_import -->|"extracts text"| node_ocr
node_screenshot_import -->|"parses lines"| node_screenshot_parser
node_screenshot_import -.->|"imports trips"| node_trip_service
node_shift_service -->|"manages records"| node_shift_trip
node_trip_service -->|"manages records"| node_shift_trip
node_expense_service -->|"manages records"| node_expenses
node_vehicle_service -->|"manages records"| node_vehicles
node_platform_service -->|"manages records"| node_platforms
node_database -->|"stores identity"| node_profile

click node_webapp "https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Program.cs"
click node_identity_services "https://github.com/vathapann/riderprofit/tree/master/RiderProfit/Components/Account"
click node_profile "https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Data/ApplicationUser.cs"
click node_shift_service "https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/ShiftService.cs"
click node_shift_trip "https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Models/Shift.cs"
click node_trip_service "https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/TripService.cs"
click node_expense_service "https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/ExpenseService.cs"
click node_expenses "https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Models/Expense.cs"
click node_vehicle_service "https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/VehicleService.cs"
click node_vehicles "https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Models/Vehicle.cs"
click node_platform_service "https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/PlatformService.cs"
click node_platforms "https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Models/Platform.cs"
click node_planner_conditions "https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/TripConditionsService.cs"
click node_holiday_api "https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/ExternalAPIs/NagerHolidayService.cs"
click node_weather_api "https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/ExternalAPIs/OpenMeteoWeatherService.cs"
click node_screenshot_import "https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/Import/UberEatsScreenshotImporter.cs"
click node_screenshot_parser "https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/Import/UberEatsScreenshotParser.cs"
click node_ocr "https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/ExternalAPIs/Ocr/AzureVisionOcrService.cs"
click node_database "https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Data/ApplicationDbContext.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_webapp,node_identity_services,node_profile toneBlue
class node_shift_service,node_shift_trip,node_trip_service,node_expense_service,node_expenses,node_vehicle_service,node_vehicles,node_platform_service,node_platforms toneAmber
class node_planner_conditions toneMint
class node_holiday_api,node_weather_api,node_screenshot_import,node_screenshot_parser,node_ocr toneRose
class node_database,node_rider toneIndigo
```

## Components

### Accounts

- [Blazor app](https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Program.cs): `RiderProfit/Program.cs`
- [Identity services](https://github.com/vathapann/riderprofit/tree/master/RiderProfit/Components/Account): `RiderProfit/Components/Account`
- [Rider profile](https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Data/ApplicationUser.cs): `RiderProfit/Data/ApplicationUser.cs`

### Rider records

- [Shift service](https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/ShiftService.cs): `RiderProfit/Services/ShiftService.cs`
- [Shifts and trips](https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Models/Shift.cs): `RiderProfit/Models/Shift.cs`
- [Trip service](https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/TripService.cs): `RiderProfit/Services/TripService.cs`
- [Expense service](https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/ExpenseService.cs): `RiderProfit/Services/ExpenseService.cs`
- [Expenses](https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Models/Expense.cs): `RiderProfit/Models/Expense.cs`
- [Vehicle service](https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/VehicleService.cs): `RiderProfit/Services/VehicleService.cs`
- [Vehicle profiles](https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Models/Vehicle.cs): `RiderProfit/Models/Vehicle.cs`
- [Platform service](https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/PlatformService.cs): `RiderProfit/Services/PlatformService.cs`
- [Delivery platforms](https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Models/Platform.cs): `RiderProfit/Models/Platform.cs`

### Planning inputs

- [Trip conditions](https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/TripConditionsService.cs): `RiderProfit/Services/TripConditionsService.cs`

### Import and APIs

- [Holiday lookup](https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/ExternalAPIs/NagerHolidayService.cs): `RiderProfit/Services/ExternalAPIs/NagerHolidayService.cs`
- [Weather lookup](https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/ExternalAPIs/OpenMeteoWeatherService.cs): `RiderProfit/Services/ExternalAPIs/OpenMeteoWeatherService.cs`
- [Screenshot importer](https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/Import/UberEatsScreenshotImporter.cs): `RiderProfit/Services/Import/UberEatsScreenshotImporter.cs`
- [Trip parser](https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/Import/UberEatsScreenshotParser.cs): `RiderProfit/Services/Import/UberEatsScreenshotParser.cs`
- [Azure OCR](https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Services/ExternalAPIs/Ocr/AzureVisionOcrService.cs): `RiderProfit/Services/ExternalAPIs/Ocr/AzureVisionOcrService.cs`

### Persistence

- [EF data store](https://github.com/vathapann/riderprofit/blob/master/RiderProfit/Data/ApplicationDbContext.cs): `RiderProfit/Data/ApplicationDbContext.cs`

### Other components

- **Rider**

## Connections

- Rider → Blazor app: uses (evidence: `README.md`)
- Blazor app → Identity services: configures (evidence: `RiderProfit/Program.cs`)
- Blazor app → EF data store: configures (evidence: `RiderProfit/Program.cs`)
- Blazor app → Shift service: registers (evidence: `RiderProfit/Program.cs`)
- Blazor app → Trip service: registers (evidence: `RiderProfit/Program.cs`)
- Blazor app → Expense service: registers (evidence: `RiderProfit/Program.cs`)
- Blazor app → Vehicle service: registers (evidence: `RiderProfit/Program.cs`)
- Blazor app → Platform service: registers (evidence: `RiderProfit/Program.cs`)
- Blazor app → Screenshot importer: registers (evidence: `RiderProfit/Program.cs`)
- Blazor app → Azure OCR: registers (evidence: `RiderProfit/Program.cs`)
- Blazor app → Trip conditions: registers (evidence: `RiderProfit/Program.cs`)
- Blazor app → Holiday lookup: registers (evidence: `RiderProfit/Program.cs`)
- Blazor app → Weather lookup: registers (evidence: `RiderProfit/Program.cs`)
- Shift service → EF data store: reads and writes (evidence: `RiderProfit/Services/ShiftService.cs`)
- Trip service → EF data store: reads and writes (evidence: `RiderProfit/Services/TripService.cs`)
- Expense service → EF data store: reads and writes (evidence: `RiderProfit/Services/ExpenseService.cs`)
- Vehicle service → EF data store: reads and writes (evidence: `RiderProfit/Services/VehicleService.cs`)
- Platform service → EF data store: reads and writes (evidence: `RiderProfit/Services/PlatformService.cs`)
- Trip conditions → EF data store: reads profile (evidence: `RiderProfit/Services/TripConditionsService.cs`)
- Trip conditions → Holiday lookup: checks holidays (evidence: `RiderProfit/Services/TripConditionsService.cs`)
- Trip conditions → Weather lookup: checks weather (evidence: `RiderProfit/Services/TripConditionsService.cs`)
- Screenshot importer → Azure OCR: extracts text (evidence: `RiderProfit/Services/Import/UberEatsScreenshotImporter.cs`)
- Screenshot importer → Trip parser: parses lines (evidence: `RiderProfit/Services/Import/UberEatsScreenshotImporter.cs`)
- Screenshot importer → Trip service: imports trips
- Shift service → Shifts and trips: manages records (evidence: `RiderProfit/Services/ShiftService.cs`)
- Trip service → Shifts and trips: manages records (evidence: `RiderProfit/Services/TripService.cs`)
- Expense service → Expenses: manages records (evidence: `RiderProfit/Services/ExpenseService.cs`)
- Vehicle service → Vehicle profiles: manages records (evidence: `RiderProfit/Services/VehicleService.cs`)
- Platform service → Delivery platforms: manages records (evidence: `RiderProfit/Services/PlatformService.cs`)
- EF data store → Rider profile: stores identity (evidence: `RiderProfit/Data/ApplicationDbContext.cs`)
