# andre-barros/react-native-rfid-chainway-c72 architecture

> Architecture diagram of the GitHub repository andre-barros/react-native-rfid-chainway-c72, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/andre-barros/react-native-rfid-chainway-c72
- Repository: https://github.com/andre-barros/react-native-rfid-chainway-c72

## Overview

This repository is a React Native bridge for Chainway C72 RFID reader operations. An app calls the JavaScript API to initialize the reader, scan tags, inspect or change power, write EPC data, or find a tag; Android performs the hardware operations and emits reader/tag events for JavaScript listeners. The Android implementation and JS event handling are excerpted. The iOS implementation exists in the tree, but its behavior was not sampled, so its connection is shown as unverified.

Main entry points: [`android/src/main/java/com/rfidchainwayc72/RfidChainwayC72Module.kt`](https://github.com/andre-barros/react-native-rfid-chainway-c72/blob/master/android/src/main/java/com/rfidchainwayc72/RfidChainwayC72Module.kt) (Android reader module), [`src/NativeRfidChainwayC72.ts`](https://github.com/andre-barros/react-native-rfid-chainway-c72/blob/master/src/NativeRfidChainwayC72.ts) (TurboModule spec), [`src/index.tsx`](https://github.com/andre-barros/react-native-rfid-chainway-c72/blob/master/src/index.tsx) (Reader API), [`android/src/main/java/com/rfidchainwayc72/RfidChainwayC72Package.kt`](https://github.com/andre-barros/react-native-rfid-chainway-c72/blob/master/android/src/main/java/com/rfidchainwayc72/RfidChainwayC72Package.kt) (Android module registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_js["JavaScript API"]
  node_api["Reader API<br/>[index.tsx]"]
  node_bridge["TurboModule spec"]
  node_eventlisteners["Event listeners<br/>[index.tsx]"]
end

subgraph group_native["Native reader"]
  node_androidmodule["Android reader module"]
  node_tagworker["Tag inventory worker"]
  node_androidpackage["Android module registration"]
  node_iosmodule["iOS reader module<br/>[RfidChainwayC72.mm]"]
end

node_app(("React Native app"))
node_rfidreader["Chainway RFID reader"]
node_rnbridge["React Native events"]

node_app -->|"calls operations"| node_api
node_api -->|"delegates operations"| node_bridge
node_androidpackage -->|"registers module"| node_androidmodule
node_androidmodule -->|"controls reader"| node_rfidreader
node_androidmodule -->|"starts worker"| node_tagworker
node_tagworker -->|"reads tag buffer"| node_rfidreader
node_androidmodule -->|"emits events"| node_rnbridge
node_eventlisteners -->|"subscribes events"| node_rnbridge
node_bridge -.->|"maps native calls"| node_androidmodule
node_bridge -.->|"maps native calls"| node_iosmodule

click node_api "https://github.com/andre-barros/react-native-rfid-chainway-c72/blob/master/src/index.tsx"
click node_bridge "https://github.com/andre-barros/react-native-rfid-chainway-c72/blob/master/src/NativeRfidChainwayC72.ts"
click node_eventlisteners "https://github.com/andre-barros/react-native-rfid-chainway-c72/blob/master/src/index.tsx"
click node_androidmodule "https://github.com/andre-barros/react-native-rfid-chainway-c72/blob/master/android/src/main/java/com/rfidchainwayc72/RfidChainwayC72Module.kt"
click node_tagworker "https://github.com/andre-barros/react-native-rfid-chainway-c72/blob/master/android/src/main/java/com/rfidchainwayc72/RfidChainwayC72Module.kt"
click node_androidpackage "https://github.com/andre-barros/react-native-rfid-chainway-c72/blob/master/android/src/main/java/com/rfidchainwayc72/RfidChainwayC72Package.kt"
click node_iosmodule "https://github.com/andre-barros/react-native-rfid-chainway-c72/blob/master/ios/RfidChainwayC72.mm"

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_api,node_bridge,node_eventlisteners toneBlue
class node_androidmodule,node_tagworker,node_androidpackage,node_iosmodule toneAmber
class node_app,node_rfidreader,node_rnbridge toneIndigo
```

## Components

### JavaScript API

- [Reader API](https://github.com/andre-barros/react-native-rfid-chainway-c72/blob/master/src/index.tsx): `src/index.tsx`
- [TurboModule spec](https://github.com/andre-barros/react-native-rfid-chainway-c72/blob/master/src/NativeRfidChainwayC72.ts): `src/NativeRfidChainwayC72.ts`
- [Event listeners](https://github.com/andre-barros/react-native-rfid-chainway-c72/blob/master/src/index.tsx): `src/index.tsx`

### Native reader

- [Android reader module](https://github.com/andre-barros/react-native-rfid-chainway-c72/blob/master/android/src/main/java/com/rfidchainwayc72/RfidChainwayC72Module.kt): `android/src/main/java/com/rfidchainwayc72/RfidChainwayC72Module.kt`
- [Tag inventory worker](https://github.com/andre-barros/react-native-rfid-chainway-c72/blob/master/android/src/main/java/com/rfidchainwayc72/RfidChainwayC72Module.kt): `android/src/main/java/com/rfidchainwayc72/RfidChainwayC72Module.kt`
- [Android module registration](https://github.com/andre-barros/react-native-rfid-chainway-c72/blob/master/android/src/main/java/com/rfidchainwayc72/RfidChainwayC72Package.kt): `android/src/main/java/com/rfidchainwayc72/RfidChainwayC72Package.kt`
- [iOS reader module](https://github.com/andre-barros/react-native-rfid-chainway-c72/blob/master/ios/RfidChainwayC72.mm): `ios/RfidChainwayC72.mm`

### Other components

- **React Native app**
- **Chainway RFID reader**
- **React Native events**

## Connections

- React Native app → Reader API: calls operations (evidence: `README.md`)
- Reader API → TurboModule spec: delegates operations (evidence: `src/index.tsx`)
- Android module registration → Android reader module: registers module (evidence: `android/src/main/java/com/rfidchainwayc72/RfidChainwayC72Package.kt`)
- Android reader module → Chainway RFID reader: controls reader (evidence: `android/src/main/java/com/rfidchainwayc72/RfidChainwayC72Module.kt`)
- Android reader module → Tag inventory worker: starts worker (evidence: `android/src/main/java/com/rfidchainwayc72/RfidChainwayC72Module.kt`)
- Tag inventory worker → Chainway RFID reader: reads tag buffer (evidence: `android/src/main/java/com/rfidchainwayc72/RfidChainwayC72Module.kt`)
- Android reader module → React Native events: emits events (evidence: `android/src/main/java/com/rfidchainwayc72/RfidChainwayC72Module.kt`)
- Event listeners → React Native events: subscribes events (evidence: `src/index.tsx`)
- TurboModule spec → Android reader module: maps native calls
- TurboModule spec → iOS reader module: maps native calls
