# mpereira-o/ic_esteira architecture

> Architecture diagram of the GitHub repository mpereira-o/ic_esteira, 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/mpereira-o/ic_esteira
- Repository: https://github.com/mpereira-o/ic_esteira

## Overview

O produto é um sistema distribuído de inspeção de peças em esteira: o nó Raspberry Pi fornece vídeo e controle físico, o processador YOLO detecta e conta peças, e o aplicativo opera a esteira, acompanha telemetria e gera relatórios. As arestas seguem chamadas visíveis ou relações explicitadas no README; os detalhes internos de módulos não amostrados foram mantidos no nível de subsistema.

Main entry points: [`App_Mobile/app/(tabs)/index.tsx`](https://github.com/mpereira-o/ic_esteira/blob/main/App_Mobile/app/(tabs)/index.tsx) (Dashboard móvel), [`App_Mobile/hooks/useMqtt.ts`](https://github.com/mpereira-o/ic_esteira/blob/main/App_Mobile/hooks/useMqtt.ts) (Cliente MQTT), [`Backend_Raspberry/firmware`](https://github.com/mpereira-o/ic_esteira/tree/main/Backend_Raspberry/firmware) (Controle embarcado), [`Backend_Raspberry/processamentoPc/processador_yolo.py`](https://github.com/mpereira-o/ic_esteira/blob/main/Backend_Raspberry/processamentoPc/processador_yolo.py) (Processador YOLO)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_edge["Nó de borda"]
  node_edge_control["Controle embarcado"]
  node_camera_stream["Stream da câmera<br/>[server.py]"]
  node_camera_transmission["Transmissão da câmera"]
end

subgraph group_vision["Visão e contagem"]
  node_vision_processor["Processador YOLO"]
  node_inspection_stream["Vídeo anotado"]
end

subgraph group_mobile["Aplicativo móvel"]
  node_app["Dashboard móvel<br/>[index.tsx]"]
  node_mqtt_hook["Cliente MQTT<br/>[useMqtt.ts]"]
  node_mqtt_panel["Painel MQTT<br/>[mqttPainel.tsx]"]
  node_about["Sobre<br/>[sobre.tsx]"]
end

subgraph group_reports["Relatórios e edição"]
  node_photo_editor["Editor de imagens<br/>[editar_foto.tsx]"]
  node_image_report["Relatório de imagens"]
  node_production_report["Relatório de produção<br/>[usePdf.ts]"]
end

node_operator(("Operador"))
node_broker(("Broker MQTT"))

node_operator -->|"opera"| node_app
node_app -->|"usa"| node_mqtt_hook
node_app -->|"renderiza"| node_mqtt_panel
node_mqtt_hook -->|"conecta e troca"| node_broker
node_vision_processor -->|"publica contagens"| node_broker
node_broker -->|"envia telemetria"| node_mqtt_hook
node_mqtt_hook -->|"publica comandos"| node_broker
node_broker -->|"repassa comandos"| node_edge_control
node_edge_control -.->|"fornece vídeo"| node_camera_stream
node_camera_stream -->|"serve frames"| node_vision_processor
node_vision_processor -->|"serve vídeo anotado"| node_inspection_stream
node_edge_control -->|"transmite vídeo"| node_app
node_app -->|"gera PDF"| node_production_report
node_photo_editor -.->|"gera relatório"| node_image_report

click node_app "https://github.com/mpereira-o/ic_esteira/blob/main/App_Mobile/app/(tabs)/index.tsx"
click node_mqtt_hook "https://github.com/mpereira-o/ic_esteira/blob/main/App_Mobile/hooks/useMqtt.ts"
click node_mqtt_panel "https://github.com/mpereira-o/ic_esteira/blob/main/App_Mobile/components/mqttPainel.tsx"
click node_edge_control "https://github.com/mpereira-o/ic_esteira/tree/main/Backend_Raspberry/firmware"
click node_camera_stream "https://github.com/mpereira-o/ic_esteira/blob/main/Backend_Raspberry/firmware/server.py"
click node_camera_transmission "https://github.com/mpereira-o/ic_esteira/blob/main/Backend_Raspberry/firmware/transmissao_camera.py"
click node_vision_processor "https://github.com/mpereira-o/ic_esteira/blob/main/Backend_Raspberry/processamentoPc/processador_yolo.py"
click node_inspection_stream "https://github.com/mpereira-o/ic_esteira/blob/main/Backend_Raspberry/processamentoPc/processador_yolo.py"
click node_photo_editor "https://github.com/mpereira-o/ic_esteira/blob/main/App_Mobile/app/(tabs)/editar_foto.tsx"
click node_image_report "https://github.com/mpereira-o/ic_esteira/blob/main/App_Mobile/hooks/useImageReportPdf.ts"
click node_production_report "https://github.com/mpereira-o/ic_esteira/blob/main/App_Mobile/hooks/usePdf.ts"
click node_about "https://github.com/mpereira-o/ic_esteira/blob/main/App_Mobile/app/(tabs)/sobre.tsx"

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_edge_control,node_camera_stream,node_camera_transmission toneBlue
class node_vision_processor,node_inspection_stream toneAmber
class node_app,node_mqtt_hook,node_mqtt_panel,node_about toneMint
class node_photo_editor,node_image_report,node_production_report toneRose
class node_operator,node_broker toneIndigo
```

## Components

### Nó de borda

- [Controle embarcado](https://github.com/mpereira-o/ic_esteira/tree/main/Backend_Raspberry/firmware): `Backend_Raspberry/firmware`
- [Stream da câmera](https://github.com/mpereira-o/ic_esteira/blob/main/Backend_Raspberry/firmware/server.py): `Backend_Raspberry/firmware/server.py`
- [Transmissão da câmera](https://github.com/mpereira-o/ic_esteira/blob/main/Backend_Raspberry/firmware/transmissao_camera.py): `Backend_Raspberry/firmware/transmissao_camera.py`

### Visão e contagem

- [Processador YOLO](https://github.com/mpereira-o/ic_esteira/blob/main/Backend_Raspberry/processamentoPc/processador_yolo.py): `Backend_Raspberry/processamentoPc/processador_yolo.py`
- [Vídeo anotado](https://github.com/mpereira-o/ic_esteira/blob/main/Backend_Raspberry/processamentoPc/processador_yolo.py): `Backend_Raspberry/processamentoPc/processador_yolo.py`

### Aplicativo móvel

- [Dashboard móvel](https://github.com/mpereira-o/ic_esteira/blob/main/App_Mobile/app/(tabs)/index.tsx): `App_Mobile/app/(tabs)/index.tsx`
- [Cliente MQTT](https://github.com/mpereira-o/ic_esteira/blob/main/App_Mobile/hooks/useMqtt.ts): `App_Mobile/hooks/useMqtt.ts`
- [Painel MQTT](https://github.com/mpereira-o/ic_esteira/blob/main/App_Mobile/components/mqttPainel.tsx): `App_Mobile/components/mqttPainel.tsx`
- [Sobre](https://github.com/mpereira-o/ic_esteira/blob/main/App_Mobile/app/(tabs)/sobre.tsx): `App_Mobile/app/(tabs)/sobre.tsx`

### Relatórios e edição

- [Editor de imagens](https://github.com/mpereira-o/ic_esteira/blob/main/App_Mobile/app/(tabs)/editar_foto.tsx): `App_Mobile/app/(tabs)/editar_foto.tsx`
- [Relatório de imagens](https://github.com/mpereira-o/ic_esteira/blob/main/App_Mobile/hooks/useImageReportPdf.ts): `App_Mobile/hooks/useImageReportPdf.ts`
- [Relatório de produção](https://github.com/mpereira-o/ic_esteira/blob/main/App_Mobile/hooks/usePdf.ts): `App_Mobile/hooks/usePdf.ts`

### Other components

- **Operador**
- **Broker MQTT**

## Connections

- Operador → Dashboard móvel: opera (evidence: `README.md`)
- Dashboard móvel → Cliente MQTT: usa (evidence: `App_Mobile/app/(tabs)/index.tsx`)
- Dashboard móvel → Painel MQTT: renderiza (evidence: `App_Mobile/app/(tabs)/index.tsx`)
- Cliente MQTT → Broker MQTT: conecta e troca (evidence: `App_Mobile/hooks/useMqtt.ts`)
- Processador YOLO → Broker MQTT: publica contagens (evidence: `README.md`)
- Broker MQTT → Cliente MQTT: envia telemetria (evidence: `README.md`)
- Cliente MQTT → Broker MQTT: publica comandos (evidence: `App_Mobile/hooks/useMqtt.ts`)
- Broker MQTT → Controle embarcado: repassa comandos (evidence: `README.md`)
- Controle embarcado → Stream da câmera: fornece vídeo
- Stream da câmera → Processador YOLO: serve frames (evidence: `README.md`)
- Processador YOLO → Vídeo anotado: serve vídeo anotado (evidence: `Backend_Raspberry/processamentoPc/processador_yolo.py`)
- Controle embarcado → Dashboard móvel: transmite vídeo (evidence: `README.md`)
- Dashboard móvel → Relatório de produção: gera PDF (evidence: `App_Mobile/app/(tabs)/index.tsx`)
- Editor de imagens → Relatório de imagens: gera relatório
