Skip to content
T.G.
Software engineering · Brazil · Portugal · Spain available for new projects

Complex systems in production

Money that actually moves. Bets that settle in seconds. Lab reports that carry legal weight. Luxury pieces changing hands across borders, with a valid invoice and provenance you can prove. I build the kind of software where a mistake has consequences — from the data model to the server running it in production.

trace/payment-webhook.log illustration of a real flow
POST /webhooks/psp/payment 202
├─ idempotency-key 9f2c… replayed ignored
├─ transaction pending → paid ok
├─ ledger entry #48,210 + 12,480.00
├─ reconcile psp ↔ ledger match
└─ total time 38 ms

no balance changed by UPDATE — entries only.

runtime
php 8.4 · go · node 22
data
mysql · postgres · redis
infra
nginx · queues · vps I run myself
  • production stable
  • domains 07
  • systems live 12+
  • markets BR · PT · ES
critical industries served
07 critical industries served
systems running in production
12+ systems running in production
countries: Brazil, Portugal and Spain
03 countries: Brazil, Portugal and Spain
owner: from schema to deploy
01 owner: from schema to deploy

The domains

Every industry below breaks in its own way. What changes is not the language — it is what happens when the system gets it wrong. Open any of them to see the real problem and the engineering decision that solved it.

01 Fintech & crypto markets OTC · Ledger · KYC/AML

The challenge

An OTC desk moves fiat and crypto within the same minute, on a volatile price, through third-party custody, under KYC/AML duty. One wrong rounding cent, repeated a thousand times, becomes a hole nobody can explain — and a balance stored in a column that gets UPDATEd can never prove where it came from.

OTC · Ledger · KYC/AML

What I did

  • Immutable double-entry ledger: balance is never an editable field, it is the sum of its entries. Every movement is reconstructible.
  • Time-locked quotes with a slippage tolerance — the offer expires before the market turns against the desk.
  • Decimal arithmetic end to end (never floats for money), with rounding defined once, in the domain.
  • Onboarding with document verification, list screening and a per-event audit trail.
  • Automatic reconciliation across the internal ledger, bank statements and on-chain movement.

The outcome

Daily close reconciles on its own. Any balance, at any past date, can be reproduced from the entries — which turns audit from a nightmare into a query.

02 Payment gateways PIX · Webhooks · Idempotency

The challenge

Payment integration is an exercise in distrust. The provider replays the same callback three times, delivers "paid" before "created", or simply goes down at 3am. A payment counted twice is a loss; counted zero times is a lost customer and a burned support day.

PIX · Webhooks · Idempotency

What I did

  • Key-based idempotency on every inbound event: processing it N times produces exactly one effect.
  • An explicit transaction state machine — illegal transitions are rejected by the domain, not patched by hand later.
  • Queues with exponential retry and a dead-letter queue: transient failure heals itself, real failure becomes visible.
  • Active reconciliation: instead of trusting the callback, the system asks the provider for the truth and repairs the divergence.
  • Receivables split, payouts, and velocity-based fraud rules applied before money leaves.

The outcome

Final state converges to the correct one even with an unstable provider. Divergence becomes an alert, not a month-end discovery.

03 iGaming & betting Live odds · Arbitrage · Concurrency

The challenge

Odds move in milliseconds and an arbitrage window lasts seconds. Worse: every bookmaker names the same event and market differently, so comparing prices first requires proving you are looking at the same game. Meanwhile player balances take concurrent writes and everything must stay auditable.

Live odds · Arbitrage · Concurrency

What I did

  • A Go ingestion engine consuming multiple providers in parallel, with backpressure and tolerance for slow feeds.
  • A normalization layer matching event, market and selection across books — the genuinely hard problem, solved with canonical keys and supervised fuzzy matching.
  • Surebet detection over the normalized book, filtered by margin and liquidity.
  • Player balances under transactional locks, an immutable statement per movement, and bonus rules as policy rather than scattered ifs.
  • A real-time operations panel so the desk can act while the opportunity still exists.

The outcome

Sub-second detection, opportunities delivered while they are still worth taking, and every balance movement traceable for audit.

04 Animal genetics laboratory LIMS · Chain of custody · Verifiable reports

The challenge

A swapped biological sample is not an error you fix with a deploy: it corrupts a parentage result, a breed registry and the value of an animal. The lab must prove, at any moment, where a sample went and who handled it — and the report it issues is used by breed associations and by people who will never open the system.

LIMS · Chain of custody · Verifiable reports

What I did

  • End-to-end LIMS: intake, barcode labelling, bench work, re-runs and release.
  • Chain of custody as an append-only event log — every transfer of possession recorded with author, timestamp and destination.
  • Instrument results imported directly, removing manual typing (the single largest source of error in the flow).
  • Signed PDF reports with a published hash and a verification QR: anyone can confirm authenticity at a public URL.
  • A breeder portal to track samples and download results without phoning the lab.

The outcome

Reports third parties can verify without system access, an intact custody history and far less bench rework.

05 Toxicology screening Sensitive data · Privacy law · Regulatory deadlines

The challenge

