How deshan555/openrelay works
OpenRelay is a self-hosted SMS gateway: administrators authenticate and submit individual or campaign messages, the backend queues work and assigns it to connected Android devices, and devices send SMS through their carrier. The dashboard also monitors devices, logs, queue activity, and administrator accounts. Backend calls and startup wiring are supported by the excerpts and SOURCE INDEX; some dashboard-to-API and Android runtime details are documented but their implementing Flutter sources are absent from the supplied tree, so those links are marked unverified.
Main entry points: App.tsx Dashboard app · websocket.py Device WebSocket · main.py FastAPI application · admin_auth.py Admin authentication
Components 23
Admin dashboard
- Dashboard app
frontend/src/App.tsx - Login and setup
frontend/src/components/LoginScreen.tsx - Initial setup
frontend/src/components/SetupScreen.tsx - Device monitor
frontend/src/components/DevicesTab.tsx - SMS console
frontend/src/components/SmsTab.tsx - Campaign manager
frontend/src/components/BulkTab.tsx - SMS logs
frontend/src/components/LogsTab.tsx - Queue monitor
frontend/src/components/QueueFlowTab.tsx - Admin management
frontend/src/components/AdminTab.tsx
Backend API
- FastAPI application
backend/app/main.py - Admin authentication
backend/app/api/v2/endpoints/admin_auth.py - Device endpoints
backend/app/api/v2/endpoints/devices.py - SMS endpoints
backend/app/api/v2/endpoints/sms.py - Campaign endpoints
backend/app/api/v2/endpoints/bulk_sms.py - Device WebSocket
backend/app/api/v2/endpoints/websocket.py
Queue and state
- JWT and passwords
backend/app/auth.py - Queue engine
backend/app/queue_manager.py - Connection registry
backend/app/websocket.py - MongoDB state
backend/app/database_mongo.py
Android gateway
- Android device client
android/android/app/src/main/kotlin/com/openrelay/openrelay/MainActivity.kt - Native SMS bridge
android/sms_channel/android/src/main/kotlin/com/openrelay/sms_channel/SmsChannelPlugin.kt
Other components
- Administrator
- Carrier network
Connections 41
- Administrator → Dashboard app: uses
- Dashboard app → Login and setup: renders
frontend/src/App.tsx - Dashboard app → Initial setup: renders
frontend/src/App.tsx - Dashboard app → Device monitor: renders
frontend/src/App.tsx - Dashboard app → SMS console: renders
frontend/src/App.tsx - Dashboard app → Campaign manager: renders
frontend/src/App.tsx - Dashboard app → SMS logs: renders
frontend/src/App.tsx - Dashboard app → Queue monitor: renders
frontend/src/App.tsx - Dashboard app → Admin management: renders
frontend/src/App.tsx - Dashboard app → Device endpoints: fetches devices
frontend/src/App.tsx - Login and setup → Admin authentication: authenticates via
- Initial setup → Admin authentication: initializes via
- SMS console → SMS endpoints: submits SMS
- Campaign manager → Campaign endpoints: uploads campaigns
- Device monitor → Device endpoints: monitors devices
- SMS logs → Campaign endpoints: queries logs
- Queue monitor → Device WebSocket: observes queue
- Admin management → Admin authentication: manages accounts
- FastAPI application → Admin authentication: registers routes
- FastAPI application → Device endpoints: registers routes
- FastAPI application → SMS endpoints: registers routes
- FastAPI application → Campaign endpoints: registers routes
- FastAPI application → Device WebSocket: registers routes
- FastAPI application → Queue engine: starts workers
backend/app/main.py - Admin authentication → JWT and passwords: uses
backend/app/api/v2/endpoints/admin_auth.py - Device endpoints → JWT and passwords: checks tokens
backend/app/api/v2/endpoints/devices.py - SMS endpoints → JWT and passwords: checks tokens
backend/app/api/v2/endpoints/sms.py - Campaign endpoints → JWT and passwords: checks tokens
backend/app/api/v2/endpoints/bulk_sms.py - Device WebSocket → JWT and passwords: checks tokens
backend/app/api/v2/endpoints/websocket.py - Admin authentication → MongoDB state: reads and writes
backend/app/api/v2/endpoints/admin_auth.py - Device endpoints → MongoDB state: reads and writes
backend/app/api/v2/endpoints/devices.py - SMS endpoints → MongoDB state: reads and writes
backend/app/api/v2/endpoints/sms.py - Campaign endpoints → MongoDB state: reads and writes
backend/app/api/v2/endpoints/bulk_sms.py - Device WebSocket → MongoDB state: updates device state
backend/app/api/v2/endpoints/websocket.py - Device WebSocket → Connection registry: registers connections
backend/app/api/v2/endpoints/websocket.py - Device WebSocket → Queue engine: reports results
backend/app/api/v2/endpoints/websocket.py - Queue engine → MongoDB state: claims and updates jobs
backend/app/queue_manager.py - Queue engine → Connection registry: sends device messages
backend/app/queue_manager.py - Android device client → Device WebSocket: connects by WebSocket
- Android device client → Native SMS bridge: invokes native SMS
- Native SMS bridge → Carrier network: sends SMS