Adding a React-Native app to existing React + Meteor app


#1

Hi guys, we’ve been using React + Meteor for a few months now. I have an AWS EC2 server set up and the database hosted on Compose. So far it’s working very well.

Now that we want to move towards building a React-Native app for the website, I noticed that you’d have to run the Meteor backend on a server.

How would this work if I have a React + Meteor server already running? Does it mean that I can just code the React-Native and use a package like react-native-meteor to get access to methods and the API on my current server? Or does it mean that I’ll have to set up a separate Meteor server for my React-Native app.

Another option to explore might be to fully convert to Apollo. Does that also mean that I’ll have to have another EC2 server running Apollo?

Sorry if these questions seem very obvious.


#2

I asked a similar question quite recently:


#3

you just throw your react app online, then do a create-react-native app (or expo app) and download react-native-meteor. Then basically you set a function (forgot the name) to point at

“wss://example.com:8000/”

and then you use react-native-meteor helper functions that are slightly different but very similar to regular meteor. You call methods, or do something similar to createContainer to grab a publication. It’s probably more about learning react-native than it is hooking up to meteor.

Check out some of the links in the thread mentioned above.

I wouldn’t bother moving to apollo if you already have the meteor app built, although you can connect to an apollo back-end and use apollo-client in a RN app too.


#4

Thanks! I just dived into a few boilerplates. One of Spencer’s tutorial videos lit up the lightbulbs for me. You have to approach Meteor as a backend server handling server functions, and React Native as purely the client code calling Meteor’s APIs. It’s just slightly different than Meteor + React.


#5

Thanks dude. It’s good to know that I’ll only need one server for both my web app and my native app :slight_smile: