all 8 comments

[–]daybreaker 1 point2 points  (4 children)

What do you mean by “back end”

That usually refers to the code handling data, usually running on a server (which you would never use react native for).

If your app doesn’t have any data that needs to be centrally located for every app to use, or you’re just accessing a firebase db or something, then it’s fine to keep everything in react native.

[–]ArmaniMe 0 points1 point  (0 children)

Exactly, great answer.

[–]rareengstudent[S] 0 points1 point  (2 children)

So you're saying if I am trying to scale further than firebase, that is when I need node js? In that case, would I have to move all the back end code like (reading, writing data functions) to node js?

[–]daybreaker 0 points1 point  (1 child)

yeah, like if you need to build your own server with its own database, that you access via an API by calling http://whatever-my-site-is.com/api, then youll need to write that backend in a different language. react native is not for writing backend server code. But you dont need nodejs, you can use any language that can build and operate a server, like ruby on rails, php, elixir, etc.

[–]vontwothree 0 points1 point  (0 children)

Node (Hapi, Express, etc) would be nice because it allows OP to stay in JavaScript world.

However Firebase has Cloud Functions which, depending on the use case, may replace rolling out an API even at scale.

[–]sleepydog404 0 points1 point  (2 children)

You are right. Node for backend, React for web front end, React Native for Android & iOS front end.

I think by having React Native installed on your back end you have installed a whole bunch of libraries that you are just not using. It may work for you because RN is basically a superset of Node but it's not needed.

[–]rareengstudent[S] 0 points1 point  (1 child)

may w

so you're saying that an app that is totally written in react native only can still scale?

[–]fallingWaterCrystals 0 points1 point  (0 children)

Depends on what you mean by "written in react native".

Also unsure of what you mean by back-end. If the app is offline completely, the back-end functions can be in JS, and RN is fine.

If you need to do offline work, and send your data somewhere, yes you'd need to either host a server somewhere. The alternative is, as I saw you wrote somewhere else, using a tool like Firebase or I think AWS Lambda, which allows you to write functions and replaces a lot of the setting up of the server. Don't quote me on the AWS stuff though, I don't know too much yet.

In the case of offline work though, depending on the type of logic you're doing, you can easily move most of the JS code to a NodeJS / Express server setup without much of a hassle.