Skip to main content

Meteor tutorial - Part I

What is Meteor?

Meteor is a complete open source platform for building web and mobile application by using JavaScript. It is a combination of NodeJs, MongoDB and client side JavaScript.

Installing meteor

Meteor supports windows, linux and Mac operating systems. Invoke below command in terminal for installing meteor in mac operating system.

Check below link for installing meteor on other operating systems.

Creating an application

The command “meteor create <<app_name>>” is used for creating new meteor application. I have created an app called “myapp” and will see how we can run the application.

Running an application

“meteor run” command is used for running meteor application. Internally it start a node js server and by default that will listen 3000 port number. Just make sure you are in project directory (myapp) before invoking run command.

Other useful meteor commands

Meteor provides lot of useful commands for simplifying development process. This is very simple introduction about other meteor commands.

1. meteor help – This command is used for understanding purpose of other meteor commands. Example – I got the purpose of create command by using help command.

2. meteor debug – This is very useful command for debugging server side code.  Just use JavaScript keyword “debugger” for creating break points. By default it will wait at first statement of server side code.

3. meteor deploy <<site>> - This command is really useful for deploying application. Meteor provide free hosting and you can deploy application in <<appname>> If someone already used app name then you will have to use different application name for deploying. Let me deploy my application and it will take a while for deploying.

It is deployed successfully and for verification load the URL in browser, which we have used while deploying the application.

4. meteor update – This is used for updating meteor version used by an application. You will have to run this command from your application folder and make sure you are upgrading other packages for avoiding compatibility issues.

5. meteor add – This is used for adding new package into the application.

6. meteor remove – This is used for removing previously added package from the application.

7. meteor search – This command is used for searching available packages in meteor.

8. meteor mongo – This is used for opening MongoDB shell command for modifying mongo database collection. Meteor internally use mongo-db for saving data.

9. mongo reset – This is used for resetting current project to fresh state and it removes all local data.

Meteor File Structure

Meteor is very flexible for structuring application. It automatically loads all of our files, so we don’t need to use script and link tag for loading JavaScript and CSS files. It does the following while loading files.

1. All CSS files are sent to the browser and in production mode it is automatically concatenate and minify the source files.

2. JavaScript is loaded on the both client and server. We need to use Meteor.isClient and Meteor.isServer condition for stopping execution of certain part of the source code.

3. HTML templates are compiled and sent to the client.

Actually meteor provides some directory structure for securing and improving performance of the application.

/client – The files, which are in client directory, are only served to the client. This is a good place for keeping our client side source codes like CSS, HTML templates and client side JavaScript files.

/server – The files, which are in server directory are used and loaded while starting server. These files are never sent to the client. This is good place for keeping server side JavaScript files and by the way we can secure our application.

/public – The files in public folder are served to the client as-is. So this is good place for keeping our static contents like images, and fonts.

/private – The files in private are not sent to the client and also contents are loaded only when access through Assets - server side.


In this tutorial we have seen,

1. What is meteor?

2. Steps for Installing and Configuring meteor.

3. Meteor available commands and corresponding usage.

4. Directory structure of meteor application and deploying meteor application.

In my next tutorial, I am going to explain building mobile apps by using meteor.


Linoy K George said…
Good start Gnana. Nice information. Thanks. Bookmarking pointerunits.
Linoy K George said…
Good start Gnana. Nice information. Thanks. Bookmarking pointerunits.
Anonymous said…

In the provided information i agree our all information and really very nice all articles ,thanks for sharing in this post.

JAVA Training in Chennai
Unknown said…
Great. I also recommend you to use ideals virtual data room for your data protection. It will help to save your code from stealing and other troubles!
Joythi said…
It's very good post article. I've used now some keyword Selenium Training in Sholinganallur
that time I want you to search web browser I see our sites all content is really good.In this my first post our sites.Well Done good job, it's a very useful knowledge topics.
Selenium Training in Chennai
Unknown said…
Interesting and informative article.. very useful to me.. thanks for sharing your wonderful ideas.. please keep on updating..

Java Training in chennai

Java Training institute in chennai
tejaswini said…
This is additionally a generally excellent post which I truly delighted in perusing. It isn't each day that I have the likelihood to see something like this..
360DigiTMG said…
Through this post, I realize that your great information in playing with all the pieces was exceptionally useful. I advise this is the primary spot where I discover issues I've been scanning for. You have a smart yet alluring method of provider in malaysia
360DigiTMG said…

This is a great motivational article. In fact, I am happy with your good work. They publish very supportive data, really. Continue. Continue blogging. Hope you explore your next post

I was looking at a portion of your posts on this site and I consider this site is really enlightening! Keep setting up..
As forever your articles do move me. Each and every detail you have posted was extraordinary.
hrdf claimable courses"
360digitmg said…
I found Hubwit as a transparent site, a social hub which is a conglomerate of Buyers and Sellers who are ready to offer online digital consultancy at a decent cost.
data science course in hyderabad
tejaswini said…
If you don't mind, then continue this excellent work and expect more from your great blog posts
iot certification
360DigiTMGNoida said…
If you don't mind, then continue this excellent work and expect more from your great blog posts
360DigiTMG-Pune said…
Excellence blog! Thanks For Sharing, The information provided by you is really a worthy. I read this blog and I got the more information about
ai course in pune

Popular posts from this blog

Ext JS 4 – Creating web page using Ext.container.Viewport class and region propery

The Ext.container.Viewport is used for creating general web page and region property is used for splitting web page into different parts. Ext.container.Viewport is a specialized container represents the viewable area of the application (the browser area). It render itself to the document body, there is no need for providing renderTo property and it automatically sizes itself to size of the browser viewport. The viewport also re-size the child elements based on view area(based on browser width and height). The default layout of the viewport is border layout and we can customize this property according to our requirements. The viewport does not provide any scrolling. If necessary, the child elements(generally panels) within viewport needs to provide a scroll feature by using autoScroll property. See the below example for better understanding. This is Home.js file placed into app/view folder. Ext.define('MyApp.view.Home', { extend : 'Ext.container.Viewport&#

Getting servlet init parameter that is defined in web.xml

1. Create a new dynamic web project using eclipse. 2. Create a one new servlet and include the following code. package com.controller ; import; import javax.servlet .ServletConfig; import javax.servlet .ServletException; import javax.servlet .annotation.WebServlet; import javax.servlet .http.HttpServlet; import javax.servlet .http.HttpServletRequest; import javax.servlet .http.HttpServletResponse; @ WebServlet ( "/LoginController" ) public class LoginController extends HttpServlet {                 private static final long serialVersionUID = 1L;                 public LoginController() {         super ();     }     protected void doPost( HttpServletRequest request, HttpServletResponse response) throws ServletException , IOException {                                 ServletConfig config = getServletConfig ();                                 System.out.println( "Init parameter user nam

Simple Login Application Using Spring MVC and Hibernate – Part 1

 I hope developers working in web application development might hear about MVC architecture. Almost all technologies provide support for MVC based web application development, but the success is based on many factors like reusable of the code, maintenance of the code, future adaption of the code, etc..,  The success of the Spring MVC is “ Open for extension and closed for modification ” principle. Using Spring MVC the developers can easily develop MVC based web application. We don’t need any steep learning curve at the same time we need to know the basics of spring framework and MVC architecture. The Spring MVC consists of following important components. 1. Dispatcher servlet 2. Controller 3. View Resolver 4. Model Spring MVC - Overview  The overall architecture of Spring MVC is shown here.  1. When “Dispatcher Servlet” gets any request from client, it finds the corresponding mapped controller for the request and just dispatches the request to the corresponding contro