# silvioalbqrq/conversorxml-excel architecture

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

- Interactive diagram: https://gitdiagram.com/silvioalbqrq/conversorxml-excel
- Repository: https://github.com/silvioalbqrq/conversorxml-excel

## Overview

Este é um conversor web client-side de XML de NFe/NFCe para planilhas Excel. O fluxo demonstrado é: o usuário seleciona ou solta arquivos, o navegador lê e interpreta os XMLs, os itens extraídos são ordenados e a exportação gera um arquivo .xlsx. O README também descreve pré-visualização paginada, seleção de colunas, agrupamento de produtos e deduplicação; como esses comportamentos não aparecem no trecho de código fornecido, são mostrados como capacidades documentadas, sem ligações de execução presumidas. Há uma divergência: o README menciona ExcelJS, mas o código usa a API global XLSX.

Main entry points: [`index.html`](https://github.com/silvioalbqrq/conversorxml-excel/blob/main/index.html) (Interface web), [`app.js`](https://github.com/silvioalbqrq/conversorxml-excel/blob/main/app.js) (Leitura de arquivos)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entrada["Entrada e leitura"]
  node_arquivos["XMLs fiscais<br/>[app.js]"]
  node_interface["Interface web<br/>[index.html]"]
  node_leitura["Leitura de arquivos<br/>[app.js]"]
  node_domparser["DOMParser"]
end

subgraph group_conversao["Conversão e análise"]
  node_parser["Parser NFe/NFCe<br/>[app.js]"]
  node_extracao["Extração de itens<br/>[app.js]"]
  node_ordenacao["Ordenação de linhas<br/>[app.js]"]
  node_linhas["Linhas extraídas<br/>[app.js]"]
  node_ibs["Campos IBS/CBS<br/>[app.js]"]
  node_deduplicacao["Deduplicação por chave<br/>[app.js]"]
  node_agrupamento["Agrupamento de produtos<br/>[app.js]"]
end

subgraph group_apresentacao["Apresentação e exportação"]
  node_preview["Pré-visualização paginada<br/>[index.html]"]
  node_colunas["Seletor de colunas<br/>[index.html]"]
  node_exportacao["Geração de planilha<br/>[app.js]"]
  node_xlsx["Biblioteca XLSX"]
  node_planilha["Arquivo .xlsx"]
end

node_usuario(("Usuário"))

node_usuario -->|"usa"| node_interface
node_usuario -->|"fornece"| node_arquivos
node_interface -->|"aciona"| node_leitura
node_leitura -->|"lê"| node_arquivos
node_leitura -->|"interpreta com"| node_domparser
node_leitura -->|"invoca"| node_parser
node_parser -->|"extrai"| node_extracao
node_extracao -->|"inclui campos"| node_ibs
node_extracao -->|"produz"| node_linhas
node_leitura -->|"ordena"| node_ordenacao
node_ordenacao -->|"atualiza"| node_linhas
node_interface -.->|"oferece"| node_deduplicacao
node_interface -.->|"oferece"| node_agrupamento
node_interface -.->|"documenta"| node_preview
node_interface -.->|"documenta"| node_colunas
node_interface -->|"aciona"| node_exportacao
node_exportacao -->|"converte"| node_linhas
node_exportacao -->|"usa"| node_xlsx
node_exportacao -->|"gera"| node_planilha

click node_arquivos "https://github.com/silvioalbqrq/conversorxml-excel/blob/main/app.js"
click node_interface "https://github.com/silvioalbqrq/conversorxml-excel/blob/main/index.html"
click node_leitura "https://github.com/silvioalbqrq/conversorxml-excel/blob/main/app.js"
click node_parser "https://github.com/silvioalbqrq/conversorxml-excel/blob/main/app.js"
click node_extracao "https://github.com/silvioalbqrq/conversorxml-excel/blob/main/app.js"
click node_ordenacao "https://github.com/silvioalbqrq/conversorxml-excel/blob/main/app.js"
click node_linhas "https://github.com/silvioalbqrq/conversorxml-excel/blob/main/app.js"
click node_ibs "https://github.com/silvioalbqrq/conversorxml-excel/blob/main/app.js"
click node_deduplicacao "https://github.com/silvioalbqrq/conversorxml-excel/blob/main/app.js"
click node_agrupamento "https://github.com/silvioalbqrq/conversorxml-excel/blob/main/app.js"
click node_preview "https://github.com/silvioalbqrq/conversorxml-excel/blob/main/index.html"
click node_colunas "https://github.com/silvioalbqrq/conversorxml-excel/blob/main/index.html"
click node_exportacao "https://github.com/silvioalbqrq/conversorxml-excel/blob/main/app.js"

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_arquivos,node_interface,node_leitura,node_domparser toneBlue
class node_parser,node_extracao,node_ordenacao,node_linhas,node_ibs,node_deduplicacao,node_agrupamento toneAmber
class node_preview,node_colunas,node_exportacao,node_xlsx,node_planilha toneMint
class node_usuario toneIndigo
```

## Components

### Entrada e leitura

- [XMLs fiscais](https://github.com/silvioalbqrq/conversorxml-excel/blob/main/app.js): `app.js`
- [Interface web](https://github.com/silvioalbqrq/conversorxml-excel/blob/main/index.html): `index.html`
- [Leitura de arquivos](https://github.com/silvioalbqrq/conversorxml-excel/blob/main/app.js): `app.js`
- **DOMParser**

### Conversão e análise

- [Parser NFe/NFCe](https://github.com/silvioalbqrq/conversorxml-excel/blob/main/app.js): `app.js`
- [Extração de itens](https://github.com/silvioalbqrq/conversorxml-excel/blob/main/app.js): `app.js`
- [Ordenação de linhas](https://github.com/silvioalbqrq/conversorxml-excel/blob/main/app.js): `app.js`
- [Linhas extraídas](https://github.com/silvioalbqrq/conversorxml-excel/blob/main/app.js): `app.js`
- [Campos IBS/CBS](https://github.com/silvioalbqrq/conversorxml-excel/blob/main/app.js): `app.js`
- [Deduplicação por chave](https://github.com/silvioalbqrq/conversorxml-excel/blob/main/app.js): `app.js`
- [Agrupamento de produtos](https://github.com/silvioalbqrq/conversorxml-excel/blob/main/app.js): `app.js`

### Apresentação e exportação

- [Pré-visualização paginada](https://github.com/silvioalbqrq/conversorxml-excel/blob/main/index.html): `index.html`
- [Seletor de colunas](https://github.com/silvioalbqrq/conversorxml-excel/blob/main/index.html): `index.html`
- [Geração de planilha](https://github.com/silvioalbqrq/conversorxml-excel/blob/main/app.js): `app.js`
- **Biblioteca XLSX**
- **Arquivo .xlsx**

### Other components

- **Usuário**

## Connections

- Usuário → Interface web: usa
- Usuário → XMLs fiscais: fornece
- Interface web → Leitura de arquivos: aciona
- Leitura de arquivos → XMLs fiscais: lê
- Leitura de arquivos → DOMParser: interpreta com
- Leitura de arquivos → Parser NFe/NFCe: invoca
- Parser NFe/NFCe → Extração de itens: extrai
- Extração de itens → Campos IBS/CBS: inclui campos
- Extração de itens → Linhas extraídas: produz
- Leitura de arquivos → Ordenação de linhas: ordena
- Ordenação de linhas → Linhas extraídas: atualiza
- Interface web → Deduplicação por chave: oferece
- Interface web → Agrupamento de produtos: oferece
- Interface web → Pré-visualização paginada: documenta
- Interface web → Seletor de colunas: documenta
- Interface web → Geração de planilha: aciona
- Geração de planilha → Linhas extraídas: converte
- Geração de planilha → Biblioteca XLSX: usa
- Geração de planilha → Arquivo .xlsx: gera