Toxicology screening for driving licences and employment has direct legal consequences in a person’s life. The deadline is regulatory, the integration with the receiving authority can fail silently, and the content is sensitive health data — a leak here is not an IT incident, it is harm to a person.

Sensitive data · Privacy law · Regulatory deadlines

What I did

  • Encryption at rest for sensitive fields and role-segregated access, with a log of who read what.
  • Automated retention and purge policy — data does not linger because someone forgot to delete it.
  • Submission to the receiving authority via queue, with confirmation and automatic retry on failure, instead of someone checking a spreadsheet.
  • A deadline dashboard that surfaces what is about to expire, by batch and by unit.
  • Sample traceability held to the same standard as the genetics lab — chain of custody as a requirement, not a feature.

The outcome

Deadlines tracked by the system, submissions confirmed and self-healing on failure, and sensitive data encrypted with auditable access.

06 Luxury & high-value goods Provenance · Invoicing across BR/PT/ES · AML

The challenge

In luxury goods the product holds its value because the chain of trust around it holds. A high-value piece changes hands with provenance that must be evidenced, payment that often crosses borders and currencies, and a tax document that has to be valid before the authority of the country where the sale happens — each with its own rules. Above a certain value the deal also becomes a duty to identify and to report. Getting this wrong is not a checkout bug: it is an invalid invoice, a sale with no documentary backing, and regulatory risk handed straight to the client.

Provenance · Invoicing across BR/PT/ES · AML

What I did

  • A dossier per piece: certificate, appraisal, ownership history and attached documents travel with the item — and every transfer of title is recorded as an event, not as an edit to a record.
  • Tax issuance per regime: NF-e in Brazil, certified invoicing with series and SAF-T in Portugal, and VAT invoicing with electronic reporting in Spain — numbering, rounding and withholding handled per country instead of patched as exceptions.
  • Multi-currency with the FX rate locked at deal close: the fiscal amount is recorded in the currency it was issued in, not converted after the fact.
  • Buyer and seller identification, source-of-funds checks above the legal threshold, and an exportable trail in the format the authority actually asks for.
  • Consignment and resale modelled properly: commission, payout to the consignor, and the distinction between own-account sale and brokerage — which changes what gets taxed.
  • Single-unit stock with transactional reservation: a one-of-a-kind piece cannot be sold twice, under any race condition.

The outcome

Cross-border sales that close with a valid tax document in the right country, provenance traceable from supplier to buyer, and the trail ready when the authority asks — with no side spreadsheet patching the gaps.

07 Applied AI & automation Agents · WhatsApp · Own infrastructure

The challenge

Putting a language model in front of real customers is easy to demo and hard to sustain: it invents data, obeys instructions injected by the customer itself, and runs on WhatsApp infrastructure that disconnects on its own. Automation that fails in public costs more than automation that never shipped.

Agents · WhatsApp · Own infrastructure

What I did

  • Agents with typed tools: the model never writes to the database, it calls a validated action that does.
  • Prompt-injection detection and a closed instruction scope — customer messages are data, never commands.
  • A multi-instance WhatsApp hub with reconnection, send queues and per-number rate limiting.
  • A sequential conversational flow with a clear goal (qualify, schedule, hand off) instead of open-ended chat.
  • Self-operated VPS infrastructure: nginx, queues, database, monitoring and deploys — I run what I build.

The outcome

Automated service that follows the script, scales per number and fails visibly — with a human taking over at the right moment.

How I build

These are not style preferences. Each one is the lesson from an incident I would rather not repeat.

01

Domain model first

A wrong schema is the only technical debt that compounds. A week spent on the model saves a month of migrations and a year of subtle bugs.

02

Explicit state

A state machine beats half a dozen scattered booleans. If a transition is impossible, the code must refuse it — not rely on someone remembering.

03

Idempotent by default

Networks drop, providers replay, users double-click. Every inbound event carries a key and every effect happens exactly once.

04

Money is immutable

Decimal, never float. Entries, never an UPDATE on a balance. If a number cannot be rebuilt from history, that number is not trustworthy.

05

Observability before the incident

Structured logs, alerts and dashboards ship with the feature. Learning about a problem from the customer costs twice.

06

I operate what I ship

Database, queues, nginx, deploys, backups and firewall. Whoever only hands over code never feels the real cost of their own decisions.

Tooling

The language is an implementation detail — but these are the ones I take to production and keep alive afterwards.

  • PHP
  • Laravel
  • Go
  • Vue 3
  • Inertia.js
  • TypeScript
  • Node.js
  • MySQL
  • PostgreSQL
  • Redis
  • Queues & Workers
  • Docker
  • Nginx
  • Cloudflare
  • Linux / VPS
  • PIX & PSP rails
  • Webhooks
  • WhatsApp API
  • Anthropic / LLM Agents
  • Tailwind CSS
  • Puppeteer
  • CI/CD

Got a system that cannot fail?

If your problem involves money, regulatory deadlines, sensitive data or real concurrency, it is exactly the kind of thing I enjoy solving. Tell me the context — and if it is not my kind of problem, I will say so in the first conversation.