# kledsonzg/mais-distribuidora-assistente-de-nfe architecture

> Architecture diagram of the GitHub repository kledsonzg/mais-distribuidora-assistente-de-nfe, 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/kledsonzg/mais-distribuidora-assistente-de-nfe
- Repository: https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe

## Overview

NFe Assistant is a local desktop/web application for working with Brazilian electronic invoices and Excel summaries. Users open its local web interface to search existing summaries, generate summaries from invoice data, inspect or export invoice information, and identify volumes; the server dispatches requests to these domain operations. At startup, file watching indexes XML invoices and Excel files into an in-memory cache used by searches and summary generation. The README is empty and several route implementations are omitted, so uncertain volume-identification wiring is not shown.

Main entry points: [`src/HttpServer/Server.cs`](https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/HttpServer/Server.cs) (HTTP server), [`src/Cache/Cache.cs`](https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Cache/Cache.cs) (In-memory cache), [`src/FileListUpdater/Updater.cs`](https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/FileListUpdater/Updater.cs) (File indexer), [`src/Program.cs`](https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Program.cs) (Application startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Local Web Interface"]
  node_browser["Browser UI<br/>[summary-search.js]"]
  node_summary_ui["Summary scripts"]
  node_volume_ui["Volume scripts"]
  node_server["HTTP server<br/>[Server.cs]"]
  node_file_server["Static files<br/>[FileServer.cs]"]
end

subgraph group_reports["Summary Workflows"]
  node_search["Summary search<br/>[Search.cs]"]
  node_summary_gen["Invoice summary"]
  node_excel_view["Excel viewer<br/>[Viewer.cs]"]
  node_excel_data["Excel summary model<br/>[Summary.cs]"]
end

subgraph group_invoices["Invoice Processing"]
  node_nf_export["Invoice export<br/>[NFExporter.cs]"]
  node_invoice_parser["XML invoice parser<br/>[Invoice.cs]"]
  node_invoice_models["Invoice domain data<br/>[Client.cs]"]
  node_label["Label generation<br/>[Label.cs]"]
end

subgraph group_runtime["Runtime and State"]
  node_updater["File indexer<br/>[Updater.cs]"]
  node_cache[("In-memory cache<br/>[Cache.cs]")]
  node_excel_reader["Excel reader<br/>[ExcelFile.cs]"]
  node_config["Configuration<br/>[Configuration.cs]"]
  node_program["Application startup<br/>[Program.cs]"]
end

node_user(("User"))
node_invoice_files["XML invoice files"]
node_summary_files["Excel summary files"]

node_user -->|"uses"| node_browser
node_browser -->|"requests search"| node_server
node_summary_ui -->|"requests generation"| node_server
node_volume_ui -->|"requests identification"| node_server
node_server -->|"serves interface"| node_file_server
node_server -->|"dispatches search"| node_search
node_server -->|"dispatches generation"| node_summary_gen
node_server -->|"opens summary"| node_excel_view
node_server -->|"dispatches export"| node_nf_export
node_program -->|"starts"| node_server
node_program -->|"starts indexing"| node_updater
node_program -->|"loads and saves"| node_config
node_updater -->|"reads paths"| node_config
node_updater -->|"indexes"| node_invoice_files
node_updater -->|"indexes"| node_summary_files
node_updater -->|"updates"| node_cache
node_cache -->|"parses invoices"| node_invoice_parser
node_cache -->|"reads workbooks"| node_excel_reader
node_cache -->|"reads"| node_invoice_files
node_cache -->|"reads"| node_summary_files
node_search -->|"reads summaries"| node_cache
node_summary_gen -->|"gets XML file list"| node_updater
node_summary_gen -->|"reads invoices"| node_cache
node_invoice_parser -->|"populates"| node_invoice_models

click node_browser "https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/www/scripts/summary-search.js"
click node_summary_ui "https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/www/scripts/summary-generate.js"
click node_volume_ui "https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/www/scripts/volume-identification-form.js"
click node_server "https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/HttpServer/Server.cs"
click node_file_server "https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/HttpServer/FileServer.cs"
click node_search "https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Excel/Search.cs"
click node_summary_gen "https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Xml/SummaryGenerator.cs"
click node_excel_view "https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Excel/Viewer.cs"
click node_excel_data "https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Excel/Summary.cs"
click node_nf_export "https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Xml/NFExporter.cs"
click node_invoice_parser "https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Xml/Invoice.cs"
click node_invoice_models "https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Invoice/Client.cs"
click node_label "https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Word/Label.cs"
click node_updater "https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/FileListUpdater/Updater.cs"
click node_cache "https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Cache/Cache.cs"
click node_excel_reader "https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Excel/ExcelFile.cs"
click node_config "https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Config/Configuration.cs"
click node_program "https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Program.cs"

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_browser,node_summary_ui,node_volume_ui,node_server,node_file_server,node_user toneBlue
class node_search,node_summary_gen,node_excel_view,node_excel_data toneAmber
class node_nf_export,node_invoice_parser,node_invoice_models,node_label toneMint
class node_updater,node_cache,node_excel_reader,node_config,node_program toneRose
class node_invoice_files,node_summary_files toneIndigo
```

## Components

### Local Web Interface

- [Browser UI](https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/www/scripts/summary-search.js): `www/scripts/summary-search.js`
- [Summary scripts](https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/www/scripts/summary-generate.js): `www/scripts/summary-generate.js`
- [Volume scripts](https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/www/scripts/volume-identification-form.js): `www/scripts/volume-identification-form.js`
- [HTTP server](https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/HttpServer/Server.cs): `src/HttpServer/Server.cs`
- [Static files](https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/HttpServer/FileServer.cs): `src/HttpServer/FileServer.cs`

### Summary Workflows

- [Summary search](https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Excel/Search.cs): `src/Excel/Search.cs`
- [Invoice summary](https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Xml/SummaryGenerator.cs): `src/Xml/SummaryGenerator.cs`
- [Excel viewer](https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Excel/Viewer.cs): `src/Excel/Viewer.cs`
- [Excel summary model](https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Excel/Summary.cs): `src/Excel/Summary.cs`

### Invoice Processing

- [Invoice export](https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Xml/NFExporter.cs): `src/Xml/NFExporter.cs`
- [XML invoice parser](https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Xml/Invoice.cs): `src/Xml/Invoice.cs`
- [Invoice domain data](https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Invoice/Client.cs): `src/Invoice/Client.cs`
- [Label generation](https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Word/Label.cs): `src/Word/Label.cs`

### Runtime and State

- [File indexer](https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/FileListUpdater/Updater.cs): `src/FileListUpdater/Updater.cs`
- [In-memory cache](https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Cache/Cache.cs): `src/Cache/Cache.cs`
- [Excel reader](https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Excel/ExcelFile.cs): `src/Excel/ExcelFile.cs`
- [Configuration](https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Config/Configuration.cs): `src/Config/Configuration.cs`
- [Application startup](https://github.com/kledsonzg/mais-distribuidora-assistente-de-nfe/blob/main/src/Program.cs): `src/Program.cs`

### Other components

- **User**
- **XML invoice files**
- **Excel summary files**

## Connections

- User → Browser UI: uses
- Browser UI → HTTP server: requests search
- Summary scripts → HTTP server: requests generation
- Volume scripts → HTTP server: requests identification
- HTTP server → Static files: serves interface
- HTTP server → Summary search: dispatches search
- HTTP server → Invoice summary: dispatches generation
- HTTP server → Excel viewer: opens summary
- HTTP server → Invoice export: dispatches export
- Application startup → HTTP server: starts
- Application startup → File indexer: starts indexing
- Application startup → Configuration: loads and saves
- File indexer → Configuration: reads paths
- File indexer → XML invoice files: indexes
- File indexer → Excel summary files: indexes
- File indexer → In-memory cache: updates
- In-memory cache → XML invoice parser: parses invoices
- In-memory cache → Excel reader: reads workbooks
- In-memory cache → XML invoice files: reads
- In-memory cache → Excel summary files: reads
- Summary search → In-memory cache: reads summaries
- Invoice summary → File indexer: gets XML file list
- Invoice summary → In-memory cache: reads invoices
- XML invoice parser → Invoice domain data: populates
