project 01 · in production

Corpo Sanoclinic management

A complete web system in production at a massage therapy clinic. It brings scheduling, clients, appointments, packages, finances, and invoicing together in one place, and it runs in the browser, installs on phones as an app, or installs on a Windows computer at the clinic with no internet needed.

67 testsautomated, running on every commit in GitHub Actions
56 tablesin PostgreSQL 16, with versioned migrations
3 waysto use it: browser, phone app, and offline on Windows
01

What it does

The clinic’s daily work, from scheduling to invoicing.

  1. Smart schedulingCatches scheduling conflicts by therapist and by room in two layers: in the application and through an exclusion constraint in PostgreSQL. It also respects the gap between sessions, business hours, and each therapist’s availability.
  2. Session packagesTracks each package’s balance, expiration, and no-show and late-cancellation rules, and shows the discount compared with the single-session price.
  3. FinancesSeparates what was contracted, received, and pending. It records refunds, closes the cash register, and exports reports as PDF, CSV, and XLSX.
  4. Electronic invoices (NFS-e)Builds the service declaration in Brazil’s official national layout, signs it with XMLDSig using an A1 certificate, and talks to the tax service over mTLS, with a readiness check before issuing in production.
  5. WhatsApp BusinessSends confirmations and reminders through Meta’s official API, using approved templates, a retry queue, an HMAC-signed webhook, and full opt-out support.
  6. BackupsDaily backups encrypted with AES-256-GCM and sent off the server to S3-compatible storage, with restores tested automatically.
02

Security and privacy

Health data calls for extra care.

  • Health data encrypted with key rotation, plus granular roles and permissions.
  • Audit trail, lockout after failed sign-in attempts, and sessions that expire when idle.
  • Access token kept only in memory; the refresh token lives in an httpOnly cookie and rotates on every use.
  • Messages only with the client’s consent, as Brazil’s data protection law (LGPD) requires.
  • The phone app (PWA) never stores API data on the device.
03

Tech stack

frontend
React 18 · TypeScript · Tailwind CSS · Vite · React Query · PWA
backend
Python 3.12 · FastAPI · Pydantic v2 · SQLAlchemy 2 · Alembic
database
PostgreSQL 16 · 56 tables · versioned migrations
infrastructure
Docker Compose · Nginx with HTTPS (Let’s Encrypt) · GitHub Actions
integrations
NFS-e (national invoicing) · WhatsApp Business Cloud API · S3 storage
local install
Windows installer (Inno Setup) with bundled Python and PostgreSQL
04

Quality

67 automated tests cover the critical rules on every commit.

  • authentication and permissions
  • scheduling conflicts
  • packages and finances, including refunds and cash register closing
  • invoicing: duplicates, validated signatures, and authorization only after official confirmation
  • WhatsApp: consent, retries, and the signed webhook
  • health data encryption
  • real backup and restore with pg_dump and pg_restore

Read the documentation on GitHub

contact

Let’s
talk

This is one of the projects I built with vibe coding. See the others on the projects page.