# devapro/lanwalkietalkie architecture

> Architecture diagram of the GitHub repository devapro/lanwalkietalkie, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/devapro/lanwalkietalkie
- Repository: https://github.com/devapro/lanwalkietalkie

## Overview

1. **What this repo is**
   - This is a multi-module Android app for local-network push-to-talk communication.
   - It does not depend on a central backend: every app instance can both discover peers and communicate directly over Wi‑Fi LAN.
   - The app uses Jetpack Compose for UI and an MVI-style state flow for screen logic.

2. **Top-level module boundaries**
   - `app` is the Android application shell and entry point.
   - `core` contains shared MVI infrastructure used by feature ViewModels.
   - `core-ui` contains shared Compose theme/styling.
   - `service-network` owns peer discovery and socket-based text/data transport.
   - `service-voice` owns audio capture and playback.
   - `feature-ptt`, `feature-chat`, and `feature-settings` are UI feature modules built on top of the shared core/services.

3. **Application composition and startup**
   - `PttApplication` and `MainActivity` are the app entry points.
   - `appDi.kt` wires the application graph.
   - `MainViewModel` drives the main shell UI: it handles app initialization, permission checks, and active screen/tab selection.
   - `MainScreenInitStateFactory`, `MainTabsFactory`, and the reducers under `app/reducers` define the shell state machine.

4. **Shared architecture pattern**
   - The codebase is organized around MVI:
     - **Actions** represent user intent or system requests.
     - **Reducers** transform state in response to events.
     - **Action processors** coordinate side effects and produce events.
     - **Init state factories** build initial UI state.
   - This pattern is implemented once in `core/mvi` and repeated in each feature module with feature-specific actions/events/state.

5. **Core MVI layer**
   - `MviViewModel`, `Reducer`, `ActionProcessor`, `InitStateFactory`, and `CoroutineContextProvider` are the reusable framework pieces.
   - Feature ViewModels inherit this infrastructure rather than duplicating coroutine/state handling.
   - This is the main architectural boundary between UI intent and side effects.

6. **Network subsystem: local discovery and message transport**
   - `service-network` is responsible for finding nearby devices and exchanging data over sockets.
   - `DiscoveryListener` and `RegistrationListener` indicate the use of `NsdManager` for service discovery/registration on the local network.
   - `SocketServer` and `SocketClient` represent the bidirectional transport layer.
   - `ChanelControllerImpl` is the orchestration layer that likely coordinates channel lifecycle, peer connections, and routing.
   - Repositories such as `ConnectedDevicesRepository`, `DeviceInfoRepository`, and `TextMessagesRepository` hold network-facing state/models.
   - `ClientInfoResolver` and `getDeviceID.kt` support peer identity and device addressing.

7. **Voice subsystem: recording and playback**
   - `service-voice` owns audio capture and audio output.
   - `VoiceRecorder` uses recording APIs (`MediaRecorder` / `AudioRecord` per README intent) to capture push-to-talk audio.
   - `VoicePlayer` uses `AudioTrack`-style playback to render incoming voice audio.
   - `VoiceDi.kt` provides dependency wiring for the voice layer.
   - This module is isolated so the PTT feature can depend on audio behavior without embedding low-level Android audio code.

8. **Foreground/background service boundary**
   - `WalkieService` is the app’s runtime service boundary for long-lived communication.
   - `NotificationController` manages the persistent foreground notification required for ongoing mic/network activity.
   - This service layer is important because the app needs to keep audio and network operations alive while the UI is backgrounded.

9. **PTT feature flow**
   - `feature-ptt` is the main push-to-talk screen.
   - Its state is modeled by `PttScreenState`, with `PttAction` and `PttEvent` driving changes.
   - Reducers such as `StartRecordingReducer`, `StopRecordingReducer`, and `VoiceDataReceivedReducer` connect user interaction and incoming network/audio events.
   - `ConnectedDevicesUpdatedReducer` keeps the UI in sync with the current peer list.
   - UI files like `PTTContent`, `PTTContentPortrait`, `PTTContentLandscape`, `PTTButton`, `DeviceItem`, and `WaveCanvas` suggest a responsive screen that adapts to orientation and shows live audio/device feedback.

