Asistente Judicial en Línea

A mission-critical Flutter field app for Cuban judicial assistants — write-first SQLite cache + contract-first REST + checkpointed delta sync — so a day offline in low-connectivity zones still ends with zero data loss.

Client
Tribunal Supremo Popular (Cuban Judiciary)
Role
Project Lead — Mobile
Year
2025
Timeline
Multi-quarter engagement
Flutter Dart SQLite ERPNext / Frappe Python REST
Asistente Judicial en Línea

Problem

The Cuban judiciary needed a field tool for judicial assistants who monitor the social reintegration of sanctioned individuals — presentations, controls, evaluations, family situation reports — and feed those observations back into a central ERPNext (Frappe) system at the Tribunal Supremo Popular.

The hard constraint was connectivity. Field workers operate across the entire country, including municipalities where mobile data is unreliable for hours or full days. A failed sync at the wrong moment can mean a missed control or a lost evaluation — and in this domain, missing data is not just inconvenient, it has legal consequences for the person being monitored. The system had to behave correctly with NO network, then heal itself when network returned, with zero loss.

Approach

I architected the mobile client as a local-first SQLite-backed Flutter app that treats the network as an enhancement, not a dependency. Every write — a presentation logged, an evaluation filled, a notification opened — commits to the local SQLite database first, before any network call. A background sync engine then reconciles with the ERPNext backend over REST when connectivity is available. Conflicts resolve via timestamped last-write-wins.

The non-obvious decision was the API contract, not the storage layer. I led a contract-first REST documentation effort with the backend team: versioned endpoints, explicit pagination, and delta-fetch semantics with checkpoint resume — so the sync queue could pick up exactly where it left off after a long disconnect, instead of re-syncing the entire dataset on every reconnect. That single design choice was what kept hours-long offline windows fully operational.

Loading diagram…
Write-first local SQLite + background sync queue with checkpointed delta fetch — the network is optional, never blocking

Outcome

Field workers can run a full day offline — log presentations, fill evaluations, record notifications — and the queue reconciles transparently the next time they reach signal. No data was lost in the months observed after rollout. The sync visualization (the screen above, paused at 30%) became a recognizable trust signal for the operators: they could see the queue draining and know nothing was stuck.

The contract-first API discipline reduced cross-team integration friction enough that a second mobile surface (an internal admin tool) was scaffolded against the same endpoints without a backend rewrite.

Most product fields and identifiers in the screenshots are blurred or test data — the production system is operated by the Tribunal Supremo Popular and is not publicly accessible.

Technologies used

Flutter Dart SQLite ERPNext / Frappe Python REST
Visuals

Screens

Sancionados list with the offline-first sync modal in progress at 30%Detailed profile of a sanctioned individual with address and compliance periodCase detail with empty Agenda and Available Actions (presentations and controls)Evaluation form with rating selector, location, and influencing interviewsNotification feed of case updates with expediente number, action, reason, tribunalLogin screen with Tribunal Supremo Popular emblem and Asistente Judicial en Línea title
Keep exploring

More work