What Is MeteorJS?
Components of Meteor
There are 5 major components on which MeteorJS is built upon.
This library of MeteorJS is helpful to give live updates to user. This library is responsible for updating DOM. It is just like AngularJS where in DOM you have to just tell what you want and if there is any update then it will take care of that.
Meteor project comes with MongoDB, without writing any configuration file. It can be accessed from remote by adding 2 in the Meteor server port. For instance, if Meteor is running at 3000 then MongoDB will run at 3002 port. The MongoDB files are in .meteor directory of Meteor project.
Distributed Data Protocol(DDP), is a communication layer between client and server. It is based on web sockets. Everything that happens between client and server is only through DDP. Client and server do not know each other. It is not mandatory that client and server both should be of Meteor. Meteor client can talk to other servers who understand DDP and Meteor server can talk to other clients who understand DDP.
It is a communication layer between and server and database. It continuously listens to database and sends updates to the server if anything happens in the database. So if anything happens in the database then without hitting the refresh button you will get updated results on the screen. In general, it requires a separate implementation for each database.
Benefits of Meteor
You can get real-time updates without writing an extra code for it.
Packaging system – You can save lots of time by using MeteorJS packages. There are many built-in packages that can be used as it is. Using packages and writing your package for others is also very easy. Rails developers can think of gem as a package.
Meteor automatically syncs the state between client and server.
The community of Meteor is very active and supportive.
Below are the few commands that will install MeteorJS and then it will create the project for authentication.
$ curl https://install.meteor.com/ | sh
To create an application with name authentication
meteor create authentication
The output of above command will be the following.
Go to authentication directory – cd authentication and you will see project structure like this:
Type command –
Open the browser and go to
By executing above commands you will see something like this-
Add package meteor add accounts-base meteor add accounts-password meteor add accounts-ui
The above 3 commands will add authentication packages.
Display buttons on UI
Add below line in authentication.html and comment
The above line will give you ‘Sign in’ link on your browser and when you click on that link you will get ‘Sign in Form’ and other links that are required for authentication
So the above commands will create a fully working authentication app.
Now it’s your time to play with Meteor.