# chazmj1s/spfootball architecture

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

- Interactive diagram: https://gitdiagram.com/chazmj1s/spfootball
- Repository: https://github.com/chazmj1s/spfootball

## Overview

#### Purpose and entry points
SaturdayPulse is a college-football data, rankings, projection, and user-personalization platform. The primary backend is an ASP.NET Core API started at `SaturdayPulse.Api/Program.cs`; client entry points are the .NET MAUI app (`SaturdayPulse.Mobile/MauiProgram.cs`) and two admin UIs: Angular (`SaturdayPulse.Admin/src/main.ts`) and Blazor (`SaturdayPulse.AdminBlazor/Program.cs`).

#### API boundary and application services
HTTP controllers expose production game data, developer-facing capabilities, content, and user/profile operations. Controllers delegate to domain-oriented services rather than directly owning calculations or persistence.
- `SaturdayPulse.Api/Controllers/ProductionGameDataController.cs`
- `SaturdayPulse.Api/Controllers/DeveloperController.cs`
- `SaturdayPulse.Api/Controllers/UserController.cs`

Key service stages include game-data assembly, predictions/projections, ranking calculations, postseason logic, content delivery, and user-profile management.
- `SaturdayPulse.Api/Services/GameDataService.cs`
- `SaturdayPulse.Api/Services/GamePredictionService.cs`
- `SaturdayPulse.Api/Services/WeeklyRankingsService.cs`

#### Ratings, projections, and sports-data pipeline
The core analytical flow operates on teams, games, records, lines, projections, resolved results, and weekly rankings. Rating components calculate/scaled/blend ratings; projection services cache and evaluate prediction accuracy; production services shape API-ready game datasets.
- `SaturdayPulse.Api/Services/RatingCalculator.cs`
- `SaturdayPulse.Api/Services/RatingBlendingService.cs`
- `SaturdayPulse.Api/Services/ProductionGameDataService.V2.cs`

Supporting inputs include College Football Data API configuration and transfer-portal, roster, recruiting, and score-differential datasets.
- `SaturdayPulse.Api/Configuration/CfbdApiSettings.cs`
- `SaturdayPulse.Api/Models/PortalEntry.cs`
- `SaturdayPulse.Api/Models/AvgScoreDifferential.cs`

#### Persistence and transaction boundary
Entity Framework Core centers persistence in `NCAAContext`; repositories isolate dataset access and `UnitOfWork` coordinates repository-backed changes. EF migrations define the evolving relational schema, including rankings, projections, portal metrics, roster capacity, user data, and audit logs.
- `SaturdayPulse.Api/Data/NCAAContext.cs`
- `SaturdayPulse.Api/Infrastructure/UnitOfWork.cs`
- `SaturdayPulse.Api/Migrations/NCAAContextModelSnapshot.cs`

The model layer is the durable boundary between sports computation and API/client DTOs.
- `SaturdayPulse.Api/Models/Games.cs`
- `SaturdayPulse.Api/Models/Projection.cs`
- `SaturdayPulse.Api/Models/UserProfile.cs`

#### Identity, entitlements, and managed content
User APIs support profile/contact changes, followed teams/games, entitlements, and account auditing. Request/response contracts separate public API payloads from persistence entities; Swagger includes an explicit user-ID header filter.
- `SaturdayPulse.Api/Services/UserProfileService.cs`
- `SaturdayPulse.Api/Models/UserEntitlement.cs`
- `SaturdayPulse.Api/Swagger/XUserIdHeaderFilter.cs`

Application-managed content is shared through the API and represented in the core project.
- `SaturdayPulse.Api/Services/ContentService.cs`
- `SaturdayPulse.Core/Content/ApplicationContentDocument.cs`

#### Client applications and operations
The MAUI app uses MVVM pages/viewmodels and API/cache/auth/follow services to consume backend data across Android, iOS, Windows, Mac Catalyst, and Tizen. Its functional surfaces include rankings, schedules, teams, rivalries, postseason, sandbox predictions, settings, and personal teams.
- `SaturdayPulse.Mobile/AppShell.xaml`
- `SaturdayPulse.Mobile/Services/GameDataApiService.cs`
- `SaturdayPulse.Mobile/ViewModels/PowerRankingsViewModel.cs`

Admin clients provide operational dashboards, analytics, data operations, metric rebuilds, and postseason workflows through dedicated API service layers.
- `SaturdayPulse.Admin/src/app/services/admin-api.service.ts`
- `SaturdayPulse.AdminBlazor/Services/AdminApiService.cs`
- `SaturdayPulse.AdminBlazor/Components/Pages/DataOps.razor`

