T.A Consultant · frontend

AgriTA

A multi-tenant agriculture supply-chain platform, traceable from a QR code to the plot of land.

A multi-tenant agriculture supply-chain platform and its farm app. One person can act for the platform and for several tenants, and anyone with a QR code can see the plot of land without logging in.

01The app assumed one tenant. People had several.

One user can hold a platform context plus a tenant context per membership, and the app was written as if there were only one. I wrote the spec and the plan, then built the context state, the switch API, a bootstrap gate, the switch mutation, discarding of stale refreshes, the switcher and the wrong-context screens. My final review of that work caught inverted guards. Another developer has since done more on the auth layer.

decided
Clear the whole query cache on switch, plus a session-id guard.
instead of
Adding a context key across every query key.
the cost
Refetching after each switch. It is the safe first version, and the spec calls it that.

02Telling people why, instead of showing a 403

Sidebar and dashboard entries declare which context they belong to, and scope is checked before entitlement. A route opened in the wrong context lands on a screen that explains the problem. TA-Farm mirrors backend rules and permissions before sending a request. I also built the Platform Console areas for tenants, subscriptions, official codes and seller review.

03A map that a phone can afford

The public page at /trace/ needs no login and draws the plot boundary from a published snapshot. Imagery comes from VietMap, falling back to Esri on the first failed tile. Tests guard the coordinate swap between GeoJSON and Leaflet, which order latitude and longitude differently.

decided
A viewer-only Leaflet map, lazy-loaded and rendered only when a boundary exists.
instead of
Sharing the editor and geometry libraries from TA-Farm.
the cost
Two map stacks to maintain, so that someone on a phone downloads only a map.

04Inventory writes that can be retried

In TA-Farm I built growing areas, seasons, harvest lots and satellite jobs. Inventory writes carry idempotency keys, so a retried request cannot record a write twice.

What this does not cover

  • This is frontend work. The backend belongs to other developers on the team.
next projectE-Office