Routing in Meteor ≥ 1.0 - meteor

There are lots of routing related questions for earlier Meteor releases on SO, but where are we at in terms of best practices for basic routing in Meteor version ≥ 1.0?
I’ve previously used 3rd party packages such as Iron Router, Meteor-Router etc. From my understanding however, I could now achieve the same results by using the webapp package (https://docs.meteor.com/#/full/webapp) that I get ”for free” when running meteor create myRoutableApp.

Folks I've talked to that know far more than I do have indicated that Iron Router is the way to go. It's been updated for 1.0 and has a ton of really cool features.
In terms of using webapp, the documentation states that webapp can only function on the server side, which limits it to exposing your application's data to external HTTP requests. It's useful for creating an API that others can access, but it's not actually going to be useful to let people navigate around your app from the client side of things.

Related

Magnolia CMS and Keycloak (SSO) integration

How to integrate Magnolia CMS with Keycloak?
I need to have a Single Sign On with Keycloak, but haven't found a way (so far I was examining the configuration documentation and wiki pages for Magnolia).
I'm very new to Magnolia so this actually might be a noob question.
As a side note: Might not be best starter task if you are very new. Consider getting training where authentication and it's configuration is explained at length.
As for the task at hand, you would want to write your own authentication module and place it in the chain of JAAS modules Magnolia/Tomcat will evaluate when authenticating users.
There is similar module written looong time ago for NTLM based authentication that you can take as a blueprint (assuming you are enterprise customer and have access to enterprise code) for what you want to achieve. Otherwise, there's only stuff that is on documentation that might help.
- NTLM Module
- General security documentation
Might be frustrating starting experience tho.

What router and ui-framework to use in meteor?

Just started to discover meteor. created app with DiscoverMeteor book, but misunderstood many moments. then read Your first meteor application and Your first meteor application books. Realized that Todos example is really too simple to cover many important things. And only after that I found the official guide on Meteor.com! now reading about all these complex (for my opinion) things. and have 2 questions:
What router should I prefer to use? I want to create fast app with lots of data loading from the server. Found information that Iron router is deprecated, and Flow router is recommended nowadays, but also found that flow router can not route on server, only on client. And that exactly client routing is the reason why for example soundcloud is really slow. So that is the question - I know nothing about server/client routing, but want to make right decision for the future project.
What ui-framework to use? I read that blaze is easy to start, but react js is really powerful. So: is Blaze enough for serious project (like a popular blog)? Or do I have to learn react js in order not to rewrite code in the future?
I am working with Meteor 1.3.2.4, which is latest in market and believe, you don't have to do anything out of the box to go with experimental UI-Frameworks and stuff.
Blaze template which is handlebars based implementation is best.
Blaze template is very well glued with Socket.io, futures and DDP implementation for cutting edge implementation for asynchronous and reactive behaviour on UI.
Blaze is really good for cumbersome, heavy data websites as well. If you have any doubt, i can skype and show you what i have implemented in just 2 days on development using everything given by Meteor.
React.js, Koa.js (re-written Express framework), express etc are very good and powerful, but I think implementing it at initial level of your grasp is overkill. Go with Blaze first.
There are hundered sitting and developing Meteor.js just for you to be comfortable. I am not at all biased, I am giving you my open opinion.
I worked with Laravel 5.2, Play framework, MEAN.io, DJango in past, but believe there is nothing like pure Meteor js with there own packages. There are many videos on youtube like Meteor nights and stuff where you can find the developers from all around the world developing huge stuff just using stuff given by Meteor js.
For routing flow-router is good, even iron:router is awesome and easily gettable.
This video can guide you very well.
Flow Router is the recommended router by the official Meteor Guide. It's also the popular choice these days, and for a reason: it's a high quality router implementation.
As for MVC, it's really like choosing a religion. React has a huge community, possibly a bright future, and it's not Meteor-only unlike Blaze. But some folks find Blaze templates nicer than JSX files. I think it's easier to get help on StackOverflow if you pick React, but Blaze might be easier to get started.
Maybe this post helps a bit: How to set up React with Meteor?

Meteor.Router vs Iron Router

I want to create a multi-page Meteor web and mobile application. I am therefore looking for routing services.
From research, I gathered Iron Router is what I am looking for. But many tutorials also mention Meteor.Router
What are the differences (if any) between Iron Router and `Meteor.Router`?
iron:router has been the de facto standard routing solution for Meteor for over a year now, you should definitely use it, it's probably the most downloaded atmosphere package.
Please note however that the project has not been updated for several months and another router (FlowRouter) package emerged, focusing only on client-side routing and managing subscriptions, it takes a different approach than iron:router by making the routing code non-reactive by default.
Meteor.Router is a deprecated package that used to be maintained by one of the two main contributors to iron:router, tutorials mentioning this are clearly outdated.
The iron:router guide is a recommended reading to understand some advanced concepts like server-side and client-side routing.

Meteor's clientside technology stack

I'm thinking of adopting Meteor for my hobby project and I'm wondering something.
On one or two websites that were comparing various frameworks listed Meteor as one having both client and server libraries (a better term could be used here, but I can't think of one!).
So my question is...
Where can I find more info about this client library and its capabilities?
Can I drop the default library (whatever it may be) for something like Knockout? Do I need or want to?
Meteor has a database everywhere approach which means that you can use the same interface for accessing your data on both client and server. (i.e. MyCollection.find() would do a find whether you're on client or server.
As for client side libraries, meteor supports adding packages such as other templating engines like meteor-knockout. As well meteor comes with the Handlebars templating engine, which is what is used in the docs. See here
In general, if you want to know anything about Meteor, the docs are the best place to go.

Combine Meteor and Express

I am evaluating Meteor as an alternative to developing real-time capabilities using socket.io and it looks like awesome framework for single page real-time apps. It is great time saver that enables developer focusing on the business logic of the app, rather than writing boilerplate code. However, I find it still pre-mature for a medium size app with multiple pages/routings and REST api. Plus, number of features like i18n are still not available which requires some time investment to develop by myself.
I think that it would be great if I could combine Meteor and Express and use Meteor in use cases where it really shines.
Is it possible to develop an app using standard Express/Mongo stack and use Meteor for only specific part of the app where I need real time collaboration?
For example, can I share a session between Express/Connect and Meteor?
Thanks!
This does not directly answer your question, but I thought I'd throw it out there:
You should check out the community packages on atmosphere. Specifically, I'd recommend having a look at iron-router and i18n (I'll note I have not used the latter).
I've built a large production app that uses iron-router and it's running smoothly. You may also be able to use its server-side-routing capabilities to implement your REST api.

Resources