10. **Chat feature flow**
   - `feature-chat` is the text-message companion to PTT.
   - It has its own MVI slice: `ChatScreenState`, `ChatAction`, `ChatEvent`, and `ChatViewModel`.
   - Reducers cover initialization, loading history, sending, receiving, marking read, and device list updates.
   - `MessageModelMapper` converts between network message models and UI models.
   - `ChatContent`, `ChatTab`, `InputSection`, and `MessageItem` form the Compose UI for message history and input.

11. **Main shell UI and navigation**
   - `RootContent` and `OffContent` in the app module are the top-level Compose containers.
   - `BottomTabs`, `RailTabs`, `TabsContent`, and `RequiredPermissionsNotification` are shared shell UI elements.
   - `MainTab` and `MainTabItem` model the app’s tab/navigation structure across PTT, chat, and settings.
   - The UI is responsive: it switches between bottom navigation and rail navigation depending on layout/size.

12. **Permissions and app readiness**
   - `PermissionState` and the permission-related reducers in the app module indicate that the app gates functionality on runtime permissions.
   - Required permissions are part of the main shell state, not buried in each feature, so the app can globally block or warn before activating network/audio features.
   - This is especially important because audio capture, foreground service behavior, and local discovery all depend on Android runtime permissions.

13. **Settings feature**
   - `feature-settings` is lightweight and currently mostly a Compose content module.
   - Architecturally it fits the same feature-module pattern, but it is less stateful than PTT/chat.

14. **Shared UI/theme and platform config**
   - `core-ui` provides the app theme (`Color.kt`, `Theme.kt`, `Type.kt`) used by all Compose screens.
   - The app module contains drawables, strings, themes, backup rules, and manifest configuration, while each feature module keeps its own manifest and resources.
   - The repository also includes Android test and unit test scaffolding per module, plus a GitHub Actions workflow for APK build automation.

15. **End-to-end data flow**
   - User interacts with a feature screen in Compose.
   - UI emits an action into the feature ViewModel.
   - The MVI processor/reducers update screen state and trigger side effects.
   - Side effects call into `service-network` and/or `service-voice`.
   - Network/audio services communicate with peer devices and feed events back into feature reducers.
   - The updated state is rendered back through Compose, while the app shell keeps permissions, tabs, and service status coherent.

