Back to home

Scene 06 · Other projects · 2026

NFe Hub — a fiscal API with a Delphi client

A Node and TypeScript fiscal API that builds NF-e access keys and XML, consumed by a Delphi client.

Draft — copy under review

Role
Sole author.
Stack
Node.js · TypeScript · Fastify · Zod · PostgreSQL · Delphi · Jest · Testcontainers · Docker · GitHub Actions
Links

What it is

A study project, built to practice the kind of integration many Brazilian companies still run: a Delphi desktop system talking to a modern API.

What I built

  • a Fastify API that validates CNPJ/CPF, builds the 44-digit access key (modulo 11) and the NF-e XML in layout 4.00 (Brazil’s electronic invoice);
  • invoices live in PostgreSQL and the event trail in MongoDB;
  • a Delphi VCL desktop client consumes the API over HTTP/JSON.

Decisions

Tests against real databases. Integration tests spin up PostgreSQL and MongoDB in containers (Testcontainers) instead of mocking them.

Ready to run anywhere. A multi-stage Docker image published to GHCR and CI on GitHub Actions; the reasoning behind each architecture choice is in the README.

By the numbers

  • 24 tests, unit and integration
  • 2 CI/CD workflows