Why is it so hard to start a new Meteor project? (At least for me)


#1

I’d consider myself as experienced Meteor developer. I’ve implemented a number of Meteor apps in the last four years, almost all of them still run today, updated to the latest Meteor version.

But regardless of this experience, starting a new Meteor project feels hard for me. It might be a personal thing, as I observed this feeling before I started with Meteor. Interestingly, it felt easier in my early days with Meteor, when Blaze and Bootstrap was fine. Nowadays, I’d have to choose between different front-end frameworks (Blaze, React, Angular, Vue), Designs (Bootstrap, Material, antd, …), back-end data layers (pure Mongo collections, Grapher, Astronomy). Even the connection between browser and server could be different, when using GraphQL with VulcanJS instead of the Meteor subscriptions and methods.

In these old days, the package yogiben:admin provided an administration interface, which I’m missing completely now.

So, to come to the point: I’m looking for some kind of starter or recipe to start a new application, which provides the following features:

  • SimpleSchema2 (as it seems to be a standard, and I’ve used SimpleSchema with success in my previous projects)
  • React or Blaze (it took a while, but now I like React more than Blaze, ViewModel is also very nice)
  • Automatic generation of the form (might be AutoForm or uniforms or something else)
  • Tables with filtering and sorting (like the aslagle:reactive-table)
  • Integrated accounts and permission system (The permission system of VulcanJS seems to be very good, in combination with alaning:roles)
  • Reactivity (as this is Meteor, unfortunately VulcanJS doesn’t provide real reactivity)
  • An admin panel to test the schema and enter data into Mongo

In my vision of a perfect world, I’d create the schema, and the rest (routes, navigation, tables, forms, CRUD operations) could be generated automatically. (Something like scaffolding in Django or Rails.)

Do you know something of this kind?
If not, which components would you suggest to include in such a starter/generator/recipe?

Thanks for your help!


#2

Maybe PUP can meet your expectations, at least for some points ? (formerly known as “Base”, by The Meteor Chef)

Documentation page :


#3

Actually, I took a look at these boilerplate before writing my post. The documentation is really great, but I miss the automation stuff in this package, as e. g. the form is written manually.

I’ve been working more than ten years on a project, where the automatic generation of forms was crucial for the product to deliver in time and to ensure consistency. Therefore, I’d generate even the simplest form automatically :slight_smile: And I don’t like to write repeating HTML code :wink:


#4

That’s where https://github.com/vazco/uniforms comes in - it’s AutoForm for react, works really well, and is very well supported. Just drop it in, configure your forms to build from your schema, and you’re all set!


#5

In my opinion it has to do with tradeoffs, it’s hard to build a framework that fits every use case. You try to please the new comers and make it highly opinionated and few years down the road advanced users will claim it’s tightly coupled and not flexible. you make flexible and the new comers will say there are many ways of doing this and that. So it’s about tradeoffs and balance, and I personally think Meteor has a nice balance, try starting a node.js project without a framework and watch the numbers of decisions you need to make before even hitting the hello world url!

Furthermore, it takes considerable about resources to create and maintain the scaffolding you envision given the churn within the node.js ecosystem, you start a project today and you never know which NPM package will make it to the next year! the amount of thoughts, work and documentation that went into creating and maintaining something like the Pup project is admirable and if you observe their documentation you can see how much of their previous work is considered outdated less then two years down the road!

With that said, my approach is that if I want a simple app or a POC then I’d go with Blaze and if I want something that could span multiple months and involves multiple developers, then I’d go with React and follow the Meteor Guide and use Pup as a starting point.


#6

@hwilson uniforms is absolutely cool. In combination with a (yet unknown) unitable component, it would form a prominent part of my vision.


#7

You’re right, it has to do with tradeoffs, and it’s impossible to build a framework for every use case.

But I’ve seen mechanisms in Django and Rails more than a decade ago, which I’d like in my preferred world, namely the Meteor universe.

And the churn in this ecosystem is horrible, it’s a full-time job to stay reasonably current. It might be my vision of Meteor (or a product based on it) to be more opinionated – just like VulcanJS, where you don’t have to think about lots of the questions that arise, when you start a Meteor project from scratch.


#8

Yes, I think it was possible to build and maintain a scaffolding project in Django and Rails but near impossible to do today with JS and Node.js ecosystem due to the rapid change, in fact it’s hard to even keep a simple project up to date.

