Enabling offline mode with the t3 stack

I'm using the t3 stack with trpc and prisma. The application I'm building is for use on construction sites who need a cached version of their data when their wifi is patchy. I want to keep using the stack i'm currently using but let users have access to their information if the wifi is sketchy which syncs to the database when wifi is established.

The application doesn't hold alot of data - maybe 50-200 rows of 2-3 sql tables.

Options I've considered

  1. Using the persistance features in client state management libraries (e.g. zustand)
  2. Using a tool that keeps a local SQLite db in sync with a server db e.g. WatermelonDB, ElectricDB, powersync
The first option seems straight forward but will need some custom code to manage the sync when wifi is re established - the second looks more fit for purpose but requires I drop prisma and use the libraries ORM or raw SQL (I'm not comfortable dropping prisma)

Thoughts?
Was this page helpful?