Mobile and Web app from same database?

Hi

Im just wondering is it possible to create an app for mobile and web that reads from the same database easily with meteor?

Is there some kind of plugin that makes it simple or would i have to create it all myself?

The app would have to have user accounts etc not just use get commands with no authentication.

Thanks

The official meteor tutorials cover all those things - creating a web app with user accounts and deploying the same app to mobile.

Blaze version:
https://www.meteor.com/tutorials/blaze/creating-an-app

React version:
https://www.meteor.com/tutorials/react/creating-an-app

They aren’t overly long tutorials and it is well worth doing one of them since they cover all the fundamentals.

Edit: maybe I misunderstood your question - I just saw your post in reply to another thread. You don’t want a cordova version of the same app for mobile but an altogether different client/project?

A cordova app would be fine but would it be a whole new app and not just the website in a webview?

I haven’t done it beyond the tutorial and a couple of experiments but the standard way / method in the tutorial has it build an app (e.g. an apk for Android). It’s essentially the same app as your web client so you only have one meteor project however you can alter behaviour such as routes, views etc as much as you want by using conditionals based on Meteor.isCordova( ). So it could look and behave like an entirely different app to your web page if you wanted it to. Plus, through Cordova, I believe you can access device-specific api’s but I haven’t played with that.

I actually want to build nothing more than a listview app with a few simple CRUD commands for each user.The vital thing is i need them to sign in to the same accounts that they have registered through he site. All feeding off the same database and data. It sounds like that should be ok with meteor.

It’s trivial, just point your MONGO_URL to the same DB from your different apps.

3 Likes

Exactly.

You probably do want to share some code between the apps though. Eg collection schemas.

The way to do this would be through packages or symlinks. This is less trivial though

1 Like