How openslides/openslides-vote-service works
OpenSlides Vote Service accepts authenticated and internal HTTP requests to manage polls, accept and validate ballots, and report voting status and counts. The main runtime wires the HTTP server, vote domain service, datastore flow, and fast/long vote backends. The README documents poll start, vote, stop, clear, clear-all, “Have I Voted,” and streaming vote counts; these are represented as capabilities of the HTTP and vote-service components. Source excerpts are partial, so uncertain datastore and messaging internals are not expanded.
Main entry points: vote.go Vote service · http.go HTTP server and routes · main.go Service runtime · backend.go Backend selection
Components 19
HTTP API
- HTTP server and routes
vote/http/http.go - HTTP error mapping
vote/http/error.go
Vote Domain
- Vote service
vote/vote.go - Ballot validation
vote/vote.go - Poll lifecycle
vote/vote.go - Voted status
vote/vote.go - Vote count stream
vote/http/http.go
Vote Storage
- Backend selection
backend/backend.go - Fast vote backend
backend/redis/redis.go - Memory backend
backend/memory/memory.go - Long vote backend
backend/postgres/postgres.go
Platform Integration
- Service runtime
main.go - Token authentication
- Datastore flow and cache
vote/flow.go - Redis message bus
Other components
- OpenSlides clients
- OpenSlides datastore
- Redis vote state
- PostgreSQL vote data
Connections 25
- OpenSlides clients → HTTP server and routes: sends requests
- Service runtime → HTTP server and routes: starts server
- Service runtime → Datastore flow and cache: initializes flow
- Service runtime → Backend selection: builds backends
- Service runtime → Vote service: starts service
- Service runtime → Redis message bus: creates bus
- HTTP server and routes → HTTP error mapping: maps errors
- HTTP server and routes → Token authentication: authenticates
- HTTP server and routes → Vote service: dispatches operations
- Vote service → Ballot validation: validates ballots
- Vote service → Poll lifecycle: manages polls
- Vote service → Voted status: checks voter status
- HTTP server and routes → Vote count stream: streams counts
- Vote count stream → Vote service: reads live votes
- Vote service → Datastore flow and cache: fetches poll and user data
- Vote service → Fast vote backend: stores fast votes
- Vote service → Long vote backend: stores long votes
- Backend selection → Fast vote backend: selects default
- Backend selection → Memory backend: selects single-instance
- Backend selection → Long vote backend: creates backend
- Fast vote backend → Redis vote state: reads and writes
- Memory backend → Vote service: holds in memory
- Long vote backend → PostgreSQL vote data: reads and writes
- Datastore flow and cache → OpenSlides datastore: fetches datastore data
- Datastore flow and cache → Redis message bus: uses updates