How morgverd/sms-server works
SMS Server is a self-hosted gateway connecting a serial GSM modem to SMS persistence, modem controls, GNSS reporting, and client integrations. The main workflow starts in src/main.rs, where configuration is loaded and src/app.rs launches the modem and service tasks. Incoming modem messages are handled by the app and SMS receiver, then persisted and exposed through HTTP and event integrations; outbound HTTP SMS requests pass through the SMS manager to the modem. README capabilities are included, but some subsystem wiring is inferred only from documentation because its source was not sampled.
Main entry points: app.rs App orchestration · mod.rs SMS manager · worker.rs Serial worker · routes.rs HTTP routes
Components 23
Runtime orchestration
- CLI entry
src/main.rs - Configuration
src/config.rs - App orchestration
src/app.rs
Modem and location
- Modem manager
src/modem/mod.rs - Serial worker
src/modem/worker.rs - Command handlers
src/modem/handlers.rs - Response parsers
src/modem/parsers.rs
SMS and persistence
- SMS manager
src/sms/mod.rs - Multipart assembly
src/sms/multipart.rs - Message encryption
src/sms/encryption.rs - SMS database
src/sms/database.rs
Client interfaces
- HTTP server
src/http/mod.rs - HTTP routes
src/http/routes.rs - OpenAPI support
src/http/openapi.rs
Event delivery
- Event broadcaster
src/events.rs - WebSocket stream
src/http/websocket.rs - Webhook delivery
src/webhooks.rs
Other components
- Operator
- HTTP client
- WebSocket client
- GSM modem
- Webhook receiver
- SQLite
Connections 30
- Operator → CLI entry: starts gateway
- CLI entry → Configuration: loads settings
- CLI entry → App orchestration: starts runtime
- App orchestration → Configuration: uses settings
- App orchestration → Modem manager: starts modem
- Modem manager → Serial worker: spawns worker
- Serial worker → GSM modem: reads and writes
- Serial worker → Command handlers: dispatches responses
- Command handlers → Response parsers: parses responses
- Serial worker → App orchestration: forwards modem messages
- App orchestration → SMS manager: handles incoming SMS
- SMS manager → Multipart assembly: assembles segments
- SMS manager → SMS database: stores and queries
- SMS database → Message encryption: encrypts message content
- SMS database → SQLite: persists records
- App orchestration → Event broadcaster: broadcasts events
- SMS manager → Event broadcaster: publishes SMS events
- App orchestration → HTTP server: starts server
- HTTP client → HTTP server: calls API
- HTTP server → HTTP routes: dispatches requests
- HTTP routes → SMS manager: sends SMS
- HTTP routes → SMS database: reads message data
- HTTP routes → Modem manager: requests modem data
- HTTP server → OpenAPI support: exposes API schema
- App orchestration → WebSocket stream: provides event stream
- WebSocket client → WebSocket stream: subscribes to events
- Event broadcaster → WebSocket stream: streams events
- App orchestration → Webhook delivery: starts delivery worker
- Event broadcaster → Webhook delivery: dispatches events
- Webhook delivery → Webhook receiver: posts events