# rodrigordi/zeus.net.nfe.nfce architecture

> Architecture diagram of the GitHub repository rodrigordi/zeus.net.nfe.nfce, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rodrigordi/zeus.net.nfe.nfce
- Repository: https://github.com/rodrigordi/zeus.net.nfe.nfce

## Overview

Zeus is a .NET fiscal-document library suite for creating and maintaining Brazilian NF-e/NFC-e, CT-e and MDF-e documents, with DANFE and DAMDFE rendering. The principal workflow is to build a fiscal document, serialize or sign it, send it to a state tax-authority service, and handle its response; the NFe command-line integration exposes one user-facing route. The graph also preserves event/consultation services and printing capabilities documented by the README. Some service and renderer links are documented rather than verified in sampled implementations, so those edges are dashed.

Main entry points: [`NFe.Classes/NFe.cs`](https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/NFe.Classes/NFe.cs) (NF-e / NFC-e model), [`DFe.Classes/Assinatura/Signature.cs`](https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/DFe.Classes/Assinatura/Signature.cs) (XML signature types), [`MDFe.Classes/Informacoes/MDFe.cs`](https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/MDFe.Classes/Informacoes/MDFe.cs) (MDF-e model), [`NFe.Integracao/Program.cs`](https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/NFe.Integracao/Program.cs) (NFe command line)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_documents["Fiscal documents"]
  node_nfe["NF-e / NFC-e model<br/>[NFe.cs]"]
  node_cte["CT-e model<br/>[CTe.cs]"]
  node_mdfe["MDF-e model<br/>[MDFe.cs]"]
end

subgraph group_shared["Shared foundations"]
  node_xml["XML serialization<br/>[FuncoesXml.cs]"]
  node_signature["XML signature types<br/>[Signature.cs]"]
  node_certificate["Certificate handling"]
end

subgraph group_services["Authority services"]
  node_nfe_routing["NFe service routing<br/>[Enderecador.cs]"]
  node_cte_send["CT-e submission"]
  node_cte_events["CT-e events"]
  node_mdfe_events["MDF-e events"]
  node_mdfe_receipt["MDF-e submission"]
end

subgraph group_integration["NFe integration"]
  node_nfe_cli["NFe command line<br/>[Program.cs]"]
  node_nfe_facade["NFe service facade<br/>[NFeFacade.cs]"]
  node_nfe_builder["NFe XML builder<br/>[NFeBuilder.cs]"]
end

subgraph group_printing["Fiscal printing"]
  node_danfe_fast["DANFE FastReports<br/>[DanfeFrNfce.cs]"]
  node_danfe_native["Native NFC-e print<br/>[DanfeNativoNfce.cs]"]
  node_damdfe["DAMDFE renderer<br/>[DamdfeFrMDFe.cs]"]
  node_print_primitives["Print primitives<br/>[AdicionarTexto.cs]"]
end

node_user(("Application user"))
node_tax_authority{{"State tax authority"}}
node_print_output["Printed / exported document"]

node_nfe -->|"serializes with"| node_xml
node_cte -->|"loads with"| node_xml
node_mdfe -->|"loads with"| node_xml
node_nfe -->|"contains signature"| node_signature
node_cte -->|"contains signature"| node_signature
node_mdfe -->|"uses signature"| node_signature
node_certificate -.->|"supports signing"| node_signature
node_user -.->|"runs commands"| node_nfe_cli
node_nfe_cli -->|"builds document"| node_nfe_builder
node_nfe_cli -->|"submits document"| node_nfe_facade
node_nfe_facade -.->|"routes services"| node_nfe_routing
node_nfe_routing -->|"selects endpoint"| node_tax_authority
node_nfe_facade -.->|"consumes services"| node_tax_authority
node_cte_send -.->|"submits CT-e"| node_tax_authority
node_cte_events -.->|"registers events"| node_tax_authority
node_mdfe_receipt -.->|"submits MDF-e"| node_tax_authority
node_mdfe_events -.->|"registers events"| node_tax_authority
node_nfe -.->|"renders as DANFE"| node_danfe_fast
node_nfe -->|"renders NFC-e"| node_danfe_native
node_danfe_native -->|"draws text with"| node_print_primitives
node_mdfe -.->|"renders as DAMDFE"| node_damdfe
node_danfe_fast -.->|"prints or exports"| node_print_output
node_danfe_native -.->|"draws print layout"| node_print_output
node_damdfe -.->|"renders document"| node_print_output

