44 lines
1.6 KiB
Markdown
44 lines
1.6 KiB
Markdown
# SQ-009: Server Skeleton
|
|
|
|
**Status:** `[x] DONE`
|
|
**Blocked by:** SQ-008
|
|
**Priority:** High
|
|
|
|
## Description
|
|
|
|
Running `sq-server` binary with CLI, notmad lifecycle management, health gRPC endpoint, and Axum HTTP health endpoint. Follows the fungus-server pattern exactly.
|
|
|
|
## Files to Create/Modify
|
|
|
|
- `crates/sq-server/src/main.rs` - entry point with logging setup
|
|
- `crates/sq-server/src/cli.rs` - clap Command enum with Serve subcommand
|
|
- `crates/sq-server/src/cli/serve.rs` - ServeCommand with notmad builder
|
|
- `crates/sq-server/src/state.rs` - State struct with Config
|
|
- `crates/sq-server/src/grpc/mod.rs` - GrpcServer as notmad::Component
|
|
- `crates/sq-server/src/grpc/health.rs` - StatusService impl
|
|
- `crates/sq-server/src/grpc/error.rs` - gRPC error mapping
|
|
- `crates/sq-server/src/servehttp.rs` - Axum health routes
|
|
|
|
## Configuration
|
|
|
|
```
|
|
SQ_HOST=127.0.0.1:6060 # gRPC listen address
|
|
SQ_HTTP_HOST=127.0.0.1:6062 # HTTP listen address
|
|
SQ_DATA_DIR=./data # WAL storage directory
|
|
SQ_NODE_ID=node-1 # Unique node identifier
|
|
LOG_LEVEL=pretty # pretty|json|short
|
|
```
|
|
|
|
## Acceptance Criteria
|
|
|
|
- [ ] `cargo run -p sq-server -- serve` starts and listens on configured ports
|
|
- [ ] gRPC Status RPC returns node_id
|
|
- [ ] HTTP GET / returns 200 with health message
|
|
- [ ] Graceful shutdown on SIGINT via notmad cancellation token
|
|
- [ ] Logging setup matches forest/fungus pattern (pretty/json/short)
|
|
|
|
## Reference Files
|
|
|
|
- `/home/kjuulh/git/src.rawpotion.io/rawpotion/fungus/crates/fungus-server/src/cli/serve.rs`
|
|
- `/home/kjuulh/git/src.rawpotion.io/rawpotion/fungus/crates/fungus-server/src/state.rs`
|