Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor js as front end, what use for backend? [closed]

Tags:

meteor

backend

I would like to ask about best practiecs in creation of backend to Meteor.

I use Meteor js as Front End, and I am planning to use bunch of apache/php/yii framework/YiiMongoDbSuite at another port as backend(admin panel).

Maybe someone advices me the best practive for easy creation of admin part of meteor application?

like image 281
Voldemar Duletskiy Avatar asked Feb 17 '13 13:02

Voldemar Duletskiy


People also ask

Is Meteor front-end or backend?

It uses the Distributed Data Protocol and a publish–subscribe pattern to automatically propagate data changes to clients without requiring the developer to write any synchronization code. On the client, Meteor can be used with any popular front-end JS framework, Vue, React, Svelte, Angular, or Blaze.

Is Meteor a front-end framework?

Meteor wird mit einem voreingestellten Front-End-Framework (Blaze) ausgeliefert. Dieses kann jedoch nach Belieben durch andere Front-End-Frameworks (u. a. Vue, React, Svelte, Angular) ersetzt werden.

What is Meteor JS used for?

Meteor is a full-stack JavaScript platform for developing modern web and mobile applications. Meteor includes a key set of technologies for building connected-client reactive applications, a build tool, and a curated set of packages from the Node. js and general JavaScript community.

What is Meteor backend?

Meteor is a full-stack JavaScript platform for building web and mobile apps. Meteor makes it easier to create real-time apps, since it alone offers a full ecosystem to work with, instead of combining couple of different tools and frameworks to get the same effect.


1 Answers

If you've already built your backend in PHP/Rails,etc you could consider a DDP client or REST to relay messages between meteor and the backend. DDP has a couple of advantages over REST

its an open connection you could even get down live updates.

Im not sure of any DDP clients for PHP yet though. There are a handful:

  • Nodejs (https://github.com/oortcloud/node-ddp-client)
  • .NET (https://github.com/sonyarouje/DDPClient.NET)
  • Ruby (https://github.com/tmeasday/ruby-ddp-client)
  • Python (https://github.com/meteor/meteor/tree/master/examples/unfinished/python-ddp-client)

You could use REST to communicate too, but you would be missing out on a lot of functionality. With DDP you could access Meteor.methods and make subscriptions quite easily.

Finally, you could just connect straight to your mongodb and put your changes in. Meteor will handle them within 10 seconds.

But why not use Meteor itself as a backend? Using a seperat Meteor instance might make your admin area more secure. With Meteor as a backend, it would be far easier to maintain, you'd have compatible code to share between the two. You could use Meteor.connect to access the client instance.

If your motivation is security you could just do this. There's almost no benefit of using a separate language and stack when Meteor already makes it so easy.

UPDATE : Meteor 0.7.0 introduced oplog tailing so you wouldn't have to wait 10 seconds for the updates to appear anymore. They would be instant as if from meteor itself.

like image 98
Tarang Avatar answered Oct 06 '22 11:10

Tarang