click node_nfe "https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/NFe.Classes/NFe.cs"
click node_cte "https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/CTe.Classes/CTe.cs"
click node_mdfe "https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/MDFe.Classes/Informacoes/MDFe.cs"
click node_xml "https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/DFe.Utils/FuncoesXml.cs"
click node_signature "https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/DFe.Classes/Assinatura/Signature.cs"
click node_certificate "https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/DFe.Utils/Assinatura/CertificadoDigital.cs"
click node_nfe_cli "https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/NFe.Integracao/Program.cs"
click node_nfe_facade "https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/NFe.Integracao/NFeFacade.cs"
click node_nfe_builder "https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/NFe.Integracao/NFeBuilder.cs"
click node_nfe_routing "https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/NFe.Servicos/Enderecador.cs"
click node_cte_send "https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/CTe.Servicos/EnviarCte/ServicoEnviarCte.cs"
click node_cte_events "https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/CTe.Servicos/Eventos/ServicoController.cs"
click node_mdfe_events "https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/MDFe.Servicos/EventosMDFe/ServicoController.cs"
click node_mdfe_receipt "https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/MDFe.Servicos/RecepcaoMDFe/ServicoMDFeRecepcao.cs"
click node_danfe_fast "https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/NFe.Danfe.Fast/NFCe/DanfeFrNfce.cs"
click node_danfe_native "https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/NFe.Danfe.Nativo/NFCe/DanfeNativoNfce.cs"
click node_damdfe "https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/MDFe.Damdfe.Fast/DamdfeFrMDFe.cs"
click node_print_primitives "https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/GraphicsPrinter/AdicionarTexto.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_nfe,node_cte,node_mdfe,node_user toneBlue
class node_xml,node_signature,node_certificate toneAmber
class node_nfe_routing,node_cte_send,node_cte_events,node_mdfe_events,node_mdfe_receipt toneMint
class node_nfe_cli,node_nfe_facade,node_nfe_builder toneRose
class node_danfe_fast,node_danfe_native,node_damdfe,node_print_primitives,node_tax_authority,node_print_output toneIndigo
```

## Components

### Fiscal documents

- [NF-e / NFC-e model](https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/NFe.Classes/NFe.cs): `NFe.Classes/NFe.cs`
- [CT-e model](https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/CTe.Classes/CTe.cs): `CTe.Classes/CTe.cs`
- [MDF-e model](https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/MDFe.Classes/Informacoes/MDFe.cs): `MDFe.Classes/Informacoes/MDFe.cs`

### Shared foundations

- [XML serialization](https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/DFe.Utils/FuncoesXml.cs): `DFe.Utils/FuncoesXml.cs`
- [XML signature types](https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/DFe.Classes/Assinatura/Signature.cs): `DFe.Classes/Assinatura/Signature.cs`
- [Certificate handling](https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/DFe.Utils/Assinatura/CertificadoDigital.cs): `DFe.Utils/Assinatura/CertificadoDigital.cs`

### Authority services

- [NFe service routing](https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/NFe.Servicos/Enderecador.cs): `NFe.Servicos/Enderecador.cs`
- [CT-e submission](https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/CTe.Servicos/EnviarCte/ServicoEnviarCte.cs): `CTe.Servicos/EnviarCte/ServicoEnviarCte.cs`
- [CT-e events](https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/CTe.Servicos/Eventos/ServicoController.cs): `CTe.Servicos/Eventos/ServicoController.cs`
- [MDF-e events](https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/MDFe.Servicos/EventosMDFe/ServicoController.cs): `MDFe.Servicos/EventosMDFe/ServicoController.cs`
- [MDF-e submission](https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/MDFe.Servicos/RecepcaoMDFe/ServicoMDFeRecepcao.cs): `MDFe.Servicos/RecepcaoMDFe/ServicoMDFeRecepcao.cs`

### NFe integration

- [NFe command line](https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/NFe.Integracao/Program.cs): `NFe.Integracao/Program.cs`
- [NFe service facade](https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/NFe.Integracao/NFeFacade.cs): `NFe.Integracao/NFeFacade.cs`
- [NFe XML builder](https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/NFe.Integracao/NFeBuilder.cs): `NFe.Integracao/NFeBuilder.cs`

### Fiscal printing

- [DANFE FastReports](https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/NFe.Danfe.Fast/NFCe/DanfeFrNfce.cs): `NFe.Danfe.Fast/NFCe/DanfeFrNfce.cs`
- [Native NFC-e print](https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/NFe.Danfe.Nativo/NFCe/DanfeNativoNfce.cs): `NFe.Danfe.Nativo/NFCe/DanfeNativoNfce.cs`
- [DAMDFE renderer](https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/MDFe.Damdfe.Fast/DamdfeFrMDFe.cs): `MDFe.Damdfe.Fast/DamdfeFrMDFe.cs`
- [Print primitives](https://github.com/rodrigordi/zeus.net.nfe.nfce/blob/master/GraphicsPrinter/AdicionarTexto.cs): `GraphicsPrinter/AdicionarTexto.cs`

### Other components

- **Application user**
- **State tax authority**
- **Printed / exported document**

## Connections

- NF-e / NFC-e model → XML serialization: serializes with (evidence: `NFe.Classes/NFe.cs`)
- CT-e model → XML serialization: loads with (evidence: `CTe.Classes/CTe.cs`)
- MDF-e model → XML serialization: loads with (evidence: `MDFe.Classes/Informacoes/MDFe.cs`)
- NF-e / NFC-e model → XML signature types: contains signature (evidence: `NFe.Classes/NFe.cs`)
- CT-e model → XML signature types: contains signature (evidence: `CTe.Classes/CTe.cs`)
- MDF-e model → XML signature types: uses signature (evidence: `MDFe.Classes/Informacoes/MDFe.cs`)
- Certificate handling → XML signature types: supports signing
- Application user → NFe command line: runs commands
- NFe command line → NFe XML builder: builds document (evidence: `NFe.Integracao/Program.cs`)
- NFe command line → NFe service facade: submits document (evidence: `NFe.Integracao/Program.cs`)
- NFe service facade → NFe service routing: routes services
- NFe service routing → State tax authority: selects endpoint (evidence: `NFe.Servicos/Enderecador.cs`)
- NFe service facade → State tax authority: consumes services
- CT-e submission → State tax authority: submits CT-e
- CT-e events → State tax authority: registers events
- MDF-e submission → State tax authority: submits MDF-e
- MDF-e events → State tax authority: registers events
- NF-e / NFC-e model → DANFE FastReports: renders as DANFE
- NF-e / NFC-e model → Native NFC-e print: renders NFC-e (evidence: `NFe.Danfe.Nativo/NFCe/DanfeNativoNfce.cs`)
- Native NFC-e print → Print primitives: draws text with (evidence: `NFe.Danfe.Nativo/NFCe/DanfeNativoNfce.cs`)
- MDF-e model → DAMDFE renderer: renders as DAMDFE (evidence: `MDFe.Damdfe.Fast/DamdfeFrMDFe.cs`)
- DANFE FastReports → Printed / exported document: prints or exports
- Native NFC-e print → Printed / exported document: draws print layout
- DAMDFE renderer → Printed / exported document: renders document