Let me give you some specific examples from my own experience with the react/npm and node.js ecosystem. If you started a project last year, this year you’d probably need to:

  1. update react router to V4 which require a complete rewrite, because well they found a better way to do routing
  2. update react boostrap, well bootstrap 4 finally released
  3. if you used react material ui then you’re not in a better position, since they’re rewriting it again after screwing up their inline styling strategy
  4. updated all your components to react to 16, which broke half of the other smaller libraries because it no longer include the prototype validation library
  5. update the forms library, we used formsy react which almost died but then luckily new maintainers came to rescue it
  6. update the data grid, we are using react data grid, and that is still blocking the update path to react 16
  7. we used framework7 in one mobile update, and last year they released v2 which again require a complete rewrite since well they found a better way, but then who uses html fm7 now, use react native, but it’s 2018 how about vue nativescript :sweat_smile:

And there are many more, notice that these are all core libraries, routing, view rendering, data grid, forms, and UI components, they all required major rewrite within a year. If you go back one more year, you’ll probably need to rewrite your entire project since now we’re using imports and ES6. And frankly, out of all those libraries Meteor has been the most backward compatible, I had a project written in Blaze few years back and I just run meteor update to 1.6.1 added few nm packages and it worked again!

So I’m not sure how anyone could create and maintain a scaffolding project under so much churn.


#9

I see the point. Thanks for sharing your experience. Fortunately, most of my projects use Blaze, so updating to Meteor 1.6 was a lot easier :slight_smile:


#10

I’m a big fan of creating “templates”, even though every organization will end up requiring their own version because every organization’s library needs are slightly different.

I agree that there is a fair amount of churn, and you will be updating your template significantly every six months to a year. The good news is that your updated template will be more functional and/or performant!

I think the Pup Meteor template is pretty good.

I based my meteor-application-template-react on pieces of it, though I wanted Semantic UI rather than Bootstrap.


#11

@qnipp I just realized that VulcanJS created by @sacha might be the closest thing to what you envision.

Check the docs, Vulcan is also using schema to generate most of what you looking for!


#12

@alawi VulcanJS made by @sacha is great. According to my research it is the most complete “product” I’m looking for.

It currently misses the following points of my wishlist:

  • Scaffolding (or something else to automatically create routes, a table and CRUD forms)
  • A table component with sorting capabilities
  • Meteor-like Reactivity (it has a 20 second polling interval)

But it would be worth to extend them there :slight_smile:


#13

Thanks! That’s some good feedback. Actually, there is a scaffolding tool WIP but it just needs that last 10% of work to update it, test it, write more docs, etc. I agree it’ll be a great addition to the platform, but in the meantime since you usually only create 3-4 collections per project anyway I get by with copy/pasting and adapting existing projects.

As for the table component, it’s true the current Datatable doesn’t have sorting, but it wouldn’t be that hard to add. I’d say one afternoon’s worth of work maybe, if you’re not too familiar with the codebase? And it does have built-in search, pagination, smart content cells (it’ll display objects, strings, links, images, etc. automatically) and can be customized as much as you want:

And it’s true that Vulcan doesn’t really have real-time updates but 1) it’s still Meteor so it actually does have real-time as long as you use it like any other regular Meteor app and 2) I can probably count on the fingers of one hand the number of Meteor projects I’ve seen where real-time was actually needed, as opposed to just an optional nice-to-have.


#14

Definitely use Vue! It’s simpler than React, has better performance for large pages, and has great documentation and tooling.


#15

Oh, I see, scaffolding is on the way. That’s nice.

I’ll take a deeper look into VulcanJS, and maybe – I don’t want to promise it – I’ll take a look into the sorting capabilities of the table.

You’re absolutely right about the real-time updates. As Meteor developer I’m used to have them, even if the applications don’t need them. I was expecting them in VulcanJS, as it is based on Meteor, but after digging a little bit deeper into VulcanJS, the absence of this feature is obvious, as VulcanJS doesn’t use the Meteor data layer but Apollo/GraphQL.

@sacha Thanks for the great work!


#16

Sounds good! We actually have a new getting started tutorial that makes everything much easier in the beginning: https://github.com/VulcanJS/Vulcan-Starter/

And for the table, you can always start using the Datatable component without sorting now, and whenever sorting is added it should just work automatically when you update Vulcan :slight_smile:


#17

@qnipp I came to the same conclusion myself, it is too hard (and thus costly) to start a Meteor/React project from scratch without some kind of framework. For the past year, I’ve been trying to address this issue by creating a starter framework that I’m calling VXFrame. This is a set of over 200 Meteor/React/Bootstrap components, third-party packages and back-end support that addresses everything you mentioned. There is no generator per se, but the components are designed to be selectively overridden and extended.


#18

@sotarules Is VXFrame publicly available?


#19

We did something similar with react and bootstrap internally. I think it’s largely has to do with the react ecosystem, you need to get a router, grid, forms, state management, and many other third party components etc and also you need to maintain those as I mentioned above and ensure they’re working well together… or you can go with something like AntD.

Do you’ve the VXFrame open sourced by any chance so I can compare it to what we did?


#20