Case study · Diário de Bordo Digital

An electronic logbook, signed and auditable.

Electronic logbook for pilots, with digital signatures and an audit trail designed from ANAC Resolution 458/2017 (Brazil’s civil aviation authority) and the LGPD (Brazil’s data protection law).

Diário de Bordo Digital home page
Type
Our own product · aviation
First commit
Live at
db.n3xus.dev
Code
Private repository
Stack
  • Next.js 15
  • React 19
  • TypeScript
  • Fastify
  • Supabase self-hosted
  • Postgres
  • PWA
  • Coolify
  • Cloudflare R2
  • Vitest
  • Playwright

The problem

Every flight has to be recorded in the aircraft’s logbook. ANAC Resolution 458/2017 allows doing it in a computer system, as long as the record is signed, stored and auditable.

In practice the pilot fills it in on site: in the hangar, in the cockpit, sometimes with no signal. The system had to be quick to use in a hurry, never lose a record for lack of connection and make the signature something that cannot be changed afterwards.

The core (flights, pilots, aircraft and signature) works on its own. Integration with ANAC’s DBE/CIV API is an optional module, turned on per operator.

What we built

Record, sign and close the volume.

The flow follows the order of the pilot’s work, and every rule in the resolution has a place in the code.

  • Flight leg entry in 5 steps

    Aircraft and volume, flight data, crew, occurrence and review, with the ICAO aerodrome suggested from the operator’s history.

  • A signature that cannot change

    A statement of intent before confirming, an RSA-SHA256 signature with a digital certificate and an immutable record: correcting means creating a new record that supersedes the old one.

  • Chained audit trail

    Every relevant action goes into an append-only log, chained by hash, so any tampering becomes visible.

  • Works with no signal

    Installable PWA with an offline queue: a leg recorded without a connection is resent on its own when the network returns.

  • Role-based access

    Admin, manager, instructor and pilot, isolated per operator, with a second factor (TOTP) enforced on the server, not just on screen.

  • Billing that never blocks operations

    Per-operator plan, with Pix. Late payment never blocks recording or signing a leg: this is compliance software.

Architecture and security

Reads under RLS, writes only through the API.

The key that bypasses the database rules lives in a single service, and that service is the one that writes.

  • Web

    Next.js 15 with Server Components. It reads the database with the user’s session, under RLS, and never receives the service key.

    Next.js · React 19
  • API

    Fastify holds JWT validation, business rules, signing, auditing and the ANAC integration, with rate limiting on the routes.

    Fastify · TypeScript
  • Database

    Postgres on self-hosted Supabase, with per-operator RLS on every operational table, a consent log and routes for data subject rights (LGPD, art. 18).

    Supabase · Postgres · RLS
  • Backup

    Daily backup locally and on Cloudflare R2, kept for 30 days. Restoring was actually tested on a throwaway Postgres, not just configured.

    pg_dump · R2
$ curl -sI https://db.n3xus.dev/login
HTTP/2 200
content-security-policy: default-src 'self';
  script-src 'self' 'nonce-<por requisição>' 'strict-dynamic';
  frame-ancestors 'none'
cache-control: private, no-store
permissions-policy: camera=(), microphone=(), geolocation=(self)
x-frame-options: DENY
x-content-type-options: nosniff
Headers measured in production on October 18, 2026.

Results

Numbers you can check.

Database migrationsversioned schema, RLS and functions
29
Test filesVitest on the API and Playwright on the web app
53
p97.5 when saving a leg30 concurrent writes, 100% success
199 ms
Commits on mainsince August 20, 2026
267

Repository counts on October 18, 2026. The load test (September 9, 2026) ran on a development machine against a local database: the shape of the curve matters, not the millisecond as a guarantee.

What went wrong

What went wrong and how we fixed it.

An honest record of the problems we hit along the way. It is what teaches the most.

  • The audit trail could fork.

    Two writes at the same time, for the same operator, read the same previous link. Computing the next link moved into a database function, serialized per operator with a transaction lock.

  • The rate limit is per IP.

    The load test showed that pilots behind the same hangar Wi-Fi share the same limit of 100 per minute. For today’s volume that is plenty; it is documented as a known limit.

  • The form did not ask for every required field.

    ANAC Resolution 773/2025 lists what the logbook must contain. The columns already existed, but takeoff and landing, day, night and IFR hours and cargo were not collected. Fixed in August 2026.

Tell us the problem. You talk directly to the people who build.

contato@n3xus.dev

Email reply within 2 business days. The first conversation is free, and the proposal arrives in writing before any charge.

Thiago RangelFounder and lead engineer

Prefer the phone? (11) 2532‑8468 · other channels