Frank Fontcha.

Engineering blog

Flows from real apps, explained

Each post takes one flow I built (payments, events, auth, real-time calls, RAG, offline storage) and walks through the sequence, the core code, the design decisions and the mistakes. Steal the patterns.

Pro E-Farmer

Pro E-Farmer8 Oct 20268 min read

Variety-aware crop timelines: a farm-science engine as pure, offline TypeScript

A maize field planted with a 90-day hybrid shouldn't get the same phase dates as a 120-day local composite. Here's the small, dependency-free library behind E-Farmer's crop timelines, how it scales stages per variety and re-plans from what actually happened, and why one copy of the data beats three.

TypeScriptDomain modelingAgritechOffline-first
Pro E-Farmer24 Sept 20269 min read

Offline farm jobs and native alerts without a server: idempotent, debounced and deduped

With no backend cron in offline mode, the app itself has to age the animals, open heat windows and remind farmers to log their eggs. Here's how I run those jobs in Electron's main process and in an Expo background task, so they're safe to run any number of times and never nag twice.

ElectronExpoNotificationsBackground jobs
Pro E-Farmer12 Sept 202610 min read

A locked-down Electron app with a typed IPC bridge and a transactional local API

An offline farm app needs SQLite, a keychain and native notifications, but the page that renders it should touch none of them. Here's how I split E-Farmer desktop into a sandboxed Angular renderer, a whitelisted preload and a main process that validates every call and runs it in a transaction.

ElectronAngularTypeScriptSQLite
Pro E-Farmer30 Aug 20269 min read

From relational tables to a RAG knowledge base: render markdown, chunk by shape, rebuild on a schedule

Vector stores don't understand foreign keys, so an assistant over farm data needs its records turned into text first. Here's the pipeline in Pro E-Farmer: a NestJS cron renders one markdown document per animal and crop cycle, and a disposable Django/Chroma index chunks them by document shape.

RAGNestJSChromaDBData pipelines
Pro E-Farmer14 Aug 20269 min read

A farm-scoped RAG assistant: tenant filters, capped retrieval and prompts that refuse to guess

A farming assistant that answers from the wrong farm's records, or from the whole corpus, is worse than no assistant. Here's how Sora in Pro E-Farmer routes questions through canned actions, intent detection and a multi-tenant RAG service that only sees the farmer's own data.

RAGChromaDBNestJSDjango
Pro E-Farmer20 Jul 20268 min read

QLoRA on a 133-sample domain dataset: what fine-tuning Phi-3-mini taught me about when not to

I tried fine-tuning Phi-3-mini-4k-instruct with QLoRA so Pro E-Farmer's assistant could run on a small local model. Here's the setup, the bugs a small dataset hides, and why RAG is what's live while the adapter stays an experiment.

LLMFine-tuningQLoRAPEFT

MboaMeet

MboaMeet4 Oct 20266 min read

A write-behind view counter with two Lua scripts and one Postgres UPDATE

Counting video views with one UPDATE per view turns your hottest table into a lock queue. Here's how MboaMeet dedupes views in Redis with a single Lua round trip, buffers them in a hash, and flushes them to Postgres every five minutes in one statement, plus the failure mode I accepted and how I'd remove it.

RedisLuaPostgreSQLASP.NET Core
MboaMeet5 Sept 20269 min read

A payment webhook inbox that can't double-credit: RevenueCat, Stripe top-ups and an AI billing saga

Payment providers retry webhooks, deliver them out of order and sometimes send the same event twice, and every one of those cases can turn into free tokens or a lost purchase. Here's the inbox pattern I use in MboaMeet: store the raw event under a unique id, process it later from a background worker, and make every credit and refund idempotent by reference.

ASP.NET CorePostgreSQLPaymentsWebhooks
MboaMeet22 Aug 20269 min read

An HLS video ladder on a single VPS: H.264 + HEVC tiers, aligned keyframes and Nginx doing the serving

A scrolling video feed needs fast starts and small files, and a CDN-backed media pipeline is a lot of infrastructure for an early product. Here's the pipeline I built for MboaMeet's feed: client-side compression, a Hangfire + FFmpeg ladder with three tiers in two codecs, and Nginx serving the segments straight from disk.

FFmpegHLSVideoHangfire
MboaMeet30 Jul 20269 min read

P2P-first 1:1 calls that fall back to an SFU mid-call without hanging up

Peer-to-peer WebRTC is cheap and private until a carrier NAT breaks it, and an SFU always connects but costs server bandwidth on every call. Here's how MboaMeet starts calls P2P with Coturn, and switches both phones to a self-hosted LiveKit room on the same call id when ICE fails.

WebRTCReact NativeSignalRLiveKit
MboaMeet8 Jul 202611 min read

Incoming calls that ring when the app is dead: VoIP push, CallKit and data-only FCM in React Native

A calling app is only as good as its ring, and a ring that needs a live WebSocket fails the moment iOS or Android kills your process. Here's the push-only pipeline I built for MboaMeet: PushKit reported to CallKit in native Swift before JavaScript boots, data-only FCM on Android, and a server that routes each token to the right transport.

React NativeiOSCallKitPushKit

Qashio Expense Tracker

HelloDocteur

NGO incident-reporting app

ELEX: solar energy tokenization