How gungooner/voting-app works
This is a Laravel API for creator-managed polls, public voting, and live result updates. The main workflow is creator authentication and poll creation, followed by public poll viewing and voting; votes are persisted, counted, and broadcast to subscribers. The graph includes the authentication, poll, voter-resolution, and event paths. Evidence is limited to the README and indexed or excerpted files; some tree-listed modules, including PollService and route details beyond their indexed references, were not sampled.
Main entry points: PollController.php Poll management API · PublicPollController.php Public poll API · VoteService.php Vote processing · api.php API routes
Components 22
API and auth
- API routes
routes/api.php - Authentication API
app/Http/Controllers/AuthController.php - Authentication service
app/Services/AuthService.php - Response envelope
app/Traits/ApiResponse.php - Creator accounts
app/Models/User.php
Poll management
- Poll management API
app/Http/Controllers/PollController.php - Poll service
app/Services/PollService.php - Poll records
app/Models/Poll.php - Poll options
app/Models/PollOption.php - Poll authorization
app/Policies/PollPolicy.php
Voting and results
- Public poll API
app/Http/Controllers/PublicPollController.php - Voter resolver contract
app/Contracts/VoterResolver.php - Session voter identity
app/Services/SessionVoterResolver.php - Vote processing
app/Services/VoteService.php - Vote records
app/Models/Vote.php
Live updates
- Vote result event
app/Events/VoteCast.php - Broadcast channel
routes/channels.php - Realtime client
resources/js/echo.js - Reverb WebSocket
Other components
- Poll creator
- Public voter
- Relational database
Connections 28
- Poll creator → API routes: sends requests
- Public voter → API routes: sends requests
- API routes → Authentication API: routes auth
routes/api.php - API routes → Poll management API: routes polls
routes/api.php - API routes → Public poll API: routes public polls
routes/api.php - Authentication API → Authentication service: delegates auth
app/Http/Controllers/AuthController.php - Authentication service → Creator accounts: creates and checks
app/Services/AuthService.php - Authentication API → Response envelope: formats responses
app/Http/Controllers/AuthController.php - Poll management API → Poll records: creates and lists
app/Http/Controllers/PollController.php - Poll management API → Poll options: creates options
app/Http/Controllers/PollController.php - Poll management API → Poll authorization: authorizes actions
- Poll management API → Poll service: service role
app/Services/PollService.php - Public poll API → Poll records: reads poll
app/Http/Controllers/PublicPollController.php - Public poll API → Vote processing: casts vote
app/Http/Controllers/PublicPollController.php - Public poll API → Voter resolver contract: resolves identity
app/Http/Controllers/PublicPollController.php - Voter resolver contract → Session voter identity: binds to
app/Providers/AppServiceProvider.php - Public poll API → Response envelope: formats responses
app/Http/Controllers/PublicPollController.php - Vote processing → Poll records: checks poll
app/Services/VoteService.php - Vote processing → Poll options: finds option
app/Services/VoteService.php - Vote processing → Vote records: records vote
app/Services/VoteService.php - Vote processing → Vote result event: dispatches event
app/Services/VoteService.php - Vote result event → Poll records: reads poll results
app/Events/VoteCast.php - Poll records → Relational database: persists poll data
- Poll options → Relational database: persists options
- Vote records → Relational database: persists votes
- Vote result event → Reverb WebSocket: broadcasts results
- Broadcast channel → Reverb WebSocket: exposes channel
- Realtime client → Reverb WebSocket: subscribes live