How olehov/sparenode works
SpareNode is a cross-platform file server for sharing configured folders over a local network. Its principal workflow is to load and validate the explicitly selected configuration, prepare server runtime plans, accept TCP connections, process bounded HTTP requests, route filesystem API operations, and return responses. Distinct supporting stages include safe shared-root and filesystem operations, request-body temporary storage, and owner authentication. The README also documents transport trust policies and structured logging. Several runtime details are not sampled, so the graph omits unsupported call relationships rather than inferring them.
Main entry points: server.cpp Server composition · http_connection_handler.cpp HTTP connection handler · filesystem_service.cpp Filesystem service · runtime_bootstrap.cpp Runtime bootstrap
Components 20
Startup and configuration
- Command-line options
src/application/command_line.cpp - Config parsing
src/configuration/config_parser.cpp - Runtime bootstrap
src/bootstrap/runtime_bootstrap.cpp - Server composition
apps/sparenode/server.cpp
Network and HTTP
- TCP listener
src/network/tcp_listener.cpp - Connection dispatch
src/network/connection_dispatcher.cpp - HTTP connection handler
src/http/transport/http_connection_handler.cpp - Request body ingestion
src/http/transport/request_body_ingestor.cpp - HTTP router
src/http/routing/http_router.cpp - Filesystem API routes
src/http/api/filesystem_api.cpp - HTTP responses
src/http/response/http_response.cpp
Shared filesystem
- Filesystem service
src/application/filesystem_service.cpp - Safe path boundary
src/filesystem/safe_path.cpp - Shared root
src/filesystem/shared_root.cpp - Filesystem operations
src/filesystem - Temporary body storage
src/storage/temporary_file_writer.cpp
Authentication
- Authentication service
src/authentication/authentication_service.cpp - File credentials
src/authentication/file_authentication.cpp
Runtime operations
- Structured logging
src/logging/logger.cpp
Other components
- Server operator
Connections 20
- Server operator → Command-line options: provides options
README.md - Server composition → Config parsing: loads configuration
apps/sparenode/server.cpp - Server composition → Runtime bootstrap: prepares runtime
apps/sparenode/server.cpp - Server composition → Filesystem API routes: builds filesystem API
apps/sparenode/server.cpp - Server composition → HTTP router: creates router
apps/sparenode/server.cpp - Server composition → HTTP connection handler: configures handler
apps/sparenode/server.cpp - TCP listener → Connection dispatch: schedules connections
- Connection dispatch → HTTP connection handler: dispatches connections
- HTTP connection handler → Request body ingestion: ingests request bodies
- HTTP connection handler → HTTP router: dispatches requests
- HTTP connection handler → HTTP responses: writes responses
src/http/transport/http_connection_handler.cpp - Filesystem API routes → HTTP router: registers routes
- Filesystem API routes → Filesystem service: composes filesystem service
- Filesystem service → Safe path boundary: validates paths
- Filesystem service → Filesystem operations: performs operations
- Filesystem service → Temporary body storage: materializes uploads
- Runtime bootstrap → Shared root: validates share root
src/bootstrap/runtime_bootstrap.cpp - Runtime bootstrap → Authentication service: prepares authentication
- Authentication service → File credentials: looks up credentials
- Server composition → Structured logging: emits lifecycle logs
apps/sparenode/server.cpp