How amaljith-ak/sportsync works
SportSync is a football scores and league-information application with an Angular client, an Express/Prisma backend, scheduled data refreshes, live updates, predictions, and admin operations. The main user journey is browsing leagues, then viewing fixtures, results, and standings; live scores and win probabilities are additional capabilities. Sampled source confirms the football API’s database reads, sync writes, admin dispatch, and live-popup behavior. Several service and ML connections are represented by their named roles in the tree; their internal wiring was not sampled.
Main entry points: index.ts Express server · admin.routes.ts Admin endpoints · sports-data.service.ts Sports data client · sync.service.ts Competition sync
Components 27
Sports dashboard
- Angular application
FrontEnd/Sports-Sync/src/app/app.ts - League browser
FrontEnd/Sports-Sync/src/app/features/home/home.ts - League details
FrontEnd/Sports-Sync/src/app/features/league-detail/league-detail.ts - Win probability
FrontEnd/Sports-Sync/src/app/features/win-probability/win-probability.ts - Live score popup
FrontEnd/Sports-Sync/src/app/features/live-popup/live-popup.service.ts - Sports data client
FrontEnd/Sports-Sync/src/app/core/services/sports-data.service.ts - Live update client
FrontEnd/Sports-Sync/src/app/core/services/live-update.service.ts - Admin console
FrontEnd/Sports-Sync/src/app/features/admin/admin-page.ts - Admin client
FrontEnd/Sports-Sync/src/app/core/services/admin.service.ts
Backend API
- Express server
BackEnd/src/index.ts - Football endpoints
BackEnd/src/routes/football.routes.ts - Admin endpoints
BackEnd/src/routes/admin.routes.ts - Admin authorization
BackEnd/src/middleware/adminAuth.ts - Sports database
BackEnd/src/lib/prisma.ts - Live socket gateway
BackEnd/src/sockets/liveGateway.ts
Data operations
- Job scheduler
BackEnd/src/jobs/scheduler.ts - Competition sync
BackEnd/src/services/sync.service.ts - Football data provider
BackEnd/src/services/footballData.service.ts - Live check job
BackEnd/src/jobs/liveCheck.job.ts - Live polling
BackEnd/src/services/livePoll.service.ts - Fixture prediction job
BackEnd/src/jobs/predictUpcoming.job.ts - Prediction service
BackEnd/src/services/mlPrediction.service.ts
Prediction service
- ML prediction API
MLService/predictions/views.py - Model inference
MLService/predictions/predict.py
Other components
- Sports fan
- Football data API
- ML HTTP caller
Connections 33
- Sports fan → Angular application: browses
- Angular application → League browser: shows leagues
- Sports fan → League details: selects league
- League details → Sports data client: requests details
- League browser → Sports data client: requests leagues
- Sports data client → Express server: HTTP requests
- Express server → Football endpoints: routes football
- Football endpoints → Sports database: reads matches, standings
- Sports database → Football endpoints: returns records
- Sports fan → Live score popup: opens live score
- Live score popup → Live update client: uses updates
- Live update client → Live socket gateway: receives live updates
- Express server → Live socket gateway: initializes
- Express server → Job scheduler: starts
- Express server → Live check job: starts
- Job scheduler → Competition sync: dispatches sync
- Competition sync → Football data provider: fetches competition data
- Football data provider → Football data API: requests data
- Competition sync → Sports database: upserts teams, matches, standings
- Live check job → Live polling: runs polling
- Live polling → Football data API: checks live matches
- Live polling → Live socket gateway: publishes updates
- Fixture prediction job → Prediction service: requests predictions
- Prediction service → ML HTTP caller: calls inference API
- ML HTTP caller → ML prediction API: sends prediction request
- ML prediction API → Model inference: runs inference
- Admin console → Admin client: sends admin actions
- Admin client → Express server: HTTP requests
- Express server → Admin endpoints: routes admin
- Admin endpoints → Admin authorization: checks key
- Admin endpoints → Job scheduler: dispatches manual sync
- Admin endpoints → Fixture prediction job: starts prediction sweep
- Win probability → Sports data client: requests prediction data