How waldirborbajr/govote works
GoVote is a secure voting service with JSON endpoints and a server-rendered voter/admin interface. Voters request and verify passcodes (including a separate Telegram-bot integration), browse active polls, cast votes, and view results; administrators manage polls and accounts. Poll logic validates and records votes against SQLite, with optional Redis caching and a Redis-stream worker for vote processing. The README documents these capabilities; some wiring and handler internals were not sampled, so uncertain relationships are omitted.
Main entry points: handlers.go Voting JSON API · router.go HTTP router · storage.go SQLite database · telegram.go Telegram code API
Components 17
HTTP entrypoints
- HTTP router
internal/server/router.go
Voting workflows
- Voting JSON API
internal/api/handlers.go - Telegram code API
internal/api/telegram.go - Voter interface
internal/ui/handlers.go - Poll and vote logic
internal/poll/poll.go - HTML templates
internal/views/page_templ.go
Administration
- Admin handlers
internal/admin/handlers.go
Shared services
- Passcodes and tokens
internal/security/security.go - Input validation
internal/validate/validate.go - WhatsApp notices
internal/notify/notify.go - Web and session helpers
internal/web/session.go - Domain models
internal/models/models.go
Runtime state
- SQLite database
internal/storage/storage.go - Redis cache and stream
internal/cache/redis.go - Vote worker
internal/worker/vote_worker.go
Other components
- Voter or bot
- Administrator
Connections 26
- Voter or bot → HTTP router: sends requests
README.md - Administrator → HTTP router: manages polls
README.md - HTTP router → Voting JSON API: routes API
internal/server/router.go - HTTP router → Telegram code API: routes Telegram
internal/api/telegram.go - HTTP router → Voter interface: routes UI
internal/server/router.go - HTTP router → Admin handlers: routes admin
internal/server/router.go - Voting JSON API → SQLite database: reads and writes
internal/api/handlers.go - Voting JSON API → Poll and vote logic: validates votes
internal/api/handlers.go - Voting JSON API → Redis cache and stream: caches polls
internal/api/handlers.go - Voting JSON API → Passcodes and tokens: issues tokens
internal/api/handlers.go - Voting JSON API → WhatsApp notices: builds passcode link
internal/api/handlers.go - Telegram code API → SQLite database: stores passcode
internal/api/telegram.go - Telegram code API → Passcodes and tokens: generates passcode
internal/api/telegram.go - Telegram code API → Input validation: checks request
internal/api/telegram.go - Voter interface → SQLite database: reads voter and poll data
internal/ui/handlers.go - Voter interface → HTML templates: renders pages
internal/ui/handlers.go - Voter interface → Input validation: checks input
internal/ui/handlers.go - Admin handlers → SQLite database: manages accounts
internal/admin/handlers.go - Admin handlers → Web and session helpers: authenticates admins
internal/admin/handlers.go - Admin handlers → WhatsApp notices: builds login link
internal/admin/handlers.go - Poll and vote logic → SQLite database: records votes and results
internal/poll/poll.go - Poll and vote logic → Domain models: uses poll models
internal/poll/poll.go - Vote worker → Redis cache and stream: consumes vote stream
internal/worker/vote_worker.go - Vote worker → Poll and vote logic: records queued vote
internal/worker/vote_worker.go - Web and session helpers → Passcodes and tokens: validates token
internal/web/session.go - Web and session helpers → SQLite database: loads admin
internal/web/session.go