# naoimportaweb/meucofrinho architecture

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

- Interactive diagram: https://gitdiagram.com/naoimportaweb/meucofrinho
- Repository: https://github.com/naoimportaweb/meucofrinho

## Overview

Cofre is an encrypted password and secrets catalog for an isolated Qubes qube. The principal workflow is: the user unlocks the vault in the Qt panel, selects an item, then types its value into a focused window in another qube through a virtual keyboard and Qubes input proxy; copying to the clipboard is an alternative for passwords. The catalog also covers environments, cryptocurrency wallets, payment details, and free-form notes, and includes a password generator. The excerpts show the model/crypto and keyboard bridge; the README documents the cross-qube route. Some UI wiring and proxy internals were not sampled.

Main entry points: [`cofre/app.py`](https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/app.py) (Qt panel), [`cofre/teclado.py`](https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/teclado.py) (Keyboard bridge), [`cofre/gerador.py`](https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/gerador.py) (Password generator), [`cofre/modelo.py`](https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/modelo.py) (Catalog model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_panel["Panel and catalog"]
  node_panel["Qt panel<br/>[app.py]"]
  node_passwords["Passwords<br/>[app.py]"]
  node_environments["Environments<br/>[app.py]"]
  node_wallets["Crypto wallets<br/>[app.py]"]
  node_payments["Payment details<br/>[app.py]"]
  node_notes["Free-form notes<br/>[app.py]"]
  node_generator["Password generator<br/>[gerador.py]"]
end

subgraph group_vault["Encrypted vault"]
  node_catalog["Catalog model<br/>[modelo.py]"]
  node_crypto["Encryption<br/>[cripto.py]"]
  node_vaultfile[("Encrypted vault file")]
end

subgraph group_input["Virtual keyboard"]
  node_bridge["Keyboard bridge<br/>[teclado.py]"]
  node_fifo["FIFO queue"]
  node_vkbd["Virtual keyboard<br/>[vkbd.py]"]
end

subgraph group_qubes["Qubes input route"]
  node_proxy["Qubes input proxy"]
  node_dom0["dom0 receiver"]
  node_target["Focused window"]
end

node_user(("User"))
node_clipboard["System clipboard"]

node_user -->|"unlocks and selects"| node_panel
node_panel -->|"reads and edits"| node_catalog
node_catalog -->|"encrypts and decrypts"| node_crypto
node_crypto -->|"reads and writes"| node_vaultfile
node_panel -->|"requests password"| node_generator
node_generator -->|"checks typable characters"| node_bridge
node_panel -->|"starts keyboard and sends text"| node_bridge
node_panel -.->|"copies password"| node_clipboard
node_bridge -->|"writes text"| node_fifo
node_fifo -->|"delivers text"| node_vkbd
node_vkbd -->|"emits input events"| node_proxy
node_proxy -->|"forwards via qrexec"| node_dom0
node_dom0 -->|"injects keystrokes"| node_target

click node_panel "https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/app.py"
click node_passwords "https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/app.py"
click node_environments "https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/app.py"
click node_wallets "https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/app.py"
click node_payments "https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/app.py"
click node_notes "https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/app.py"
click node_generator "https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/gerador.py"
click node_catalog "https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/modelo.py"
click node_crypto "https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/cripto.py"
click node_bridge "https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/teclado.py"
click node_vkbd "https://github.com/naoimportaweb/meucofrinho/blob/main/vkbd.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_panel,node_passwords,node_environments,node_wallets,node_payments,node_notes,node_generator,node_user toneBlue
class node_catalog,node_crypto,node_vaultfile toneAmber
class node_bridge,node_fifo,node_vkbd toneMint
class node_proxy,node_dom0,node_target toneRose
class node_clipboard toneIndigo
```

## Components

### Panel and catalog

- [Qt panel](https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/app.py): `cofre/app.py`
- [Passwords](https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/app.py): `cofre/app.py`
- [Environments](https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/app.py): `cofre/app.py`
- [Crypto wallets](https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/app.py): `cofre/app.py`
- [Payment details](https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/app.py): `cofre/app.py`
- [Free-form notes](https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/app.py): `cofre/app.py`
- [Password generator](https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/gerador.py): `cofre/gerador.py`

### Encrypted vault

- [Catalog model](https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/modelo.py): `cofre/modelo.py`
- [Encryption](https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/cripto.py): `cofre/cripto.py`
- **Encrypted vault file**

### Virtual keyboard

- [Keyboard bridge](https://github.com/naoimportaweb/meucofrinho/blob/main/cofre/teclado.py): `cofre/teclado.py`
- **FIFO queue**
- [Virtual keyboard](https://github.com/naoimportaweb/meucofrinho/blob/main/vkbd.py): `vkbd.py`

### Qubes input route

- **Qubes input proxy**
- **dom0 receiver**
- **Focused window**

### Other components

- **User**
- **System clipboard**

## Connections

- User → Qt panel: unlocks and selects
- Qt panel → Catalog model: reads and edits
- Catalog model → Encryption: encrypts and decrypts
- Encryption → Encrypted vault file: reads and writes
- Qt panel → Password generator: requests password
- Password generator → Keyboard bridge: checks typable characters
- Qt panel → Keyboard bridge: starts keyboard and sends text
- Qt panel → System clipboard: copies password
- Keyboard bridge → FIFO queue: writes text
- FIFO queue → Virtual keyboard: delivers text
- Virtual keyboard → Qubes input proxy: emits input events
- Qubes input proxy → dom0 receiver: forwards via qrexec
- dom0 receiver → Focused window: injects keystrokes
