How ranbai7/configraft works
Configraft is a strongly consistent distributed configuration service. Clients use its HTTP/gRPC API to read and mutate KV data, publish or roll back configuration versions, and long-poll Watch events; writes are applied locally or replicated through Raft before reaching the MVCC store. The graph also preserves the documented admin, membership-change, and Dashboard capabilities. Relationships are based on the README and indexed source excerpts; unsampled service details are not inferred beyond documented behavior.
Main entry points: server.cpp Server assembly · raft_node.cpp Raft node · app.js Dashboard UI · watch_hub.cpp Watch event hub
Components 20
API services
- Server assembly
src/server/server.cpp - KV API
src/server/kv_service_impl.cpp - Config API
src/server/config_service_impl.cpp - Watch API
src/server/watch_service_impl.cpp - Admin API
src/server/admin_service_impl.cpp - REST utilities
src/server/rest_util.h - Service protocol
proto/configraft.proto
Node and consensus
- Node interface
src/raft/node.h - Single-node mode
src/raft/local_node.cpp - Raft node
src/raft/raft_node.cpp - Replicated state machine
src/raft/state_machine.cpp
State and storage
- Command application
src/store/store_ops.cpp - MVCC store
src/store/store.cpp
Management and watch
- Dashboard hosting
src/server/dashboard_service_impl.cpp - Dashboard UI
web/app.js - Watch event hub
src/watch/watch_hub.cpp
Other components
- Clients
- Dashboard user
- Raft cluster
- LevelDB
Connections 35
- Clients → Server assembly: HTTP or gRPC
README.md - Server assembly → KV API: registers
src/server/server.cpp - Server assembly → Config API: registers
src/server/server.cpp - Server assembly → Watch API: registers
src/server/server.cpp - Server assembly → Admin API: registers
src/server/server.cpp - Server assembly → Dashboard hosting: registers
src/server/server.cpp - Server assembly → Single-node mode: creates single-node
src/server/server.cpp - Server assembly → Raft node: creates clustered node
src/server/server.cpp - Server assembly → Watch event hub: creates
src/server/server.cpp - KV API → Node interface: invokes operations
src/server/kv_service_impl.cpp - Config API → Node interface: invokes operations
src/server/config_service_impl.cpp - Watch API → Node interface: invokes watch
src/server/watch_service_impl.cpp - Admin API → Node interface: queries or changes
src/server/admin_service_impl.cpp - Dashboard user → Dashboard hosting: opens dashboard
README.md - Dashboard hosting → Dashboard UI: serves assets
- Dashboard UI → KV API: uses KV operations
README.md - Dashboard UI → Config API: uses config operations
README.md - Dashboard UI → Watch API: observes events
README.md - Dashboard UI → Admin API: uses member operations
README.md - Single-node mode → Command application: applies commands
src/raft/local_node.cpp - Single-node mode → Watch event hub: broadcasts events
src/raft/local_node.cpp - Raft node → Raft cluster: submits replicated writes
README.md - Raft node → Replicated state machine: configures state machine
src/raft/raft_node.cpp - Raft node → Watch event hub: serves long polls
src/raft/raft_node.cpp - Replicated state machine → Command application: applies commands
src/raft/state_machine.cpp - Replicated state machine → Watch event hub: broadcasts events
src/raft/state_machine.cpp - Command application → MVCC store: mutates state
src/store/store_ops.cpp - MVCC store → LevelDB: persists data
README.md - Watch event hub → MVCC store: replays history
src/watch/watch_hub.cpp - KV API → REST utilities: uses request helpers
src/server/kv_service_impl.cpp - Config API → REST utilities: uses request helpers
src/server/config_service_impl.cpp - Watch API → REST utilities: uses request helpers
src/server/watch_service_impl.cpp - Admin API → REST utilities: uses request helpers
src/server/admin_service_impl.cpp - Server assembly → Service protocol: registers protocol services
README.md - Raft node → MVCC store: reads local state
src/raft/raft_node.cpp