How akshaydubey05/goredis works
GoRedis is a Redis-compatible key-value store whose principal workflow accepts RESP commands, proposes them through Raft, applies committed commands to a deterministic state machine, and replies to clients. It also provides a simulated-cluster HTTP API and dashboard for observing elections and injecting faults. The README and excerpts establish the main runtime wiring; unsampled Raft internals are represented as one subsystem rather than asserting unsupported internal calls.
Main entry points: App.tsx Dashboard app · gateway.go HTTP gateway · raft Raft consensus · sim.go Cluster simulator
Components 18
Client access
- RESP server
internal/cluster/server.go - RESP codec
internal/resp/resp.go - Cluster node
internal/cluster/node.go
Raft storage
- Raft consensus
internal/raft - Raft persistence
internal/raft/storage.go - TCP transport
internal/transport/tcp.go - Deterministic FSM
internal/fsm/fsm.go - Key-value store
internal/store/store.go
Simulation API
- Cluster simulator
internal/sim/sim.go - Fault network
internal/simnet/simnet.go - HTTP gateway
internal/gateway/gateway.go - Gateway startup
cmd/gateway/main.go
Web dashboard
- Dashboard app
web/src/App.tsx - Cluster stream
web/src/useClusterStream.ts - Node controls
web/src/NodeCard.tsx - Command terminal
web/src/Terminal.tsx
Other components
- Redis client
- Dashboard visitor
Connections 20
- Redis client → RESP server: sends RESP
README.md - RESP server → RESP codec: parses replies
internal/cluster/server.go - RESP server → Cluster node: dispatches commands
internal/cluster/server.go - Cluster node → Raft consensus: proposes commands
README.md - Raft consensus → Deterministic FSM: applies commits
README.md - Deterministic FSM → Key-value store: executes commands
internal/fsm/fsm.go - Raft consensus → Raft persistence: persists state
- TCP transport → Raft consensus: serves peer RPCs
internal/transport/tcp.go - Gateway startup → Cluster simulator: creates cluster
cmd/gateway/main.go - Gateway startup → HTTP gateway: starts HTTP API
cmd/gateway/main.go - Cluster simulator → Fault network: uses network
internal/sim/sim.go - Cluster simulator → Cluster node: creates nodes
internal/sim/sim.go - HTTP gateway → Cluster simulator: reads and controls
internal/gateway/gateway.go - Dashboard visitor → Dashboard app: uses dashboard
README.md - Dashboard app → Cluster stream: subscribes state
web/src/App.tsx - Dashboard app → Node controls: renders controls
web/src/App.tsx - Dashboard app → Command terminal: renders terminal
web/src/App.tsx - Cluster stream → HTTP gateway: receives SSE
web/src/useClusterStream.ts - Command terminal → HTTP gateway: posts commands
web/src/Terminal.tsx - Dashboard app → HTTP gateway: posts fault actions
web/src/App.tsx