#### Runtime and infrastructure
The backend and Blazor admin runtime are .NET; the admin SPA is Angular/TypeScript; the mobile runtime is .NET MAUI. Deployment metadata indicates Azure Web Deploy/ARM service dependencies. The backend integrates with the external College Football Data API and persists operational data through EF Core.
- `SaturdayPulse.Api/Properties/serviceDependencies.json`
- `SaturdayPulse.Api/Properties/ServiceDependencies/ncaa-power-ratings-api - Web Deploy/apis1.arm.json`
- `SaturdayPulse.Admin/angular.json`

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Client applications"]
  node_mobile["MAUI mobile app<br/>client<br/>[MauiProgram.cs]"]
  node_mobile_features["Mobile MVVM surfaces<br/>viewmodels"]
  node_angular_admin["Angular admin SPA<br/>admin client<br/>[main.ts]"]
  node_blazor_admin["Blazor admin app<br/>admin client<br/>[Program.cs]"]
end

subgraph group_api["ASP.NET Core API"]
  node_api_host["API host<br/>ASP.NET Core<br/>[Program.cs]"]
  node_controllers["HTTP controllers<br/>API boundary"]
  node_game_data["Game data service<br/>application service<br/>[GameDataService.cs]"]
  node_user_profiles["User profile service<br/>application service"]
  node_content["Content service<br/>application service<br/>[ContentService.cs]"]
end

subgraph group_analytics["Sports analytics pipeline"]
  node_ratings["Ratings calculation<br/>analytics service"]
  node_rating_blending["Rating blending<br/>analytics service"]
  node_predictions["Predictions and projections<br/>analytics service"]
  node_rankings["Weekly rankings<br/>analytics service"]
  node_production_dataset["Production game datasets<br/>data shaping service"]
end

subgraph group_data["Data and persistence"]
  node_unit_of_work["Unit of work<br/>transaction boundary<br/>[UnitOfWork.cs]"]
  node_ef_context[("NCAA context<br/>EF Core context<br/>[NCAAContext.cs]")]
  node_domain_models["Sports and user models<br/>durable models<br/>[Games.cs]"]
  node_content_document["Application content<br/>managed content model"]
end

node_cfbd{{"College Football Data API<br/>external data source<br/>[CfbdApiSettings.cs]"}}

node_mobile -->|"hosts"| node_mobile_features
node_mobile_features -->|"consumes API"| node_api_host
node_angular_admin -->|"admin operations"| node_api_host
node_blazor_admin -->|"admin operations"| node_api_host
node_api_host -->|"routes requests"| node_controllers
node_controllers -->|"game data"| node_game_data
node_controllers -->|"user operations"| node_user_profiles
node_controllers -->|"content"| node_content
node_game_data -->|"assembles"| node_production_dataset
node_production_dataset -->|"uses projections"| node_predictions
node_production_dataset -->|"uses rankings"| node_rankings
node_ratings -->|"produces inputs"| node_rating_blending
node_rating_blending -->|"feeds"| node_predictions
node_predictions -->|"informs"| node_rankings
node_game_data -->|"reads and writes"| node_unit_of_work
node_user_profiles -->|"persists changes"| node_unit_of_work
node_unit_of_work -->|"coordinates"| node_ef_context
node_ef_context -->|"maps"| node_domain_models
node_content -->|"serves"| node_content_document
node_cfbd -->|"sports data input"| node_game_data
node_cfbd -->|"sports data input"| node_ratings

