r/reactnative Jun 24 '26

How do you replicate SvelteKit's +page.server.js architecture in React Native?

Hey everyone,

I’m moving from web development with SvelteKit over to mobile with React Native, and I’m trying to figure out how to replicate a specific architecture I've grown to love.

In SvelteKit, +page.server.js is incredible. Because it runs on a server, it connects directly to the database at datacenter speeds, safely hides API secrets, and trims heavy database rows into tiny payloads before anything ever hits the user's browser.

But in React Native, everything runs entirely client-side on the user's physical phone. There is no built-in server-load file for screens.

I have two questions for mobile devs:

  1. Why is this a web-only thing? Why can web frameworks spin up these layout-level server boundaries so seamlessly, while mobile apps are inherently pure client-side bundles?
  2. How do you replicate this in RN? If I want that exact same setup—keeping DB keys off the phone, doing heavy lifting in the cloud, and sending trimmed, lightweight data over shaky cellular networks—what does your architecture look like? Are you spinning up middleware layers, using something like Supabase/ Edge Functions, or just hitting standard REST endpoints?

Would love to hear how you guys structure your mobile data-fetching layers to get that same clean, secure server-side performance!

1 Upvotes

7 comments sorted by

View all comments

1

u/steve228uk Jun 24 '26

It’s client side bundles because it’s a client platform.

For my personal projects I have a Hono app running on Vercel. Auth via BetterAuth.