January 17, 2018 · Software Engineering Web Development Free & Open Source Software

Meteor: The accelerated framework for developing web applications

meteor

This time I'll be talking about my experience with the Meteor Framework for developing web applications. Meteor is a framework using Node.js as server base and Javascript as main coding language.

Since you can perfectly develop a web application directy in "native" Node.js without needing a framework, why should Meteor be used for?

All integrated framework (no assembly required)

Normally, in order to develop a full-stack application in Node.js you need to start a new project with npm init from your CLI and start loading all the needed packages from scratch. Some common things to import into any Node.js web project are Express (backend framework), Webpack (application packager for production), nodemon (backend development deploy), Babel (ES6 transpiler) and the frontend framework of your choice. After that, you're in charge to properly integrate those packages.

With Meteor, you only need meteor create my-new-app in your CLI in order to have a full boilerplate with basic frontend and backend dependencies. Now run meteor and your app will be automatically running in development mode and browser live reload. Easy enough, huh?

Meteor Advantages

  1. Convention over configuration: Meteor uses a convention over configuration policy in order to make boilerplating simple and easy. For example, all frontend code should be stored on a folder called client, backend code should be stored on server folder and shared code in imports folder.
  2. Atmosphere and NPM packaging systems: Meteor apps have access to both NPM (Node.js dependency manager) and Atmosphere (Meteor exclusive dependency manager) ecosystems in order to build high-standard apps with highly maintained packages from both platforms.
  3. Problems solved under the hood: Meteor has a lot of predefined solutions for a lot of common problems in Node.js applications. All Meteor apps have WebSocket support enabled by default (thanks to SockJS), database integration is built-in using MongoDB, it allows synchronous code methods on the backend (thanks to Fibers), backend error handling can be dealt with try-catch sentences and all REST endpoints can (and should) be replaced with Meteor's Remote Procedure Calls (much more reliable than REST).
  4. Integrated building and deploying systems: Browser live reload is integrated directly in Meteor core. Meteor building system allows Meteor apps to be bundled as standalone apps, requiring only Node.js and NPM to be deployed in production.
  5. Highly Customizable Frontend Integrations: Meteor apps can be integrated with AngularJS, Angular 2+, React, Blaze or Vue as a frontend framework very easy.

Meteor Disadvantages

  1. Highly opinionated: As with all convention over configuration frameworks, Meteor requires that the developer should know the basic code standards and ways to do things in Meteor. Although the Meteor Docs should be enough for this purpose, some not-so-skilled developers may need additional help (mostly from StackOverflow and Meteor Forums).
  2. Building could be a burden: Very heavy apps might take a lot of CPU, RAM and time in order to build a standalone app for production. This might be frustrating in case of making quick changes under pressure on the development server.
  3. Fast-changing framework: The CLI command for updating local Meteor dependencies is meteor update. Since it's a so simple command, it's easy to get things screwed up with breaking changes. Remember always to check the Meteor Changelog before doing a core update in order to avoid some nasty bugs from breaking changes.

My personal experience with Meteor

My first formal project developed in Meteor was NEURONE, my final assignment in order to get my Computer Engineer degree. My tutor in that assignment needed an application with very complex frontend and backend logic specifications under a Extreme Programming agile methodology. The first prototypes of NEURONE used Ruby on Rails and Django, but those frameworks didn't fulfill my tutor's expectations.

After searching the web for new alternatives, I found Meteor. It was an all-in framework, with lots of powerful features out-of-the-box that let me get focused on developing the application logic instead of building a big boilerplate for such a complex project. The Meteor prototipe got approved by my tutor, and all the application was based on that prototype.

My experience with Meteor has been really good. Most of the breaking changes have been dealt very easily and boilerplating is a breeze. The only downside are the compiling times in order to build a standalone Node.js app based on a Meteor app. Although NEURONE uses AngularJS as frontend framework, I have developed other minor projects using Angular 4 and Vue with Meteor.

If you have some experience with Javascript web development, and need a zero config framework in order to show results quicky, Meteor could be a great option for your next project.

I hope this can help somebody!

Cheers!