How veeravardhan35/nexus-kv works
NexusKV is a miniature in-memory key-value store exposed through a REST API, with consistent-hash sharding, replicated writes, TTL expiry, WAL durability and crash recovery. The main workflow is an HTTP key operation entering the server, passing validation, reaching KVEngine for shard selection and replication, then operating on shard memory and its WAL. The dashboard adds live topology, operation and recovery controls. The README and excerpts establish the core flow; some dashboard/admin endpoint wiring and engine internals are only partially sampled, so uncertain links are omitted or marked unverified.
Main entry points: server.js REST Server · KVEngine.js KV Engine · kv.routes.js KV Routes · StorageShard.js Storage Shard
Components 14
HTTP and Dashboard
- Interactive Dashboard
dashboard/app.js - Dashboard Setup
dashboard/setup.js - REST Server
src/server.js - KV Routes
src/routes/kv.routes.js - Request Validation
src/middleware/validator.js - Runtime Config
src/config.js - Alternate Bootstrap
src/index.js
Shard Storage
- Storage Shard
src/core/StorageShard.js - Shard Map
src/core/StorageShard.js
Durability
- WAL Manager
src/persistence/WALManager.js - Shard WAL Files
Other components
- API Client
Connections 14
- API Client → REST Server: sends requests
README.md - Interactive Dashboard → REST Server: polls and operates
dashboard/app.js - Dashboard Setup → REST Server: requests reinit
- REST Server → KV Engine: dispatches operations
src/server.js - REST Server → Request Validation: imports validation
src/server.js - REST Server → Runtime Config: loads settings
src/server.js - Alternate Bootstrap → KV Routes: registers router
src/index.js - KV Routes → Request Validation: validates requests
src/routes/kv.routes.js - KV Routes → KV Engine: dispatches operations
src/routes/kv.routes.js - KV Engine → Hash Ring: selects shards
src/core/KVEngine.js - KV Engine → Storage Shard: reads and writes
src/core/KVEngine.js - Storage Shard → Shard Map: updates entries
src/core/StorageShard.js - Storage Shard → WAL Manager: appends and replays
src/core/StorageShard.js - WAL Manager → Shard WAL Files: persists records
src/persistence/WALManager.js