# syph3r-d/morseflash_rn_cli architecture

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

- Interactive diagram: https://gitdiagram.com/syph3r-d/morseflash_rn_cli
- Repository: https://github.com/syph3r-d/morseflash_rn_cli

## Overview

MorseFlash is a React Native app for sending messages as flashlight Morse signals and receiving them through a camera. Users enter text, convert it to Morse, and transmit timed pulses; on reception, camera brightness changes are analyzed into Morse and decoded as text. The shared utility module handles text/code conversion, while the Android native module controls the torch. The graph reflects sampled implementation; the native bridge’s JavaScript-to-Android connection is inferred from the matching module name and shown as unverified.

Main entry points: [`views/Receive.tsx`](https://github.com/syph3r-d/morseflash_rn_cli/blob/main/views/Receive.tsx) (Receive screen), [`App.tsx`](https://github.com/syph3r-d/morseflash_rn_cli/blob/main/App.tsx) (Navigation app), [`views/Transmit.tsx`](https://github.com/syph3r-d/morseflash_rn_cli/blob/main/views/Transmit.tsx) (Transmit screen), [`android/app/src/main/java/com/morseflash_rn_cli/NativeFlashlightModule.kt`](https://github.com/syph3r-d/morseflash_rn_cli/blob/main/android/app/src/main/java/com/morseflash_rn_cli/NativeFlashlightModule.kt) (Torch module)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App navigation"]
  node_app["Navigation app<br/>[App.tsx]"]
end

subgraph group_transmit["Morse transmission"]
  node_transmit["Transmit screen<br/>[Transmit.tsx]"]
  node_codec["Morse codec<br/>[index.ts]"]
end

subgraph group_receive["Morse reception"]
  node_receive["Receive screen<br/>[Receive.tsx]"]
  node_overlay["Target overlay<br/>[SquareOverlay.tsx]"]
end

subgraph group_native["Android flashlight"]
  node_jsbridge["Flashlight spec"]
  node_package["Native package"]
  node_module["Torch module"]
  node_application["Android host<br/>[MainApplication.kt]"]
end

node_user(("User"))
node_camera["Camera frames"]
node_torch["Device flashlight"]

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_transmit
node_app -->|"routes to"| node_receive
node_transmit -->|"encodes text"| node_codec
node_transmit -->|"calls torch"| node_jsbridge
node_jsbridge -.->|"bridges to"| node_module
node_application -->|"registers"| node_package
node_package -->|"provides"| node_module
node_module -->|"toggles"| node_torch
node_camera -->|"supplies frames"| node_receive
node_receive -->|"renders"| node_overlay
node_receive -->|"decodes Morse"| node_codec

click node_app "https://github.com/syph3r-d/morseflash_rn_cli/blob/main/App.tsx"
click node_transmit "https://github.com/syph3r-d/morseflash_rn_cli/blob/main/views/Transmit.tsx"
click node_receive "https://github.com/syph3r-d/morseflash_rn_cli/blob/main/views/Receive.tsx"
click node_codec "https://github.com/syph3r-d/morseflash_rn_cli/blob/main/utils/index.ts"
click node_overlay "https://github.com/syph3r-d/morseflash_rn_cli/blob/main/components/SquareOverlay.tsx"
click node_jsbridge "https://github.com/syph3r-d/morseflash_rn_cli/blob/main/specs/NativeFlashlight.ts"
click node_package "https://github.com/syph3r-d/morseflash_rn_cli/blob/main/android/app/src/main/java/com/morseflash_rn_cli/NativeFlashlightPackage.kt"
click node_module "https://github.com/syph3r-d/morseflash_rn_cli/blob/main/android/app/src/main/java/com/morseflash_rn_cli/NativeFlashlightModule.kt"
click node_application "https://github.com/syph3r-d/morseflash_rn_cli/blob/main/android/app/src/main/java/com/morseflash_rn_cli/MainApplication.kt"

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_app,node_user toneBlue
class node_transmit,node_codec toneAmber
class node_receive,node_overlay toneMint
class node_jsbridge,node_package,node_module,node_application toneRose
class node_camera,node_torch toneIndigo
```

## Components

### App navigation

- [Navigation app](https://github.com/syph3r-d/morseflash_rn_cli/blob/main/App.tsx): `App.tsx`

### Morse transmission

- [Transmit screen](https://github.com/syph3r-d/morseflash_rn_cli/blob/main/views/Transmit.tsx): `views/Transmit.tsx`
- [Morse codec](https://github.com/syph3r-d/morseflash_rn_cli/blob/main/utils/index.ts): `utils/index.ts`

### Morse reception

- [Receive screen](https://github.com/syph3r-d/morseflash_rn_cli/blob/main/views/Receive.tsx): `views/Receive.tsx`
- [Target overlay](https://github.com/syph3r-d/morseflash_rn_cli/blob/main/components/SquareOverlay.tsx): `components/SquareOverlay.tsx`

### Android flashlight

- [Flashlight spec](https://github.com/syph3r-d/morseflash_rn_cli/blob/main/specs/NativeFlashlight.ts): `specs/NativeFlashlight.ts`
- [Native package](https://github.com/syph3r-d/morseflash_rn_cli/blob/main/android/app/src/main/java/com/morseflash_rn_cli/NativeFlashlightPackage.kt): `android/app/src/main/java/com/morseflash_rn_cli/NativeFlashlightPackage.kt`
- [Torch module](https://github.com/syph3r-d/morseflash_rn_cli/blob/main/android/app/src/main/java/com/morseflash_rn_cli/NativeFlashlightModule.kt): `android/app/src/main/java/com/morseflash_rn_cli/NativeFlashlightModule.kt`
- [Android host](https://github.com/syph3r-d/morseflash_rn_cli/blob/main/android/app/src/main/java/com/morseflash_rn_cli/MainApplication.kt): `android/app/src/main/java/com/morseflash_rn_cli/MainApplication.kt`

### Other components

- **User**
- **Camera frames**
- **Device flashlight**

## Connections

- User → Navigation app: uses (evidence: `README.md`)
- Navigation app → Transmit screen: routes to (evidence: `App.tsx`)
- Navigation app → Receive screen: routes to (evidence: `App.tsx`)
- Transmit screen → Morse codec: encodes text (evidence: `views/Transmit.tsx`)
- Transmit screen → Flashlight spec: calls torch (evidence: `views/Transmit.tsx`)
- Flashlight spec → Torch module: bridges to
- Android host → Native package: registers (evidence: `android/app/src/main/java/com/morseflash_rn_cli/MainApplication.kt`)
- Native package → Torch module: provides (evidence: `android/app/src/main/java/com/morseflash_rn_cli/NativeFlashlightPackage.kt`)
- Torch module → Device flashlight: toggles (evidence: `android/app/src/main/java/com/morseflash_rn_cli/NativeFlashlightModule.kt`)
- Camera frames → Receive screen: supplies frames (evidence: `views/Receive.tsx`)
- Receive screen → Target overlay: renders (evidence: `views/Receive.tsx`)
- Receive screen → Morse codec: decodes Morse (evidence: `views/Receive.tsx`)
