How pushpak1203/kudo-voice-bot works
Purpose and entry points
This is a React Native mobile controller for a Bluetooth-connected robot, with voice and manual command paths, robot-status display, and command history. JavaScript starts at index.js, mounts App.tsx, then composes application providers and navigation. Native shells target Android and iOS.
Application composition and navigation
App.tsx is the top-level UI boundary. app/providers/AppProviders.tsx centralizes cross-screen providers, including robot status state; app/navigation/AppNavigator.tsx defines the screen flow. Primary user surfaces cover splash, dashboard, Bluetooth pairing, manual/voice controls, status, history, and settings under app/screens/.
Domain model and state
Typed models separate UI from robot transport semantics: commands, messages, connection state, health, and status are represented in app/models/RobotCommand.ts, app/models/RobotMessage.ts, and app/models/RobotStatus.ts. Shared live robot state is exposed through app/hooks/RobotStatusContext.tsx; dedicated hooks provide Bluetooth and history-facing behavior in app/hooks/useBluetooth.ts and app/hooks/useHistory.ts.
Command and Bluetooth pipeline
User actions from control screens are converted into domain commands, handled by app/services/command/CommandService.ts, serialized via app/services/protocol/ProtocolSerializer.ts, and sent through the Bluetooth service abstraction. app/services/bluetooth/IBluetoothService.ts defines the transport boundary, while BluetoothService.ts is the device implementation and MockBluetoothService.ts supports non-device execution. app/services/connection/ConnectionManager.ts owns connection lifecycle coordination.
Incoming robot data and persistence
Bluetooth payloads enter through the transport layer, are decoded by app/services/protocol/ProtocolParser.ts, and update status through app/services/status/RobotStatusService.ts. Command events are retained through app/services/history/HistoryService.ts for the history screen. This establishes a bidirectional boundary: mobile commands are serialized outbound; robot telemetry/messages are parsed inbound.
Voice and platform permissions
Voice input is isolated behind app/services/voice/VoiceService.ts; app/services/voice/IntentMapper.ts maps recognized intent to robot commands rather than letting UI directly control transport. Permissions are centralized at app/permissions/PermissionService.ts. Android additionally contains a custom native React Native bridge in android/app/src/main/java/com/pananivoicebot/VoiceRecognitionModule.kt, registered by VoiceRecognitionPackage.kt, indicating platform speech-recognition integration.
Robot firmware and protocol boundary
The robot endpoint is Arduino firmware rooted at arduino_firmware/src/main.ino. It composes Bluetooth handling, motor control, and sensor management through arduino_firmware/include/BluetoothHandler.h, MotorController.h, and SensorManager.h; hardware pin assignments reside in arduino_firmware/config/pinout.h. Bluetooth message contract and state-machine behavior are architecturally documented in docs/BluetoothProtocol.md and docs/RobotStateMachine.md.
Runtime and infrastructure
The app runs in the React Native runtime with Metro for development, Gradle/Android native integration, and Xcode/CocoaPods for iOS. Android application bootstrap is android/app/src/main/java/com/pananivoicebot/MainApplication.kt; iOS bootstrap is ios/PananiVoiceBot/AppDelegate.swift. External/device-facing dependencies are Bluetooth hardware, Android voice recognition, microphone/Bluetooth permissions, and the Arduino robot; no backend service is indicated.
Main entry points: CommandService.ts Command Service · VoiceService.ts Voice Service & Intent Mapper · BluetoothService.ts Bluetooth Service · AppProviders.tsx App Providers
Components 18
React Native App
- JS Entry
index.js - App Root
App.tsx - App Providers · Supplies shared robot status state.
app/providers/AppProviders.tsx - App Navigator · Routes splash, dashboard, pairing, controls, status, history, and settings.
app/navigation/AppNavigator.tsx - Control Screens · Manual and voice actions originate here.
- Robot Status Context
app/hooks/RobotStatusContext.tsx - Robot Domain Models · Commands, messages, connection state, health, and status.
app/models/RobotCommand.ts
Application Services
- Command Service
app/services/command/CommandService.ts - Protocol Serializer
app/services/protocol/ProtocolSerializer.ts - Bluetooth Service · Implements the Bluetooth transport abstraction; mock supports non-device runs.
app/services/bluetooth/BluetoothService.ts - Connection Manager
app/services/connection/ConnectionManager.ts - Protocol Parser
app/services/protocol/ProtocolParser.ts - Robot Status Service
app/services/status/RobotStatusService.ts - History Service
app/services/history/HistoryService.ts - Voice Service & Intent Mapper · Recognizes speech and maps intents to robot commands.
app/services/voice/VoiceService.ts - Permission Service
app/permissions/PermissionService.ts
Native & Device
- Android Voice Bridge
android/app/src/main/java/com/pananivoicebot/VoiceRecognitionModule.kt
Robot Firmware
- Arduino Robot Firmware · Coordinates Bluetooth, motors, and sensors.
arduino_firmware/src/main.ino
Connections 20
- JS Entry → App Root: mounts
- App Root → App Providers: composes
- App Providers → App Navigator: hosts
- App Navigator → Control Screens: presents
- App Providers → Robot Status Context: provides
- Control Screens → Command Service: manual commands
- Control Screens → Voice Service & Intent Mapper: voice input
- Voice Service & Intent Mapper → Android Voice Bridge: uses native recognition
- Voice Service & Intent Mapper → Permission Service: requests microphone access
- Voice Service & Intent Mapper → Command Service: mapped intent
- Command Service → Robot Domain Models: uses commands
- Command Service → Protocol Serializer: serializes
- Command Service → History Service: records events
- Protocol Serializer → Bluetooth Service: outbound payload
- Connection Manager → Bluetooth Service: coordinates lifecycle
- Bluetooth Service → Arduino Robot Firmware: Bluetooth messages · Bidirectional device transport.
- Bluetooth Service → Protocol Parser: inbound payload
- Protocol Parser → Robot Status Service: decoded telemetry
- Robot Status Service → Robot Status Context: updates live state
- Robot Status Context → App Navigator: drives status UI