# andreibuenopt-ops/checklist-producao architecture

> Architecture diagram of the GitHub repository andreibuenopt-ops/checklist-producao, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/andreibuenopt-ops/checklist-producao
- Repository: https://github.com/andreibuenopt-ops/checklist-producao

## Overview

Checklist Diário Rotineiro is a Streamlit application for recording and managing production inspections across nine MDF-plant areas, with Supabase-backed storage. The main workflow is operator login, QR- or page-selected checklist entry for the production shift, incremental answer/photo capture, and supervisor-level sign-off; dashboard and history provide review and reporting. Separate branches cover line stoppages, Ecoresinator inspections, adherence, 5 Whys, administration, suggestions, and QR/PDF exports. Edges reflect README workflow statements and SOURCE INDEX references; unsampled implementations are represented by their known paths, without inferring internal calls.

Main entry points: [`src/models.py`](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/models.py) (Checklist data access), [`src/preenchimento_ui.py`](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/preenchimento_ui.py) (Checklist form), [`app.py`](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/app.py) (Home and QR entry), [`src/paradas_ui.py`](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/paradas_ui.py) (Stoppage interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and access"]
  node_app["Home and QR entry<br/>[app.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_sidebar["User sidebar<br/>[sidebar.py]"]
end

subgraph group_inspection["Inspection workflows"]
  node_checklist_page["Checklist page"]
  node_checklist_form["Checklist form"]
  node_shift_rules["Shift calendar<br/>[turnos.py]"]
  node_photo_service["Inspection photos<br/>[fotos.py]"]
  node_stop_page["Line stoppage page"]
  node_stop_rules["Stoppage records<br/>[paradas.py]"]
  node_stop_ui["Stoppage interface<br/>[paradas_ui.py]"]
  node_eco_page["Ecoresinator page"]
  node_eco_ui["Ecoresinator interface<br/>[ecoresinator_ui.py]"]
  node_eco_records["Ecoresinator records<br/>[ecoresinator.py]"]
end

subgraph group_operations["Operations and analysis"]
  node_dashboard["Dashboard<br/>[2_📊_Dashboard.py]"]
  node_history["Checklist history<br/>[8_📜_Histórico.py]"]
  node_history_ui["History viewer<br/>[historico_ui.py]"]
  node_adherence["Adherence reports<br/>[9_📈_Aderência.py]"]
  node_why5["5 Whys analysis<br/>[6_🔍_5_Porquês.py]"]
end

subgraph group_management["Administration"]
  node_admin["Administration"]
  node_suggestions["Inspection suggestions<br/>[5_💡_Sugestões.py]"]
  node_qr_page["QR code management"]
  node_qr_generator["QR and poster generator<br/>[qrcode_gen.py]"]
end

subgraph group_platform["Data and exports"]
  node_data_models["Checklist data access<br/>[models.py]"]
  node_supabase_client["Supabase client<br/>[db.py]"]
  node_supabase[("Supabase database")]
  node_pdf_exports["PDF exports<br/>[pdf_utils.py]"]
end

node_operator(("Plant user"))

node_operator -->|"opens app"| node_app
node_app -->|"requires login"| node_auth
node_app -->|"renders QR checklist"| node_checklist_form
node_operator -->|"selects checklist"| node_checklist_page
node_checklist_page -->|"renders form"| node_checklist_form
node_checklist_form -->|"saves answers"| node_data_models
node_checklist_form -->|"uses shift"| node_shift_rules
node_checklist_form -->|"uploads photos"| node_photo_service
node_checklist_form -->|"renders past record"| node_history_ui
node_checklist_form -->|"requests sign-off"| node_operator
node_data_models -->|"queries"| node_supabase_client
node_auth -->|"authenticates"| node_supabase_client
node_supabase_client -->|"connects"| node_supabase
node_stop_page -->|"renders stoppage"| node_stop_ui
node_stop_page -->|"uses records"| node_stop_rules
node_stop_ui -->|"manages stoppage"| node_stop_rules
node_stop_ui -->|"uploads photos"| node_photo_service
node_eco_page -->|"renders routine"| node_eco_ui
node_eco_ui -->|"loads and saves"| node_eco_records
node_dashboard -->|"loads indicators"| node_data_models
node_dashboard -->|"exports report"| node_pdf_exports
node_history -->|"shows records"| node_history_ui
node_history -->|"loads records"| node_data_models
node_adherence -->|"loads checklist data"| node_data_models
node_adherence -->|"exports monthly report"| node_pdf_exports
node_why5 -->|"loads analysis data"| node_data_models
node_admin -->|"manages templates"| node_data_models
node_admin -->|"manages users"| node_auth
node_suggestions -->|"submits suggestions"| node_data_models
node_qr_page -->|"generates codes"| node_qr_generator
node_qr_page -->|"loads area data"| node_data_models

click node_app "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/app.py"
click node_auth "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/auth.py"
click node_sidebar "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/sidebar.py"
click node_checklist_page "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/pages/1_%F0%9F%93%8B_Preencher_Checklist.py"
click node_checklist_form "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/preenchimento_ui.py"
click node_shift_rules "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/turnos.py"
click node_photo_service "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/fotos.py"
click node_stop_page "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/pages/10_%F0%9F%9B%91_Parada_de_Linha.py"
click node_stop_rules "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/paradas.py"
click node_stop_ui "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/paradas_ui.py"
click node_eco_page "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/pages/7_%F0%9F%A7%AA_Ecoresinator.py"
click node_eco_ui "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/ecoresinator_ui.py"
click node_eco_records "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/ecoresinator.py"
click node_dashboard "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/pages/2_%F0%9F%93%8A_Dashboard.py"
click node_history "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/pages/8_%F0%9F%93%9C_Hist%C3%B3rico.py"
click node_history_ui "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/historico_ui.py"
click node_adherence "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/pages/9_%F0%9F%93%88_Ader%C3%AAncia.py"
click node_why5 "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/pages/6_%F0%9F%94%8D_5_Porqu%C3%AAs.py"
click node_admin "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/pages/4_%F0%9F%9B%A0%EF%B8%8F_Administra%C3%A7%C3%A3o.py"
click node_suggestions "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/pages/5_%F0%9F%92%A1_Sugest%C3%B5es.py"
click node_qr_page "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/pages/3_%F0%9F%96%A8%EF%B8%8F_Gerar_QRCodes.py"
click node_qr_generator "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/qrcode_gen.py"
click node_data_models "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/models.py"
click node_supabase_client "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/db.py"
click node_pdf_exports "https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/pdf_utils.py"

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_auth,node_sidebar,node_operator toneBlue
class node_checklist_page,node_checklist_form,node_shift_rules,node_photo_service,node_stop_page,node_stop_rules,node_stop_ui,node_eco_page,node_eco_ui,node_eco_records toneAmber
class node_dashboard,node_history,node_history_ui,node_adherence,node_why5 toneMint
class node_admin,node_suggestions,node_qr_page,node_qr_generator toneRose
class node_data_models,node_supabase_client,node_supabase,node_pdf_exports toneIndigo
```

## Components

### Entry and access

- [Home and QR entry](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/app.py): `app.py`
- [Authentication](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/auth.py): `src/auth.py`
- [User sidebar](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/sidebar.py): `src/sidebar.py`

### Inspection workflows

- [Checklist page](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/pages/1_%F0%9F%93%8B_Preencher_Checklist.py): `pages/1_📋_Preencher_Checklist.py`
- [Checklist form](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/preenchimento_ui.py): `src/preenchimento_ui.py`
- [Shift calendar](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/turnos.py): `src/turnos.py`
- [Inspection photos](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/fotos.py): `src/fotos.py`
- [Line stoppage page](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/pages/10_%F0%9F%9B%91_Parada_de_Linha.py): `pages/10_🛑_Parada_de_Linha.py`
- [Stoppage records](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/paradas.py): `src/paradas.py`
- [Stoppage interface](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/paradas_ui.py): `src/paradas_ui.py`
- [Ecoresinator page](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/pages/7_%F0%9F%A7%AA_Ecoresinator.py): `pages/7_🧪_Ecoresinator.py`
- [Ecoresinator interface](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/ecoresinator_ui.py): `src/ecoresinator_ui.py`
- [Ecoresinator records](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/ecoresinator.py): `src/ecoresinator.py`

### Operations and analysis

- [Dashboard](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/pages/2_%F0%9F%93%8A_Dashboard.py): `pages/2_📊_Dashboard.py`
- [Checklist history](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/pages/8_%F0%9F%93%9C_Hist%C3%B3rico.py): `pages/8_📜_Histórico.py`
- [History viewer](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/historico_ui.py): `src/historico_ui.py`
- [Adherence reports](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/pages/9_%F0%9F%93%88_Ader%C3%AAncia.py): `pages/9_📈_Aderência.py`
- [5 Whys analysis](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/pages/6_%F0%9F%94%8D_5_Porqu%C3%AAs.py): `pages/6_🔍_5_Porquês.py`

### Administration

- [Administration](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/pages/4_%F0%9F%9B%A0%EF%B8%8F_Administra%C3%A7%C3%A3o.py): `pages/4_🛠️_Administração.py`
- [Inspection suggestions](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/pages/5_%F0%9F%92%A1_Sugest%C3%B5es.py): `pages/5_💡_Sugestões.py`
- [QR code management](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/pages/3_%F0%9F%96%A8%EF%B8%8F_Gerar_QRCodes.py): `pages/3_🖨️_Gerar_QRCodes.py`
- [QR and poster generator](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/qrcode_gen.py): `src/qrcode_gen.py`

### Data and exports

- [Checklist data access](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/models.py): `src/models.py`
- [Supabase client](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/db.py): `src/db.py`
- **Supabase database**
- [PDF exports](https://github.com/andreibuenopt-ops/checklist-producao/blob/main/src/pdf_utils.py): `src/pdf_utils.py`

### Other components

- **Plant user**

## Connections

- Plant user → Home and QR entry: opens app
- Home and QR entry → Authentication: requires login (evidence: `app.py`)
- Home and QR entry → Checklist form: renders QR checklist (evidence: `app.py`)
- Plant user → Checklist page: selects checklist
- Checklist page → Checklist form: renders form (evidence: `pages/1_📋_Preencher_Checklist.py`)
- Checklist form → Checklist data access: saves answers (evidence: `src/preenchimento_ui.py`)
- Checklist form → Shift calendar: uses shift (evidence: `src/preenchimento_ui.py`)
- Checklist form → Inspection photos: uploads photos (evidence: `src/preenchimento_ui.py`)
- Checklist form → History viewer: renders past record (evidence: `src/preenchimento_ui.py`)
- Checklist form → Plant user: requests sign-off
- Checklist data access → Supabase client: queries (evidence: `src/models.py`)
- Authentication → Supabase client: authenticates (evidence: `src/auth.py`)
- Supabase client → Supabase database: connects (evidence: `src/db.py`)
- Line stoppage page → Stoppage interface: renders stoppage (evidence: `pages/10_🛑_Parada_de_Linha.py`)
- Line stoppage page → Stoppage records: uses records (evidence: `pages/10_🛑_Parada_de_Linha.py`)
- Stoppage interface → Stoppage records: manages stoppage (evidence: `src/paradas_ui.py`)
- Stoppage interface → Inspection photos: uploads photos (evidence: `src/paradas_ui.py`)
- Ecoresinator page → Ecoresinator interface: renders routine (evidence: `pages/7_🧪_Ecoresinator.py`)
- Ecoresinator interface → Ecoresinator records: loads and saves (evidence: `src/ecoresinator_ui.py`)
- Dashboard → Checklist data access: loads indicators (evidence: `pages/2_📊_Dashboard.py`)
- Dashboard → PDF exports: exports report (evidence: `pages/2_📊_Dashboard.py`)
- Checklist history → History viewer: shows records (evidence: `pages/8_📜_Histórico.py`)
- Checklist history → Checklist data access: loads records (evidence: `pages/8_📜_Histórico.py`)
- Adherence reports → Checklist data access: loads checklist data (evidence: `pages/9_📈_Aderência.py`)
- Adherence reports → PDF exports: exports monthly report (evidence: `pages/9_📈_Aderência.py`)
- 5 Whys analysis → Checklist data access: loads analysis data (evidence: `pages/6_🔍_5_Porquês.py`)
- Administration → Checklist data access: manages templates (evidence: `pages/4_🛠️_Administração.py`)
- Administration → Authentication: manages users (evidence: `pages/4_🛠️_Administração.py`)
- Inspection suggestions → Checklist data access: submits suggestions (evidence: `pages/5_💡_Sugestões.py`)
- QR code management → QR and poster generator: generates codes (evidence: `pages/3_🖨️_Gerar_QRCodes.py`)
- QR code management → Checklist data access: loads area data (evidence: `pages/3_🖨️_Gerar_QRCodes.py`)
