U6 · Secondary
NutriApp
Practice software for dietitians: patient records, meal plans, lab results and scheduling, with each practitioner's data isolated at the database level. AI reads lab reports, with mandatory review, and drafts a consult-support report.
Engineering decisions
- Per-practitioner isolation with PostgreSQL Row Level Security across 25 clinical tables. The tenant is set only for the current transaction, so it can't leak into the next request that reuses the pooled connection.
- Two database roles: one owns the schema, the runtime role has no superuser or BYPASSRLS. The isolation test fails if it runs with privileges that would skip RLS.
- Append-only patient records enforced in the database: a trigger rejects updates and deletes. An account with an overdue subscription can read but not write, and the database enforces it, not the routes.
- AI with a human in the loop: a low-confidence lab-report extraction is only saved after field-by-field review. The consult-support report never goes into the record on its own, gets only the patient's age, and is blocked without signed consent. The dietitian builds the meal plan.
- Domain logic in TypeScript with no Next.js or React imports, running under `node --test`. A test fails on any such import, and an applied migration can't be edited (per-file checksum).
- Clinical consultant: Dr. Cilana Carvalho.
Results
- 25 clinical tables under RLS, with 14 test cases dedicated to isolation between practitioners.
- Brazilian food composition table (TACO) with 597 foods and 8,100 WHO growth-curve points built in.
- 59 SQL migrations and 53 Playwright end-to-end test cases.
Stack
Next.js 16React 19TypeScriptNode.jsPostgreSQL (RLS)OpenAI Responses APIZodStripePlaywrightDocker
What it shows
Shows I can apply AI to health data responsibly: isolation enforced by the database, mandatory human review, and clinical decisions left to the professional.
More projects
U5
ReachantB2B lead-list builder for Brazil and the US. It finds businesses on Google Places by industry and city, then enriches each lead with website, contacts and decision-maker. Includes an API and an MCP server for AI agents.
liveU7DockPlus AI Client WebsitesFast, search-friendly, on-brand websites for small businesses in Brazil and the US, built with a repeatable process I wrote as a Claude Code skill that goes from the client's Instagram and Google Business Profile to deploy.
liveU8AgentLab — agent architecture labA study lab where I test agent architectures. Users build agents with their own Anthropic or OpenAI key and can switch on a mode that runs a 5-node LangGraph graph, showing each step live and sending traces to Langfuse.
open source