click node_mobile "https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Mobile/MauiProgram.cs"
click node_mobile_features "https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Mobile/ViewModels/PowerRankingsViewModel.cs"
click node_angular_admin "https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Admin/src/main.ts"
click node_blazor_admin "https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.AdminBlazor/Program.cs"
click node_api_host "https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Program.cs"
click node_controllers "https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Controllers/ProductionGameDataController.cs"
click node_game_data "https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Services/GameDataService.cs"
click node_user_profiles "https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Services/UserProfileService.cs"
click node_content "https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Services/ContentService.cs"
click node_ratings "https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Services/RatingCalculator.cs"
click node_rating_blending "https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Services/RatingBlendingService.cs"
click node_predictions "https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Services/GamePredictionService.cs"
click node_rankings "https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Services/WeeklyRankingsService.cs"
click node_production_dataset "https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Services/ProductionGameDataService.V2.cs"
click node_unit_of_work "https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Infrastructure/UnitOfWork.cs"
click node_ef_context "https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Data/NCAAContext.cs"
click node_domain_models "https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Models/Games.cs"
click node_content_document "https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Core/Content/ApplicationContentDocument.cs"
click node_cfbd "https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Configuration/CfbdApiSettings.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,node_mobile_features,node_angular_admin,node_blazor_admin toneBlue
class node_api_host,node_controllers,node_game_data,node_user_profiles,node_content toneAmber
class node_ratings,node_rating_blending,node_predictions,node_rankings,node_production_dataset toneMint
class node_unit_of_work,node_ef_context,node_domain_models,node_content_document toneRose
class node_cfbd toneNeutral
```

## Components

### Client applications

- [MAUI mobile app](https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Mobile/MauiProgram.cs): client · Cross-platform consumer app. · `SaturdayPulse.Mobile/MauiProgram.cs`
- [Mobile MVVM surfaces](https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Mobile/ViewModels/PowerRankingsViewModel.cs): viewmodels · Rankings, schedules, teams, postseason, and personal teams. · `SaturdayPulse.Mobile/ViewModels/PowerRankingsViewModel.cs`
- [Angular admin SPA](https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Admin/src/main.ts): admin client · `SaturdayPulse.Admin/src/main.ts`
- [Blazor admin app](https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.AdminBlazor/Program.cs): admin client · `SaturdayPulse.AdminBlazor/Program.cs`

### ASP.NET Core API

- [API host](https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Program.cs): ASP.NET Core · Primary backend entry point. · `SaturdayPulse.Api/Program.cs`
- [HTTP controllers](https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Controllers/ProductionGameDataController.cs): API boundary · Production data, developer, and user endpoints. · `SaturdayPulse.Api/Controllers/ProductionGameDataController.cs`
- [Game data service](https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Services/GameDataService.cs): application service · `SaturdayPulse.Api/Services/GameDataService.cs`
- [User profile service](https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Services/UserProfileService.cs): application service · Profiles, follows, entitlements, and auditing. · `SaturdayPulse.Api/Services/UserProfileService.cs`
- [Content service](https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Services/ContentService.cs): application service · `SaturdayPulse.Api/Services/ContentService.cs`

### Sports analytics pipeline

- [Ratings calculation](https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Services/RatingCalculator.cs): analytics service · Calculates and scales team ratings. · `SaturdayPulse.Api/Services/RatingCalculator.cs`
- [Rating blending](https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Services/RatingBlendingService.cs): analytics service · `SaturdayPulse.Api/Services/RatingBlendingService.cs`
- [Predictions and projections](https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Services/GamePredictionService.cs): analytics service · Evaluates projections and prediction accuracy. · `SaturdayPulse.Api/Services/GamePredictionService.cs`
- [Weekly rankings](https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Services/WeeklyRankingsService.cs): analytics service · `SaturdayPulse.Api/Services/WeeklyRankingsService.cs`
- [Production game datasets](https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Services/ProductionGameDataService.V2.cs): data shaping service · Shapes API-ready game data. · `SaturdayPulse.Api/Services/ProductionGameDataService.V2.cs`

### Data and persistence

- [Unit of work](https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Infrastructure/UnitOfWork.cs): transaction boundary · Coordinates repository-backed changes. · `SaturdayPulse.Api/Infrastructure/UnitOfWork.cs`
- [NCAA context](https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Data/NCAAContext.cs): EF Core context · Persistence boundary for operational sports and user data. · `SaturdayPulse.Api/Data/NCAAContext.cs`
- [Sports and user models](https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Models/Games.cs): durable models · Games, projections, and user profiles bridge computation and API payloads. · `SaturdayPulse.Api/Models/Games.cs`
- [Application content](https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Core/Content/ApplicationContentDocument.cs): managed content model · `SaturdayPulse.Core/Content/ApplicationContentDocument.cs`

### Other components

- [College Football Data API](https://github.com/chazmj1s/spfootball/blob/main/SaturdayPulse.Api/Configuration/CfbdApiSettings.cs): external data source · `SaturdayPulse.Api/Configuration/CfbdApiSettings.cs`

## Connections

- MAUI mobile app → Mobile MVVM surfaces: hosts
- Mobile MVVM surfaces → API host: consumes API
- Angular admin SPA → API host: admin operations
- Blazor admin app → API host: admin operations
- API host → HTTP controllers: routes requests
- HTTP controllers → Game data service: game data
- HTTP controllers → User profile service: user operations
- HTTP controllers → Content service: content
- Game data service → Production game datasets: assembles
- Production game datasets → Predictions and projections: uses projections
- Production game datasets → Weekly rankings: uses rankings
- Ratings calculation → Rating blending: produces inputs
- Rating blending → Predictions and projections: feeds
- Predictions and projections → Weekly rankings: informs
- Game data service → Unit of work: reads and writes
- User profile service → Unit of work: persists changes
- Unit of work → NCAA context: coordinates
- NCAA context → Sports and user models: maps
- Content service → Application content: serves
- College Football Data API → Game data service: sports data input
- College Football Data API → Ratings calculation: sports data input
