How zaman-ua/bet works
This is a framework-free PHP sports-betting application. Its principal workflow routes an HTTP request, validates a user's bet, places it through the betting service, and returns updated bet and balance fragments; users can also register and administrators can manage users, balances, and bet outcomes. The graph preserves the documented match, currency, authentication, and CSRF capabilities. Edges are limited to relationships shown in excerpts, the source index, or README; unsampled implementation details are not inferred.
Main entry points: App.php Request application · BetController.php Bet submission · BetMatchFacade.php Match enrichment · UserAmountFragmentsService.php Balance and bet views
Components 24
HTTP runtime
- Route table
routes/routes.php - Request application
app/Core/App.php - Router
app/Core/Router.php - CSRF guard
app/Core/CsrfGuard.php - Controller invoker
app/Core/ControllerInvoker.php - HTTP controllers
app/Http/Controller.php - Response handling
app/Core/ResponseEmitter.php
User identity
- Registration
app/Http/User/RegistrationController.php - Authentication
app/Core/Service/AuthService.php
Betting domain
- Bet submission
app/Http/BetController.php - Bet validation
app/Validation/CreateBetValidator.php - Bet placement
app/Services/BettingService.php - Bet administration
app/Http/Admin/BetsController.php - Outcome settlement
app/Services/BetPlayService.php - Match enrichment
app/Facade/BetMatchFacade.php - Match configuration
app/Provider/MatchConfigProvider.php
Accounts and administration
- Amount operations
app/Services/AmountService.php - User administration
app/Http/Admin/UsersController.php - Balance and bet views
app/FragmentsService/UserAmountFragmentsService.php
Persistence
- User repositories
app/Repository/UserReaderRepository.php - Bet repositories
app/Repository/BetWriterRepository.php - Database abstraction
app/Core/Db/Db.php - MySQL database
Other components
- Browser / AJAX client
Connections 26
- Browser / AJAX client → Route table: sends requests
README.md - Route table → Request application: configures routes
routes/routes.php - Request application → Router: matches request
app/Core/App.php - Request application → CSRF guard: checks CSRF
app/Core/App.php - Request application → Controller invoker: invokes handler
app/Core/App.php - Request application → Response handling: emits response
app/Core/App.php - Controller invoker → HTTP controllers: resolves controller
app/Core/ControllerInvoker.php - Registration → User repositories: checks and creates user
app/Http/User/RegistrationController.php - Registration → Authentication: logs in user
app/Http/User/RegistrationController.php - Bet submission → Bet validation: validates bet
app/Http/BetController.php - Bet submission → Bet placement: places bet
app/Http/BetController.php - Bet submission → Match configuration: gets bet config
app/Http/BetController.php - Bet submission → Balance and bet views: builds response fragments
app/Http/BetController.php - Bet placement → Bet repositories: writes bet
app/Services/BettingService.php - Bet administration → Outcome settlement: settles bets
app/Http/Admin/BetsController.php - Bet administration → Match enrichment: gets match-enriched bets
app/Http/Admin/BetsController.php - Outcome settlement → Bet repositories: updates outcomes
app/Services/BetPlayService.php - User administration → Amount operations: adjusts balance
app/Http/Admin/UsersController.php - User administration → Balance and bet views: builds balance fragment
app/Http/Admin/UsersController.php - Balance and bet views → User repositories: reads balances
app/FragmentsService/UserAmountFragmentsService.php - Balance and bet views → Match enrichment: gets user bets
app/FragmentsService/UserAmountFragmentsService.php - Match enrichment → Bet repositories: reads bets
app/Facade/BetMatchFacade.php - Match enrichment → Match configuration: uses match config
app/Facade/BetMatchFacade.php - User repositories → Database abstraction: queries database
app/Repository/UserReaderRepository.php - Bet repositories → Database abstraction: queries database
- Database abstraction → MySQL database: accesses