Main entry points: [`serivce-network`](https://github.com/devapro/lanwalkietalkie/tree/master/serivce-network) (service-network), [`core/src/main/java/pro/devapp/walkietalkiek/core/mvi`](https://github.com/devapro/lanwalkietalkie/tree/master/core/src/main/java/pro/devapp/walkietalkiek/core/mvi) (core/mvi), [`service-voice`](https://github.com/devapro/lanwalkietalkie/tree/master/service-voice) (service-voice), [`app/src/main/java/pro/devapp/walkietalkiek/MainViewModel.kt`](https://github.com/devapro/lanwalkietalkie/blob/master/app/src/main/java/pro/devapp/walkietalkiek/MainViewModel.kt) (MainViewModel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g_app["App Shell"]
  node_n_app["app"]
  node_n_ptt_application(("PttApplication<br/>app entry<br/>[PttApplication.kt]"))
  node_n_main_activity(("MainActivity<br/>[MainActivity.kt]"))
  node_n_main_vm["MainViewModel<br/>shell vm<br/>[MainViewModel.kt]"]
  node_n_main_state["Main state<br/>shell mvi"]
  node_n_main_factories["Shell factories<br/>state setup"]
  node_n_main_reducers["Shell reducers<br/>mvi reducers"]
  node_n_root_content["RootContent<br/>compose root<br/>[RootContent.kt]"]
  node_n_shell_ui["Shell UI<br/>compose nav"]
  node_n_walkie_service(("WalkieService<br/>foreground svc<br/>[WalkieService.kt]"))
  node_n_notification(("NotificationController<br/>service ui"))
end

subgraph group_g_core["Shared Core"]
  node_n_core_mvi["core/mvi<br/>mvi infra"]
  node_n_mvi_vm["MviViewModel<br/>base vm<br/>[MviViewModel.kt]"]
  node_n_mvi_reducer["Reducer<br/>mvi contract<br/>[Reducer.kt]"]
  node_n_mvi_processor["ActionProcessor<br/>mvi side effects<br/>[ActionProcessor.kt]"]
  node_n_mvi_init["InitStateFactory<br/>mvi init"]
  node_n_theme["core-ui theme<br/>compose theme"]
end

subgraph group_g_network["Network Service"]
  node_n_service_network["service-network<br/>network module"]
  node_n_channel_controller(("Channel controller<br/>network orchestrator"))
  node_n_nsd["NSD listeners<br/>discovery"]
  node_n_sockets["Socket transport<br/>[SocketClient.kt]"]
  node_n_network_data[("Network state<br/>repositories")]
  node_n_identity["Device identity<br/>identity utils<br/>[getDeviceID.kt]"]
end

subgraph group_g_voice["Voice Service"]
  node_n_service_voice["service-voice<br/>audio module"]
  node_n_voice_recorder(("VoiceRecorder<br/>audio capture<br/>[VoiceRecorder.kt]"))
  node_n_voice_player(("VoicePlayer<br/>audio playback<br/>[VoicePlayer.kt]"))
  node_n_voice_di["VoiceDi<br/>di wiring<br/>[VoiceDi.kt]"]
end

subgraph group_g_ptt["PTT Feature"]
  node_n_ptt_mod["feature-ptt<br/>feature module"]
  node_n_ptt_vm["PttViewModel<br/>feature vm<br/>[PttViewModel.kt]"]
  node_n_ptt_processor["PttActionProcessor<br/>feature effects"]
  node_n_ptt_state["PTT state<br/>ptt mvi"]
  node_n_ptt_reducers["PTT reducers"]
  node_n_ptt_ui["PTT UI<br/>compose screen"]
end

subgraph group_g_chat["Chat Feature"]
  node_n_chat_mod["feature-chat<br/>feature module"]
end

subgraph group_g_settings["Settings Feature"]
end

node_n_app -->|"starts"| node_n_ptt_application
node_n_app -->|"hosts"| node_n_main_activity
node_n_main_activity -->|"renders"| node_n_root_content
node_n_ptt_application -->|"injects"| node_n_main_vm
node_n_main_vm -->|"manages"| node_n_main_state
node_n_main_vm -->|"initializes"| node_n_main_factories
node_n_main_vm -->|"delegates"| node_n_main_reducers
node_n_main_vm -->|"extends"| node_n_core_mvi
node_n_main_reducers -->|"controls"| node_n_walkie_service
node_n_root_content -->|"composes"| node_n_shell_ui
node_n_shell_ui -->|"switches to"| node_n_ptt_mod
node_n_shell_ui -->|"switches to"| node_n_chat_mod
node_n_shell_ui -->|"styles with"| node_n_theme
node_n_walkie_service -->|"uses"| node_n_notification
node_n_walkie_service -->|"coordinates"| node_n_service_network
node_n_walkie_service -->|"coordinates"| node_n_service_voice
node_n_core_mvi -->|"provides"| node_n_mvi_vm
node_n_core_mvi -->|"provides"| node_n_mvi_reducer
node_n_core_mvi -->|"provides"| node_n_mvi_processor
node_n_core_mvi -->|"provides"| node_n_mvi_init
node_n_service_network -->|"orchestrates"| node_n_channel_controller
node_n_service_network -->|"discovers"| node_n_nsd
node_n_service_network -->|"transports"| node_n_sockets
node_n_service_network -->|"stores"| node_n_network_data
node_n_service_network -->|"identifies"| node_n_identity
node_n_service_voice -->|"captures"| node_n_voice_recorder
node_n_service_voice -->|"plays"| node_n_voice_player
node_n_service_voice -->|"wires"| node_n_voice_di
node_n_ptt_mod -->|"contains"| node_n_ptt_vm
node_n_ptt_vm -->|"uses"| node_n_ptt_processor
node_n_ptt_vm -->|"owns"| node_n_ptt_state
node_n_ptt_vm -->|"extends"| node_n_core_mvi
node_n_ptt_processor -->|"calls"| node_n_service_voice
node_n_ptt_processor -->|"calls"| node_n_service_network
node_n_ptt_processor -->|"emits"| node_n_ptt_reducers
node_n_ptt_reducers -->|"consumes"| node_n_service_voice
node_n_ptt_reducers -->|"consumes"| node_n_service_network
node_n_ptt_ui -->|"binds to"| node_n_ptt_vm
node_n_ptt_ui -->|"styles with"| node_n_theme

click node_n_app "https://github.com/devapro/lanwalkietalkie/tree/master/app"
click node_n_ptt_application "https://github.com/devapro/lanwalkietalkie/blob/master/app/src/main/java/pro/devapp/walkietalkiek/PttApplication.kt"
click node_n_main_activity "https://github.com/devapro/lanwalkietalkie/blob/master/app/src/main/java/pro/devapp/walkietalkiek/MainActivity.kt"
click node_n_main_vm "https://github.com/devapro/lanwalkietalkie/blob/master/app/src/main/java/pro/devapp/walkietalkiek/MainViewModel.kt"
click node_n_main_state "https://github.com/devapro/lanwalkietalkie/tree/master/app/src/main/java/pro/devapp/walkietalkiek/model"
click node_n_main_factories "https://github.com/devapro/lanwalkietalkie/tree/master/app/src/main/java/pro/devapp/walkietalkiek/factory"
click node_n_main_reducers "https://github.com/devapro/lanwalkietalkie/tree/master/app/src/main/java/pro/devapp/walkietalkiek/reducers"
click node_n_root_content "https://github.com/devapro/lanwalkietalkie/blob/master/app/src/main/java/pro/devapp/walkietalkiek/ui/RootContent.kt"
click node_n_shell_ui "https://github.com/devapro/lanwalkietalkie/tree/master/app/src/main/java/pro/devapp/walkietalkiek/ui/components"
click node_n_walkie_service "https://github.com/devapro/lanwalkietalkie/blob/master/app/src/main/java/pro/devapp/walkietalkiek/service/WalkieService.kt"
click node_n_notification "https://github.com/devapro/lanwalkietalkie/blob/master/app/src/main/java/pro/devapp/walkietalkiek/service/NotificationController.kt"
click node_n_core_mvi "https://github.com/devapro/lanwalkietalkie/tree/master/core/src/main/java/pro/devapp/walkietalkiek/core/mvi"
click node_n_mvi_vm "https://github.com/devapro/lanwalkietalkie/blob/master/core/src/main/java/pro/devapp/walkietalkiek/core/mvi/MviViewModel.kt"
click node_n_mvi_reducer "https://github.com/devapro/lanwalkietalkie/blob/master/core/src/main/java/pro/devapp/walkietalkiek/core/mvi/Reducer.kt"
click node_n_mvi_processor "https://github.com/devapro/lanwalkietalkie/blob/master/core/src/main/java/pro/devapp/walkietalkiek/core/mvi/ActionProcessor.kt"
click node_n_mvi_init "https://github.com/devapro/lanwalkietalkie/blob/master/core/src/main/java/pro/devapp/walkietalkiek/core/mvi/InitStateFactory.kt"
click node_n_theme "https://github.com/devapro/lanwalkietalkie/tree/master/core-ui/src/main/java/pro/devapp/walkietalkiek/core/theme"
click node_n_service_network "https://github.com/devapro/lanwalkietalkie/tree/master/serivce-network"
click node_n_channel_controller "https://github.com/devapro/lanwalkietalkie/blob/master/serivce-network/src/main/java/pro/devapp/walkietalkiek/serivce/network/ChanelControllerImpl.kt"
click node_n_nsd "https://github.com/devapro/lanwalkietalkie/tree/master/serivce-network/src/main/java/pro/devapp/walkietalkiek/serivce/network"
click node_n_sockets "https://github.com/devapro/lanwalkietalkie/blob/master/serivce-network/src/main/java/pro/devapp/walkietalkiek/serivce/network/SocketClient.kt"
click node_n_network_data "https://github.com/devapro/lanwalkietalkie/tree/master/serivce-network/src/main/java/pro/devapp/walkietalkiek/serivce/network/data"
click node_n_identity "https://github.com/devapro/lanwalkietalkie/blob/master/serivce-network/src/main/java/pro/devapp/walkietalkiek/serivce/network/getDeviceID.kt"
click node_n_service_voice "https://github.com/devapro/lanwalkietalkie/tree/master/service-voice"
click node_n_voice_recorder "https://github.com/devapro/lanwalkietalkie/blob/master/service-voice/src/main/java/pro/devapp/walkietalkiek/service/voice/VoiceRecorder.kt"
click node_n_voice_player "https://github.com/devapro/lanwalkietalkie/blob/master/service-voice/src/main/java/pro/devapp/walkietalkiek/service/voice/VoicePlayer.kt"
click node_n_voice_di "https://github.com/devapro/lanwalkietalkie/blob/master/service-voice/src/main/java/pro/devapp/walkietalkiek/service/voice/di/VoiceDi.kt"
click node_n_ptt_mod "https://github.com/devapro/lanwalkietalkie/tree/master/feature-ptt"
click node_n_ptt_vm "https://github.com/devapro/lanwalkietalkie/blob/master/feature-ptt/src/main/java/pro/devapp/walkietalkiek/feature/ptt/PttViewModel.kt"
click node_n_ptt_processor "https://github.com/devapro/lanwalkietalkie/blob/master/feature-ptt/src/main/java/pro/devapp/walkietalkiek/feature/ptt/PttActionProcessor.kt"
click node_n_ptt_state "https://github.com/devapro/lanwalkietalkie/tree/master/feature-ptt/src/main/java/pro/devapp/walkietalkiek/feature/ptt/model"
click node_n_ptt_reducers "https://github.com/devapro/lanwalkietalkie/tree/master/feature-ptt/src/main/java/pro/devapp/walkietalkiek/feature/ptt/reducer"
click node_n_ptt_ui "https://github.com/devapro/lanwalkietalkie/tree/master/feature-ptt/src/main/java/pro/devapp/walkietalkiek/feature/ptt/ui"
click node_n_chat_mod "https://github.com/devapro/lanwalkietalkie/tree/master/feature-chat"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_n_app,node_n_ptt_application,node_n_main_activity,node_n_main_vm,node_n_main_state,node_n_main_factories,node_n_main_reducers,node_n_root_content,node_n_shell_ui,node_n_walkie_service,node_n_notification toneBlue
class node_n_core_mvi,node_n_mvi_vm,node_n_mvi_reducer,node_n_mvi_processor,node_n_mvi_init,node_n_theme toneAmber
class node_n_service_network,node_n_channel_controller,node_n_nsd,node_n_sockets,node_n_network_data,node_n_identity toneMint
class node_n_service_voice,node_n_voice_recorder,node_n_voice_player,node_n_voice_di toneRose
class node_n_ptt_mod,node_n_ptt_vm,node_n_ptt_processor,node_n_ptt_state,node_n_ptt_reducers,node_n_ptt_ui toneIndigo
class node_n_chat_mod toneTeal
```

## Components

### App Shell

Application entry point, shell UI, permissions, and service boundary.

- [app](https://github.com/devapro/lanwalkietalkie/tree/master/app): android app · Android application shell and entry module. · `app`
- [PttApplication](https://github.com/devapro/lanwalkietalkie/blob/master/app/src/main/java/pro/devapp/walkietalkiek/PttApplication.kt): app entry · Application class that boots the app graph. · `app/src/main/java/pro/devapp/walkietalkiek/PttApplication.kt`
- [MainActivity](https://github.com/devapro/lanwalkietalkie/blob/master/app/src/main/java/pro/devapp/walkietalkiek/MainActivity.kt): activity · Primary activity hosting the Compose shell. · `app/src/main/java/pro/devapp/walkietalkiek/MainActivity.kt`
- [MainViewModel](https://github.com/devapro/lanwalkietalkie/blob/master/app/src/main/java/pro/devapp/walkietalkiek/MainViewModel.kt): shell vm · Drives initialization, permissions, and active tab selection. · `app/src/main/java/pro/devapp/walkietalkiek/MainViewModel.kt`
- [Main state](https://github.com/devapro/lanwalkietalkie/tree/master/app/src/main/java/pro/devapp/walkietalkiek/model): shell mvi · Main screen action, event, and state model. · `app/src/main/java/pro/devapp/walkietalkiek/model`
- [Shell factories](https://github.com/devapro/lanwalkietalkie/tree/master/app/src/main/java/pro/devapp/walkietalkiek/factory): state setup · Initial state and tab construction for the shell. · `app/src/main/java/pro/devapp/walkietalkiek/factory`
- [Shell reducers](https://github.com/devapro/lanwalkietalkie/tree/master/app/src/main/java/pro/devapp/walkietalkiek/reducers): mvi reducers · App startup, permission checks, and screen switching reducers. · `app/src/main/java/pro/devapp/walkietalkiek/reducers`
- [RootContent](https://github.com/devapro/lanwalkietalkie/blob/master/app/src/main/java/pro/devapp/walkietalkiek/ui/RootContent.kt): compose root · Top-level Compose container for the app shell. · `app/src/main/java/pro/devapp/walkietalkiek/ui/RootContent.kt`
- [Shell UI](https://github.com/devapro/lanwalkietalkie/tree/master/app/src/main/java/pro/devapp/walkietalkiek/ui/components): compose nav · Bottom tabs, rail tabs, tab content, and permission notice. · `app/src/main/java/pro/devapp/walkietalkiek/ui/components`
- [WalkieService](https://github.com/devapro/lanwalkietalkie/blob/master/app/src/main/java/pro/devapp/walkietalkiek/service/WalkieService.kt): foreground svc · Long-lived service boundary for network and audio activity. · `app/src/main/java/pro/devapp/walkietalkiek/service/WalkieService.kt`
- [NotificationController](https://github.com/devapro/lanwalkietalkie/blob/master/app/src/main/java/pro/devapp/walkietalkiek/service/NotificationController.kt): service ui · Manages the persistent foreground notification. · `app/src/main/java/pro/devapp/walkietalkiek/service/NotificationController.kt`

### Shared Core

Reusable MVI infrastructure and shared Compose theme.

- [core/mvi](https://github.com/devapro/lanwalkietalkie/tree/master/core/src/main/java/pro/devapp/walkietalkiek/core/mvi): mvi infra · Reusable ViewModel, reducer, processor, and init-state abstractions. · `core/src/main/java/pro/devapp/walkietalkiek/core/mvi`
- [MviViewModel](https://github.com/devapro/lanwalkietalkie/blob/master/core/src/main/java/pro/devapp/walkietalkiek/core/mvi/MviViewModel.kt): base vm · Shared MVI ViewModel base used by features. · `core/src/main/java/pro/devapp/walkietalkiek/core/mvi/MviViewModel.kt`
- [Reducer](https://github.com/devapro/lanwalkietalkie/blob/master/core/src/main/java/pro/devapp/walkietalkiek/core/mvi/Reducer.kt): mvi contract · Reducer contract for state transitions. · `core/src/main/java/pro/devapp/walkietalkiek/core/mvi/Reducer.kt`
- [ActionProcessor](https://github.com/devapro/lanwalkietalkie/blob/master/core/src/main/java/pro/devapp/walkietalkiek/core/mvi/ActionProcessor.kt): mvi side effects · Coordinates actions, side effects, and emitted events. · `core/src/main/java/pro/devapp/walkietalkiek/core/mvi/ActionProcessor.kt`
- [InitStateFactory](https://github.com/devapro/lanwalkietalkie/blob/master/core/src/main/java/pro/devapp/walkietalkiek/core/mvi/InitStateFactory.kt): mvi init · Creates initial UI state for screens. · `core/src/main/java/pro/devapp/walkietalkiek/core/mvi/InitStateFactory.kt`
- [core-ui theme](https://github.com/devapro/lanwalkietalkie/tree/master/core-ui/src/main/java/pro/devapp/walkietalkiek/core/theme): compose theme · Shared color, typography, and theme definitions. · `core-ui/src/main/java/pro/devapp/walkietalkiek/core/theme`

### Network Service

Local discovery, sockets, and network-facing state.

- [service-network](https://github.com/devapro/lanwalkietalkie/tree/master/serivce-network): network module · Peer discovery and socket transport for local LAN communication. · `serivce-network`
- [Channel controller](https://github.com/devapro/lanwalkietalkie/blob/master/serivce-network/src/main/java/pro/devapp/walkietalkiek/serivce/network/ChanelControllerImpl.kt): network orchestrator · Coordinates channel lifecycle and peer routing. · `serivce-network/src/main/java/pro/devapp/walkietalkiek/serivce/network/ChanelControllerImpl.kt`
- [NSD listeners](https://github.com/devapro/lanwalkietalkie/tree/master/serivce-network/src/main/java/pro/devapp/walkietalkiek/serivce/network): discovery · Service discovery and registration listeners. · `serivce-network/src/main/java/pro/devapp/walkietalkiek/serivce/network`
- [Socket transport](https://github.com/devapro/lanwalkietalkie/blob/master/serivce-network/src/main/java/pro/devapp/walkietalkiek/serivce/network/SocketClient.kt): transport · Client and server socket endpoints for bidirectional exchange. · `serivce-network/src/main/java/pro/devapp/walkietalkiek/serivce/network/SocketClient.kt`
- [Network state](https://github.com/devapro/lanwalkietalkie/tree/master/serivce-network/src/main/java/pro/devapp/walkietalkiek/serivce/network/data): repositories · Connected devices, device info, and message repositories. · `serivce-network/src/main/java/pro/devapp/walkietalkiek/serivce/network/data`
- [Device identity](https://github.com/devapro/lanwalkietalkie/blob/master/serivce-network/src/main/java/pro/devapp/walkietalkiek/serivce/network/getDeviceID.kt): identity utils · Device ID and client info resolution helpers. · `serivce-network/src/main/java/pro/devapp/walkietalkiek/serivce/network/getDeviceID.kt`

### Voice Service

Audio capture and playback for push-to-talk.

- [service-voice](https://github.com/devapro/lanwalkietalkie/tree/master/service-voice): audio module · Audio recording and playback layer for PTT. · `service-voice`
- [VoiceRecorder](https://github.com/devapro/lanwalkietalkie/blob/master/service-voice/src/main/java/pro/devapp/walkietalkiek/service/voice/VoiceRecorder.kt): audio capture · Captures microphone input for push-to-talk. · `service-voice/src/main/java/pro/devapp/walkietalkiek/service/voice/VoiceRecorder.kt`
- [VoicePlayer](https://github.com/devapro/lanwalkietalkie/blob/master/service-voice/src/main/java/pro/devapp/walkietalkiek/service/voice/VoicePlayer.kt): audio playback · Plays received voice audio to the speaker. · `service-voice/src/main/java/pro/devapp/walkietalkiek/service/voice/VoicePlayer.kt`
- [VoiceDi](https://github.com/devapro/lanwalkietalkie/blob/master/service-voice/src/main/java/pro/devapp/walkietalkiek/service/voice/di/VoiceDi.kt): di wiring · Dependency wiring for the voice layer. · `service-voice/src/main/java/pro/devapp/walkietalkiek/service/voice/di/VoiceDi.kt`

### PTT Feature

Main push-to-talk screen and voice interaction flow.

- [feature-ptt](https://github.com/devapro/lanwalkietalkie/tree/master/feature-ptt): feature module · Primary push-to-talk UI and interaction state machine. · `feature-ptt`
- [PttViewModel](https://github.com/devapro/lanwalkietalkie/blob/master/feature-ptt/src/main/java/pro/devapp/walkietalkiek/feature/ptt/PttViewModel.kt): feature vm · Feature ViewModel for push-to-talk state. · `feature-ptt/src/main/java/pro/devapp/walkietalkiek/feature/ptt/PttViewModel.kt`
- [PttActionProcessor](https://github.com/devapro/lanwalkietalkie/blob/master/feature-ptt/src/main/java/pro/devapp/walkietalkiek/feature/ptt/PttActionProcessor.kt): feature effects · Coordinates PTT actions and side effects. · `feature-ptt/src/main/java/pro/devapp/walkietalkiek/feature/ptt/PttActionProcessor.kt`
- [PTT state](https://github.com/devapro/lanwalkietalkie/tree/master/feature-ptt/src/main/java/pro/devapp/walkietalkiek/feature/ptt/model): ptt mvi · PTT actions, events, and screen state. · `feature-ptt/src/main/java/pro/devapp/walkietalkiek/feature/ptt/model`
- [PTT reducers](https://github.com/devapro/lanwalkietalkie/tree/master/feature-ptt/src/main/java/pro/devapp/walkietalkiek/feature/ptt/reducer): reducers · Recording, voice reception, and device list reducers. · `feature-ptt/src/main/java/pro/devapp/walkietalkiek/feature/ptt/reducer`
- [PTT UI](https://github.com/devapro/lanwalkietalkie/tree/master/feature-ptt/src/main/java/pro/devapp/walkietalkiek/feature/ptt/ui): compose screen · Responsive PTT layout, button, device list, and wave visualizer. · `feature-ptt/src/main/java/pro/devapp/walkietalkiek/feature/ptt/ui`

### Chat Feature

Text messaging companion screen and message flow.

- [feature-chat](https://github.com/devapro/lanwalkietalkie/tree/master/feature-chat): feature module · Text chat companion UI and message flow. · `feature-chat`

## Connections

- app → PttApplication: starts · Android runtime creates the application instance.
- app → MainActivity: hosts · Application module provides the main activity.
- MainActivity → RootContent: renders · Activity hosts the top-level Compose shell.
- PttApplication → MainViewModel: injects · Application wiring provides the shell ViewModel dependencies.
- MainViewModel → Main state: manages · ViewModel owns shell state and events.
- MainViewModel → Shell factories: initializes · Builds initial screen state and tabs.
- MainViewModel → Shell reducers: delegates · Uses reducers for startup and permission transitions.
- MainViewModel → core/mvi: extends · Shell ViewModel relies on shared MVI infrastructure.
- Shell reducers → WalkieService: controls · Reducers trigger service startup and readiness changes.
- RootContent → Shell UI: composes · Root content assembles shell navigation and notices.
- Shell UI → feature-ptt: switches to · Shell routes to the PTT feature tab.
- Shell UI → feature-chat: switches to · Shell routes to the chat feature tab.
- Shell UI → core-ui theme: styles with · Shared shell UI uses common theme definitions.
- WalkieService → NotificationController: uses · Foreground service relies on persistent notification management.
- WalkieService → service-network: coordinates · Service boundary keeps LAN transport alive.
- WalkieService → service-voice: coordinates · Service boundary keeps audio capture/playback alive.
- core/mvi → MviViewModel: provides · Reusable base ViewModel implementation.
- core/mvi → Reducer: provides · Shared reducer contract.
- core/mvi → ActionProcessor: provides · Shared action processor contract.
- core/mvi → InitStateFactory: provides · Shared initial state factory contract.
- service-network → Channel controller: orchestrates · Controller coordinates discovery and peer routing.
- service-network → NSD listeners: discovers · Uses NSD listeners for local service discovery.
- service-network → Socket transport: transports · Uses socket client/server for data exchange.
- service-network → Network state: stores · Repositories hold connected device and message state.
- service-network → Device identity: identifies · Helpers resolve peer and device identity.
- service-voice → VoiceRecorder: captures · Records microphone audio.
- service-voice → VoicePlayer: plays · Renders incoming audio.
- service-voice → VoiceDi: wires · Dependency graph for audio services.
- feature-ptt → PttViewModel: contains · Feature module exposes its ViewModel.
- PttViewModel → PttActionProcessor: uses · Feature ViewModel delegates side effects.
- PttViewModel → PTT state: owns · ViewModel manages PTT actions, events, and state.
- PttViewModel → core/mvi: extends · PTT ViewModel uses shared MVI base classes.
- PttActionProcessor → service-voice: calls · Action processing starts and stops audio capture.
- PttActionProcessor → service-network: calls · Action processing sends and receives LAN voice data.
- PttActionProcessor → PTT reducers: emits · Side effects feed reducers with events.
- PTT reducers → service-voice: consumes · Reducers react to recorded and received voice data.
- PTT reducers → service-network: consumes · Reducers react to connected device updates.
- PTT UI → PttViewModel: binds to · Compose UI observes PTT ViewModel state.
- PTT UI → core-ui theme: styles with · PTT screen uses shared theme.
