How 1fini/tennisscoresapi works
TennisScoresAPI is the backend for tennis match scoring and tournament administration. Users and the companion WebApp create tournaments, players, match formats, and matches through REST endpoints; courtside scoring submits points, which are checked by the scoring engine, projected onto match state, persisted with match events, and broadcast to live-score subscribers. Match retrieval and analytics expose results. The graph reflects sampled controller, service, scoring, persistence, and startup code; several documented CRUD and format-service links are not shown where their implementations were not sampled.
Main entry points: LiveScoreService.cs Point and undo · Program.cs ASP.NET API · TennisDbContext.cs EF data context · MatchService.cs Match lifecycle
Components 24
API workflows
- ASP.NET API
TennisScores.API/Program.cs - Match endpoints
TennisScores.API/Controllers/MatchesController.cs - Live-score endpoints
TennisScores.API/Controllers/LiveScoreController.cs - Player endpoints
TennisScores.API/Controllers/PlayersController.cs - Tournament endpoints
TennisScores.API/Controllers/TournamentsController.cs - Format endpoints
TennisScores.API/Controllers/MatchFormatsController.cs - Match lifecycle
TennisScores.API/Services/MatchService.cs - Point and undo
TennisScores.API/Services/LiveScoreService.cs - Player management
TennisScores.API/Services/PlayerService.cs - Tournament management
TennisScores.API/Services/TournamentService.cs - Match formats
TennisScores.API/Services/MatchFormatService.cs
Scoring domain
- Scoring rules
TennisScores.Domain/Scoring/ScoringEngine.cs - Scoring state and replay
TennisScores.Domain/Scoring/ScoringReplay.cs - Match model
TennisScores.Domain/Entities/Match.cs
Persistence
- Match repository
TennisScores.Infrastructure/Repositories/MatchRepository.cs - Domain repositories
TennisScores.Domain/Repositories/IMatchRepository.cs - EF data context
TennisScores.Infrastructure/Data/TennisDbContext.cs - Unit of work
TennisScores.Infrastructure/UnitOfWork.cs - Match event journal
TennisScores.Infrastructure/Repositories/MatchEventRepository.cs
Live updates
- SignalR score hub
TennisScores.API/Hubs/ScoreHub.cs - Score broadcast
TennisScores.API/Hubs/ScoreHubExtensions.cs
Other components
- WebApp users
- PostgreSQL
- Live subscribers
Connections 28
- WebApp users → ASP.NET API: calls REST
- ASP.NET API → Match endpoints: routes requests
- ASP.NET API → Live-score endpoints: routes requests
- ASP.NET API → Player endpoints: routes requests
- ASP.NET API → Tournament endpoints: routes requests
- ASP.NET API → Format endpoints: routes requests
- Match endpoints → Match lifecycle: delegates
- Live-score endpoints → Point and undo: delegates
- Player endpoints → Player management: delegates
- Tournament endpoints → Tournament management: delegates
- Format endpoints → Match formats: delegates
- Match lifecycle → Domain repositories: reads and writes
- Match lifecycle → Unit of work: commits changes
- Match lifecycle → Scoring state and replay: calculates analytics
- Point and undo → Match repository: loads match
- Point and undo → Scoring rules: applies point
- Point and undo → Scoring state and replay: replays undo
- Point and undo → Domain repositories: projects score
- Point and undo → Match event journal: appends events
- Point and undo → Unit of work: commits changes
- Point and undo → Score broadcast: broadcasts update
- Match repository → EF data context: queries matches
- Domain repositories → EF data context: accesses data
- Match event journal → EF data context: stores events
- Unit of work → EF data context: saves changes
- EF data context → PostgreSQL: reads and writes
- Score broadcast → SignalR score hub: dispatches update
- SignalR score hub → Live subscribers: sends live score