Skip to content
Midmire
← Back to work
Boating-license school (Brazil)Nautical education2026

A WhatsApp-first, multi-tenant SaaS for boating-license schools.

A production, multi-tenant SaaS that runs a Navy-regulated boating-license business end-to-end over WhatsApp — a stateful licensing pipeline, stage-driven automation, a guarded AI layer, government document generation, and LGPD-grade handling of national-ID data. Pipelines, bots, and document layouts are configuration, so onboarding another school is a config exercise, not a rewrite.

Multi-tenant SaaSWhatsApp automationAI + compliance
Boating-license school (Brazil) case study

Result

Multi-tenant SaaS · a 15-stage licensing pipeline automated, lead to license

A boating-license school in Brazil runs its entire business over WhatsApp — a long, document-heavy, Navy-regulated process to license each student. We built the platform that runs it: a production, multi-tenant SaaS purpose-built for a business that lives in a chat app.

At a glance

  • A 15-stage, Navy-regulated licensing pipeline, fully tracked and automated
  • Multi-tenant from day one — new schools onboard by configuration, in days
  • The AI handles the majority of routine WhatsApp inbound, escalating sensitive cases to a human
  • National-ID (CPF/RG) data encrypted, with a full access audit trail (LGPD)

Background

Licensing a student in Brazil is a roughly 15-stage process defined by the Navy (Capitania dos Portos) — from first interest through scheduling a practical class, sitting the exam, and filing the paperwork. The school ran all of it by hand: confirmations, reminders, and endless "where's the marina?" messages typed by a person all day, tracked in a generic CRM that didn't fit the domain.

Three things made it hard to systematize. The pipeline is long and stateful, so it's easy to lose who's where. Every student needs an official ATESTADO on a fixed Navy PDF form, signed by three parties through the government gov.br service. And exam results arrive by email from the Capitania and had to be read and matched to students by hand. None of it maps onto an off-the-shelf tool.

A multi-tenant architecture

The platform is multi-tenant from the ground up. Every table is tenant-scoped, and everything that varies between schools — pipelines, bots, custom fields, document layouts — is stored as configuration rather than code. Onboarding a new school is a configuration exercise, not a deployment. Every external service — WhatsApp, AI, email, storage, PDF — sits behind an adapter, so any provider can be swapped without touching the core.

The operations engine

A Kanban pipeline walks each student from interested to licensed, and a stage- and time-driven automation engine sends the right WhatsApp message at the right moment — five days before a class, two hours before. The automation is built to feel human rather than robotic: randomized message variants, a few minutes of send jitter, business-hours gating, and typing indicators. It also respects Meta's rules correctly — free-form messages only work within 24 hours of a customer reply, so outside that window it falls back to pre-approved templates.

On top sits a three-tier AI layer, and the important part is what it is not allowed to do. Tier one is pure automation. Tier two lets the AI answer safe, factual questions on its own — "where's the marina?", "what should I bring?". Tier three hard-escalates anything sensitive — money, cancellations, legal, anything involving minors — to a human. The AI never quotes a price, never signs as a person, and never advances a student to "approved." The guardrails are the product.

The regulated, document-heavy parts

Several capabilities exist only because this is a real, regulated business:

  • A public booking form that reserves slots under a real database lock, with reCAPTCHA, rate-limiting, and dedup, so two people can't take the same seat.
  • Government PDF generation that fills the exact Navy form by coordinate overlay, so the output stays byte-identical to what the Capitania accepts — with per-tenant layouts.
  • gov.br signing tracked through its manual government steps as explicit state, with no vendor lock-in.
  • Exam-result ingestion that parses Capitania emails (regex, with an AI fallback), extracts protocol numbers and dates, and proposes pipeline moves for a human to confirm — never applying them automatically.

Compliance, by design

Brazilian boat schools handle CPF and RG — national ID and tax data — under LGPD, so compliance is built into the foundation, not bolted on. National-ID data is encrypted at rest (pgcrypto plus app-layer envelope encryption), a full audit log records who viewed which student, and data export and delete endpoints exist from the start. The system is built for the Brazilian market throughout: E.164 phone handling, CPF check-digit validation, São Paulo timezone everywhere, and a UI entirely in Brazilian Portuguese.

Stack

React + Vite + TypeScript (TanStack Router/Query, shadcn/ui) on the front end; NestJS on Node 20; PostgreSQL 16 with Prisma; BullMQ and Redis for scheduled jobs; Meta's WhatsApp Business Cloud API; OpenAI behind an abstraction; Cloudflare R2 for storage; Caddy and Docker Compose in São Paulo.

In production

The platform runs the school's licensing operation end-to-end: a public form creates a lead and an automated WhatsApp confirmation; moving a card sends class details; timed reminders fire; the AI answers routine questions and escalates anything sensitive; the official atestado is generated and tracked through government signing; and Capitania exam emails become extracted, human-confirmed pipeline moves. It's covered by critical-path end-to-end and smoke tests — and because it was multi-tenant from the first table, taking on additional schools is configuration, not a rebuild.

Related reading: The most important part of an AI assistant is what it refuses to do.

Have a project like this?

Tell us where you are and where you'd like to be — we'll come back with a plan within two business days.