Back to Portfolio
Internal Tools 2026

SanaMente Administration

SanaMente Administration is one portal with three areas. Clientes covers accounts, trials and pilots, AI quotas, support access, archiving and deletion. Crecimiento covers the ambassador program, sales materials, marketing resources and the blog. Producto covers the component library, the design system, model evaluation and build economics. It lets a two-person company run sales, support and product decisions without ever seeing a patient's clinical record. That rule is enforced in the database, not left to good intentions.

Platform Web

At a glance

Role
Founder & Technical Product Lead
Team
Me + 1 engineer
What I owned
Product, architecture, and hands-on build of the internal back office
Results
  • One back office for accounts, pilots, support access, ambassadors, materials and model evaluation
  • No clinical content on any admin screen, enforced by the queries and row-level security
  • Consent-based, read-only, logged support access instead of impersonation
SanaMente Administration preview

/ The Challenge

SanaMente holds clinical records under NOM-004, so every internal tool is a potential leak. The obvious shortcuts (an impersonate button, a SQL console, a spreadsheet of clients next to their patients) all break that rule. The business still needed real operations before the first paying clinic: invite-only pilots with an end date, trials that expire on schedule (and a demo where they never do), per-plan AI quotas, an ambassador network paid on commission, sales collateral that matches the product exactly, and a way to decide with numbers whether a cheaper AI model is safe to ship. All of it in Spanish, on the product's stack and design system, and safe to use on staging and demo.

/ Approach

  1. 01

    One shell, three jobs. The admin screens grew one tab at a time. I consolidated them into a single «Administración» shell: a blue sidebar grouped into Clientes, Crecimiento and Producto, with breadcrumbs and the same toolbar everywhere. After signing in, anyone with more than one destination picks SanaMente or Administración. Ambassadors get a narrower view of their own.

  2. 02

    No clinical content, by construction. The account list shows what operations needs (plan, patients, sessions in the last 30 days, last activity, status) and nothing a clinician wrote. The admin endpoints never select patient names or notes. Support access needs the clinician's consent for 24 or 48 hours, is read-only through an act claim with a SQL write lock, and every read is logged where the clinician can see it.

  3. 03

    Account lifecycle as explicit actions. Enter with consent, adjust the trial, grant AI sessions, assign an ambassador, archive and delete are each their own dialog. Archiving is always allowed. In production, deletion is allowed only with no clinical data. A test-only «Simular» group (end the trial now, restart a 60-day pilot) doesn't exist in production. Pilots end read-only rather than rolling into a trial.

  4. 04

    Growth as a product, not a spreadsheet. Each ambassador has a referral link (piloto-xxxxx) and an internal number, and sees their funnel (invited, in pilot, paying) but never a record. A commission calculator shows the plan at work: 100% of a therapist's first month, then 10% of their subscription. Colleague referrals give each side a free month. Materials and training sit next to the funnel they support.

  5. 05

    Decisions with receipts. Producto holds every model-evaluation run, the methodology, the dated case studies and the role-play scripts, plus a build-economics report with every assumption visible. Nothing there changes production by itself. It records why a change was or wasn't made.

/ In the App

SanaMente Administration — screenshot
Destination chooser. Shown after sign-in to anyone with more than one place to go, with the environment marked.
SanaMente Administration — screenshot
Account panel. Plan, trial end date, AI sessions used against the quota, active patients, sessions in the last 30 days, current support permission, and a history of the account. There is no clinical content.
SanaMente Administration — screenshot
Account actions. Enter with consent, adjust the trial, grant AI sessions, assign an ambassador, archive or delete, each in its own dialog. The «Simular · sólo pruebas» group appears only outside production.
SanaMente Administration — screenshot
Materiales. Six pieces to show in a demo or send as a PDF, plus an internal training shelf (the ambassador program and the demo guide) marked not for prospects.
SanaMente Administration — screenshot
Basic vs Pro. The plans side by side in the product's own styling, with a one-click PDF.
SanaMente Administration — screenshot
Time-savings calculator. A therapist adjusts it to their own practice and sees the hours recovered each month, the plan that fits, and the cost per hour recovered.
SanaMente Administration — screenshot
Ambassadors. Each ambassador's link and funnel (invited, in pilot, paying). They see their therapists' status, never a clinical record.
SanaMente Administration — screenshot
Marketing resources. Every email the platform sends, with desktop, phone and dark-mode previews, plus WhatsApp templates, links and prices.
SanaMente Administration — screenshot
Model evaluation. Runs, methodology, dated case studies and role-play scripts, with a signed link into the evaluation lab.

/ Selected Technical Challenges

  • Admin access without a back door. Clerk's dashboard impersonation is switched off. Support access goes through SanaMente's own consent: 24 or 48 hours granted by the clinician, an act claim naming the staff member, read-only row-level security, a SQL write lock, and a log of every read the clinician can see. On staging and demo, where all data is fictitious, «Entrar como» works without consent. On production it can't.

  • Two kinds of admin, one source of truth. Root super admins are a list in Vercel environment settings and can't be removed from the app. They appoint other admins from the portal, and those admins have the same powers but can't appoint anyone. The same check guards the API routes and the screens, so a hidden button never stands in for authorization.

  • Environments that behave differently on purpose. Staging and demo are public but invite-only, with fictitious data only. Production gates its screens on the deployment environment. Demo accounts get rolling trials that extend themselves when read, because Vercel Preview has no cron jobs, so a sales demo never opens on an expired account. The flag that enables this is refused in production.

  • Sales collateral that can't drift from the product. Materiales use the same components and design tokens as the app, so the pricing in Basic vs Pro is the pricing in the product, and every piece exports to a multi-page PDF from the same page. Content that depends on unfinished security work, such as the support-access card, stays hidden in production until that work is closed. The privacy policy is updated in the same release.

/ Outcomes

  • One back office for a two-person company Accounts, pilots, trials, AI quotas, support access, ambassadors, materials, marketing, blog editors, model evaluation and build economics.

  • No clinical content in any admin screen Enforced by the queries and by row-level security. Support access needs consent and is read-only and logged.

  • Clear lifecycle rules Archiving is always allowed, deletion in production only with no clinical data, pilots end read-only, and test-only simulation stays out of production.

  • A working sales program Referral links, an ambassador funnel, a commission calculator, six sales pieces with PDF export, and two internal training guides.

  • Product decisions with evidence Model-evaluation runs and case studies, and a build-economics report with every assumption stated, readable without a terminal.

/ Built With

React TypeScript Vite Tailwind CSS shadcn/ui TanStack Query React-PDF Neon Postgres Row-Level Security Clerk Vercel Functions Resend Keystatic Vitest Playwright