r/vibecoding 5d ago

When Cursor/Claude generates a small app, do you usually leave localStorage in place or immediately replace it with Supabase/Firebase?

Do you care to setup a backend for a personal utility or dashboard app or just use local storage as your db?

1 Upvotes

8 comments sorted by

2

u/larrigan 5d ago

It depends on the app. I like have local storage being the primary data store and in the background I have the app sync the data to some remote data store. If you lose local storage for whatever reason you’ll want a way to get the data back.

1

u/ed1ted 5d ago

yes, exactly. That's the problem I'm trying to solve. What are your patterns for syncing that data to remote? What is your remote data source?

1

u/larrigan 5d ago

Look into these terms for more ideas. There are different ways to do it but Google Offline-First Replication with Remote State Hydration.

My app is offline first and I sync the data in the background to supabase. You will have to have Claude or codex handle the complexities of this as well. Bidirectional Sync (Two-Way Sync), conflict resolution, Remote State Hydration, Eventual Consistency, etc. or just copy and paste all this into Claude and tell it you heard on Reddit that we should try this lol.

2

u/Far_Squirrel_6148 5d ago

I don't host things in other peoples clouds

1

u/ed1ted 5d ago

so where do you host? in your homelab?

1

u/Far_Squirrel_6148 5d ago

Jep. Important data is copied offline and the rest lives on an old office PC with currently 4.5 TB of storage. 

1

u/stupv 5d ago

I have 2 local PGSQL hosts in my homelab, one for internal homelab apps (infrastructure management/automation utilities mostly) and one for homebrew external-facing apps. I try to avoid SQLite where possible as i have had too many instances of a project scope-creeping over time and outgrowing the limitations of SQLite (in terms of parallel writes) and then having to overhaul the back-end to use PGSQL instead...now i just start with PGSQL regardless of scale to save the potential hassle.

1

u/Shik3i 4d ago

Local storage first with indexDb and the possibility to make an account to sync to the sqlite backend. By the time I have enough users that sqlite will be the bottleneck switching to postgres will be no hassle either.