How t0mer/cic works
CIC is a DRADIS phone-telemetry control plane: phones publish over MQTT, CIC maintains device state and history, and administrators inspect and manage devices through a browser UI or REST API. The principal flow runs from MQTT ingestion through the device registry and persistence to live UI updates; command requests travel from the UI through API validation, audit and command services back to MQTT. The README documents geocoding, safe places, authentication, history and settings capabilities. Some subsystem links rely on that documentation because their implementation files were not excerpted.
Main entry points: api.go REST and SSE API · App.tsx Routed web app · registry.go Device registry · store.go SQLite store
Components 24
Server runtime
- HTTP server
cmd/cic/serve.go - REST and SSE API
internal/api/api.go - SQLite store
internal/store/store.go
Telemetry and state
- MQTT client
internal/mqtt/client.go - Device registry
internal/devices/registry.go - Live event hub
internal/events/hub.go
Device capabilities
- Location history
internal/history/history.go - Reverse geocoding
internal/geocode/worker.go - Safe places
internal/places/places.go - Device commands
internal/commands/service.go
Identity and audit
- Command audit
internal/audit/audit.go - Users and MFA
internal/auth/store_totp.go
Browser application
- Routed web app
web/src/App.tsx - Browser authentication
web/src/features/auth/auth-context.ts - Device cards and map
web/src/features/devices/DevicesPage.tsx - History routes
web/src/features/history/HistoryPage.tsx - Settings screens
web/src/features/settings/SettingsPage.tsx - Command actions
web/src/features/commands/useCommand.ts - Command results
web/src/features/commands/results.ts
Other components
- Administrator
- DRADIS phone
- MQTT broker
- Browser
- LatLng API
Connections 30
- Administrator → Browser: uses
README.md - Browser → Routed web app: opens
web/src/App.tsx - Routed web app → Browser authentication: provides auth
web/src/App.tsx - Routed web app → Device cards and map: routes devices
web/src/App.tsx - Routed web app → History routes: routes history
web/src/App.tsx - Routed web app → Settings screens: routes settings
web/src/App.tsx - Routed web app → Command actions: hosts actions
web/src/App.tsx - Command actions → Command results: registers IDs
web/src/features/commands/useCommand.ts - Browser → REST and SSE API: REST and SSE
README.md - DRADIS phone → MQTT broker: publishes telemetry
README.md - MQTT broker → MQTT client: delivers telemetry
README.md - MQTT client → Device registry: updates state
README.md - Device registry → SQLite store: persists devices
internal/devices/registry.go - Device registry → Live event hub: notifies changes
- Live event hub → REST and SSE API: streams events
- REST and SSE API → Location history: serves history
README.md - Location history → SQLite store: stores routes
internal/history/history.go - Device registry → Reverse geocoding: queues locations
internal/geocode/worker.go - Reverse geocoding → LatLng API: resolves names
README.md - Reverse geocoding → SQLite store: caches results
internal/geocode/worker.go - REST and SSE API → Safe places: manages places
README.md - Safe places → SQLite store: persists places
README.md - REST and SSE API → Device commands: dispatches actions
- Device commands → Device registry: checks device
internal/commands/service.go - Device commands → MQTT client: publishes commands
README.md - REST and SSE API → Command audit: audits attempts
- REST and SSE API → Users and MFA: authenticates users
internal/api/api.go - Users and MFA → SQLite store: stores credentials
- HTTP server → REST and SSE API: mounts routes
cmd/cic/serve.go - HTTP server → MQTT client: starts client
cmd/cic/serve.go