JP Sámano

← All work

CheckWise

Recurring REPSE compliance for Mexican companies. Providers upload evidence, reviewers decide, and clients see their exposure across SAT, IMSS and INFONAVIT.

Role
Lead developer, LegalShelf
Period
May 2026 – present
Status
In production
CheckWise
Actual review workflow with demo data. Looping product walkthrough.
  • Next.js
  • Python
  • FastAPI
  • PostgreSQL
  • React
client companies
7
documents processed
~20,000
backend + frontend tests · Sep 2026
14,714
product surfaces
6

Customer and document figures: 11 September 2026. Test total: September 2026. Product narrative reviewed 20 October.

How the system connects

  • Interface
  • Services
  • Data and evidence
  • Human review

Validation API Python / FastAPI

Authenticate the caller, check organization scope and coordinate document signals. Critical decisions remain separate from automatic prevalidation.

Illustrated logical architecture. Select a component; animated paths show connections, not live traffic.

Problem

Mexico's 2021 outsourcing reform (REPSE) makes a company jointly liable for its service providers' labor and tax obligations. To stay covered, companies must collect and check recurring evidence from every provider: monthly, bimonthly, four-monthly and annual filings across SAT, IMSS, INFONAVIT and the labor ministry. In practice that meant thousands of PDFs, spreadsheets and email threads, and no clear view of exposure.

Constraints

  • Three audiences with different jobs: providers who upload, LegalShelf reviewers who decide, and client companies who read risk.
  • Providers are often non-technical accountants working in Spanish, many on a phone.
  • Critical review decisions require authorized human review. Objective checks and client-configured rules have an explicit, auditable scope.
  • A small team responsible for production operation, migration review and controlled releases.

Decisions

  1. Model obligations as institution × cycle, not a checklist

    A flat checklist can't express that an IMSS payment is monthly while an INFONAVIT filing is bimonthly. Modeling each obligation by institution and cycle made the calendar, the reminders and the risk view fall out of one structure.

  2. Explicit rules, traceable review

    Every upload gets an automatic prevalidation: one plain verdict, the fields it read, and where on the page it read them. Critical decisions stay with an authorized reviewer; configured acceptance/rejection rules are separate from the model reading, and transitions retain their audit trail.

  3. One status vocabulary, enforced by tests

    Three portals describing the same document differently erodes trust fast. Status labels live in one module and sweep tests fail the build if a screen invents its own wording.

  4. Ship with agents, behind gates

    I define the architecture and change constraints before using coding agents. Type checks, relevant tests, coverage requirements and review establish what is ready for a controlled release.

Client workspace

CheckWise client dashboard: compliance across providers and obligations needing attention
Client dashboard. Actual application with demo data.Open full-size image

How it was built

  • Owned the obligation model, backend APIs, review interfaces and delivery across provider, client and reviewer surfaces.
  • Connected institutions, cycles, periods and contracts so calendars and review state share the same domain model.
  • Built document reading and review workflows with an explicit separation between model suggestions, configured rules and authorized human decisions.
  • Direct AI coding agents in isolated worktrees, define the constraints and test gates, and review the changes before release.

How I build →

Outcome

The September 2026 snapshot recorded 7 client companies, 15+ vendors and about 20,000 documents processed, with reviewers clearing around 50 documents a day at roughly a minute each. The October 19 release added contract-based provider workflows, contract calendars and lead tools. It has six surfaces: a provider portal, a client portal, a reviewer console, a public site, an in-app academy with 33 filmed lessons, and a reporting suite. Uploads get live SAT invoice-folio checks and AI-generated-document detection, and clients can set their own auto-accept and auto-reject rules.

Evidence

  • 7 client companies, 15+ vendors and about 20,000 documents processed in production.
  • 2,454 commits on the main branch between 12 May and 11 September 2026.
  • 667 merged pull requests between June and September.
  • 9,941 backend and 4,773 frontend tests in the September 2026 verification snapshot; this is a dated baseline, not a live counter.
  • Live at checkwise.com.mx. The source is private; I'm happy to walk through it.

Stack

Python · FastAPI · PostgreSQL · Next.js 16 · React 19 · TypeScript · Claude API · Google Document AI · Render · Vercel · Playwright

Links