Is next.js + meteor possible?

The server side rendering and lazy loading of pages seems really cool from next.js

Would is be possible to use next.js to serve react components plus use all the features of meteor?

2 Likes

What other features are you wanting? I guess DDP/Livequery? Next.js already gives you a build tool, React, SSR, etc.

I think if Meteor moved all it’s libraries to NPM instead of a private package system, then yes, it would be somewhat easy to do, but that isn’t the case right now. Nor do I think it is in the immediate plans.

Isn’t next.js only for frontend stuff? I mean is possible to use it with something with Phoenix or Meteor in backend, isn’t it ?

you could just learn webpack instead of mixing 2 frameworks…

1 Like

Basically on top of next js I would love to have the publish subscribe system as well as the meteor call system so ddp as well.

2 Likes

next.js + Apollo + mongo + Accounts UI. Would be a good starter kit. Not possible right now?

5 Likes

No, with accounts-ui would not be possible.

But: next.js + apollo + mongo + js-accounts is possible.

According to the docs, js-accounts is inspired by meteor-accounts. It exists to give you a similar experience, without the meteor stack.

https://js-accounts.github.io/docs/

Hm.

This package, along with the rest of the packages under the js-accounts organization are under active development and are not ready for consumption.

1 Like

I think, it should be possible if we run NextJS app and Meteor server on different ports. Let’s say, NextJS on port 80 and Meteor on port 3000. NextJS will simply render the React pages / components and will make call to Meteor on 3000 port using react-web-meteor package.

It will be best if NextJS can be integrated with in Metoer, so that both can run on the same port (Next runs within Meteor control) - as shown here for FeatherJS + NextJS integration.

I haven’t looked into Next.js too much but it seems SSR is the shining aspect with other parts that seem like they should be standard.

For what it’s worth, if you’d like to keep using Meteor + React with SSR you could try scaffold out an app with my cli (maka-cli) with those options and see how it goes.


$ maka create ssr-meteor-app --ssr=true

1 Like

What about running meteor.js as a backend and next.js as frontend?

Suppose you need an informative website, which has a backend for order processing
(e commerce) made with meteor.js.

The front end can connect to the backend through DDP connections or direct rest with nimble:restivus or simple:rest which both have the ability to expose your methods/publications as rest endpoints.

Create orders in the backend through DDP call from next.js app

I found valuable info on Evaluating Meteor as an API server post

1 Like

I think it‘s a bad idea to mix both build systems somehow together but you could use next export and then serve that over meteor or just keep going with 2 ports.

I built a rather big application using meteor+apollo on the server-side and next+apollo on the client-side and never looked back since

1 Like

Sounds interesting. Could you share the details?

1 Like