Skip to content

Getting started with Meteor.js

Last updated on February 25, 2018

Meteor makes it simple to develop real-time web apps in a matter of hours.Meteor.js is an open-source platform build on Node and MongoDB. To develop applications with meteor you do not need to learn new languages, If you have a working knowledge of JavaScript and Mongo DB you can easily develop applications with Meteor.

Meteor allowing developers to write both their front end and back end code in Javascript. And to Store Data meteor uses Mongo DB.

Folder names mater to the meteor.Anything you put in a folder called ‘server’ will only be run on the server. And anything in a ‘client’ folder will be run on the client. The code in other folders, such as ‘lib’, are run on both client and server side.

One of the coolest thing about Meteor is, it is hot-pushes changes to JS, CSS, and HTML files to the browser, automatically, without making you reload the page.

How to install

Installing meteor on windows straight-forward, just you need to download and run the official Meteor Installer. Just follow the prompts and you will get it.

If you are using Mac OS X or Linux, then you need to run the following command

 curl https://install.meteor.com/ | sh

That is it for installation.

Create a Project

Let’s create the Meteor application and start it.

To create the app, open your terminal and type:

meteor create blog

This will create a new folder with application name(Here blog) with all of the files that a Meteor app needs:

blog.js       # a JavaScript file loaded on both client and server
blog.html     # an HTML file that defines view templates
blog.css      # a CSS file to define your app's styles
.meteor               # internal Meteor files

To run created app, from the command line go to project root folder and run the following command

meteor

Open your web browser and go to http://localhost:3000 to see the app running.

Templates

Meteor have is own template system called HandleBar. Handlebars templates look like regular HTML, with embedded handlebars expressions. A handlebars expression is a {{, some contents, followed by a }}. Handlebars HTML-escapes values returned by a {{expression}}. If you don’t want Handlebars to escape a value, use the “triple-slash”, {{{.

Database

Events

Sessions

Forms

Broadcasting – Publish and Subscribe

Methods

Application and folder structure

Packaging and Deployment

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments