Public sector and education · Multi tenant platform
GestFrota
Fleet and fuel management for city governments: authorizes every fill up, enforces per vehicle limits and produces audit ready reports.

- Client
- Carlos Chagas City Government and companies that manage public fleets
- Where
- Carlos Chagas, MG, Brazil
- Technology
- TypeScript · Node.js · Fastify · Zod · Drizzle ORM · PostgreSQL 16 · pg-boss · React · Vite · TanStack Query · Tailwind CSS · pdfmake · Vitest · Playwright · Docker Compose · nginx
- Status
- Private access · gestaofrota.nexialabs.com.br
- Development
- André Gomes · NexiaLabs
In short
GestFrota is a fleet and fuel management web platform for public agencies, built by André Gomes of NexiaLabs from the terms of reference of Electronic Bidding No. 28/2026 of the Carlos Chagas City Government in Minas Gerais, Brazil. It approves or declines each fill up through auditable rules, enforces per vehicle limits and a price ceiling based on the ANP average, and generates reports and invoices for public accountability. It is built in TypeScript with Fastify, React and PostgreSQL, and runs in Docker on a Hostinger VPS.
The client
City governments hire a fleet management company to fuel municipal vehicles through a network of accredited gas stations, with one card per vehicle. The Carlos Chagas bid spells out in detail what that system must do: driver PIN, per vehicle limits, price ceiling, a printed receipt at the pump, a fallback when the network goes down and a long list of reports. Bids like this are very similar from one city to the next. That is why GestFrota was designed as a product for many management companies, each with many contracts, rather than a system for a single city.
The challenge
Public money means every liter has to be justified to the contract inspector. A wrong authorization, a cent lost to rounding or a report dated on the wrong day leads to disallowed expenses and accountability problems. Data from one contract must never show up in another, even if the application has a bug. And all of this had to fit on a VPS with 1 vCPU and 4 GB of RAM, shared with other projects.
What was built
The heart of the system is an authorization engine: each rule in the bid, such as active card, authorized driver, vehicle balance, matching fuel type and price under the ceiling, is a tested pure function that returns approved or declined with a reason. Every transaction goes into a single append only event log, and a reversal is a new event pointing to the original one. Isolation between organizations and contracts lives in PostgreSQL itself, with row level security and a database role that cannot bypass it. Every requirement has an ID tied to a clause in the bid, and that ID shows up in commits and tests.
What the system does
- Vehicle, driver and card records with bulk import, blocking and immediate cancellation.
- Authorization engine with rules configurable per contract and a simulator that runs the exact same functions.
- Per liter price ceiling based on the weekly ANP average for the city, imported by a scheduled job.
- Spending limit per vehicle and period, with exceptions allowed only through a recorded authorization.
- Fallback entry from the gas station's paper form, with a deadline and required justification.
- Report catalog with any date range, exported as spreadsheet or PDF with an official header.
- Invoices per cost center, payouts to gas stations, inspector incident reports and an audit trail of every change.
- Trip records where two overlapping uses of the same vehicle or driver are blocked by the database itself.
// For whoever reviews the code: architecture and decisions.
Under the hood
GestFrota is a pnpm monorepo with four packages: the API, the web dashboard, a shared domain package and configuration. The Fastify API validates every route with the same Zod schemas the forms use and reaches PostgreSQL 16 through Drizzle, with versioned migrations that always ship with a rollback file. The dashboard is a React app built with Vite and served as static files. Background work, such as importing ANP prices, runs on a queue stored in PostgreSQL itself, inside the API process, and PDFs are generated in memory without a browser. In production, database and API run under Docker Compose on a Hostinger VPS behind nginx, with no exposed database port, daily backups and restore tests.
Technical decisions
- Money, liters and prices travel as strings and are computed only with decimal.js; the linter bans parseFloat and toFixed, because floating point numbers corrupt cents.
- Row level security in PostgreSQL with two separate database roles, so isolation between contracts does not depend on application code alone.
- Races between two simultaneous fill ups of the same vehicle are settled with an advisory lock in the database, which rereads the limit and odometer before writing.
- The API only starts in UTC and the calendar day is always São Paulo's, after dates computed in the wrong time zone showed up in due dates and billing periods.
Does your business look like this one?
It fits city governments, municipal consortia and companies that run public fleets and need to justify every fill up to internal auditors.
Frequently asked questions
Who developed GestFrota?
GestFrota was developed by André Gomes Andrade, a full stack developer from Carlos Chagas, Minas Gerais, Brazil, at NexiaLabs, from planning to launch.
Where is the client of GestFrota based?
Carlos Chagas City Government and companies that manage public fleets. Carlos Chagas, MG, Brazil.
Which technologies were used to build GestFrota?
GestFrota uses TypeScript, Node.js, Fastify, Zod, Drizzle ORM, PostgreSQL 16, pg-boss, React, Vite, TanStack Query, Tailwind CSS, pdfmake, Vitest, Playwright, Docker Compose, and nginx.
Can you build a similar project for my business?
Yes. Every project is custom built, with code and accounts in the client's name. The first step is a WhatsApp conversation at +55 (33) 98465 6356 to understand what you need.
More public sector and education projects

E.E. Dr. João Beraldo
Website and course platform for a public school, with lessons, a final exam and certificates with a verification code.
Full time public high school in Carlos Chagas, MG
See the project
Escola IDEC
Website for a public servant training school, with a course catalog, an editable schedule and lead capture.
Continuing education institute that trains municipal public servants
See the project