Short intro about Meteor and its architecture
Let’s describe each of these components called Isopacks:
Distributed Data Protocol, known as DDP, is dedicated protocol based on JSON. It is websocket-based and is one of the core elements of Meteor. Clients talk to Meteor servers over DDP protocol. On query a server is sending the results down to the client, and then pushing changes to the client when anything changes in the database. DDP is simple to use and can be used with many other programming languages like PHP, Python, Objective-C or Java as well.
Simply put, Livequery is responsible for changes detecting and pushing all changes to the subscribed clients over DDP.
Blaze is reactive UI library which uses template engine known as Spacebars. If you prefer to work with other libraries or frameworks like Angular, React or Ember, feel free to use them, but Blaze is simpler than any other.
Meteor comes with database that simulates actual database inside the browser, called Minimongo. On the server side Meteor uses MongoDB.Connection between Minimongo and MongoDB is reactive, data is kept in sync.
Setting a project
Meteor also supports CLI (Command Line Interface), allows developers to quickly set up an entire development environment like:
- Create new app
- Add/Remove packages
- Run, reset and monitor app
- Access MongoDB shell
- Deploy application
Meteor supports OSX, Windows and Linux, but I will show you how Meteor can be installed and how it works under Linux. So, open your terminal and simply install latest Meteor release:
curl https://install.meteor.com/ | sh
Now you can create a project:
meteor create myapp
Meteor creates three files (myapp.css, myapp.html, myapp.js). Now,you can run your application with the following commands:
cd myapp meteor npm install meteor
You can access the application with your browser at http://localhost:3000. If you want to change the port you can do it with following command:
meteor run --port 8080
And now you can see your page in your browser at http://localhost:8080. That was easy, right? :)
Benefits of using Meteor
If you are using Meteor, you will be able to develop very fast web application. There are a lot of benefits using Meteor framework as following:
- You are able to develop with just one language
- CLI interface
- You are able to build hybrid mobile applications using Apache Cordova
- Integration with smart packages
- By default applications are reactive
- Great and supportive community
Meteor is one of the best frameworks for one-page app development we have today and I highly recommend you to start using it, because It is completely open source and it’s the easiest and fastest way to create a full stack online application like real time collaboration tools, customer support, multiplayer web games and more. . Simply put, Meteor is the future.