Meteor JS for beginners

Introduction to meteor js:
  1. Meteor is a full-stack JavaScript platform for developing modern web and mobile applications.
  2. It' is open source.
  3. It's released in 2012 by the meteor development group 
  4. It's is written using node js.
  5. By default MongoDB as the default database for any application.
Meteor_js

What’s inside?
    1. Mongo DB (For Database)
    2. Node js (For application running(server).
    3. Lots of packages (To reduce the code and time)
    4. For install of packages go to http://atmospherejs.com/  it's is a repository for meteor packages.
    Why is Meteor awesome?
          1. Installation is as simple as it can be Build reactive apps in no time.
          2. Build mobile apps in no time
          3. Deployment using 1 command.
          4. After changes in source code no need to build and deploy the application .meteor by default build and deploy the application into the server.
          Installation (windows/ Linux)

          Installation is very simple, using one command to install the whole setup.
          1. For Linux users: curl https://install.meteor.com/ | sh
          2. For Windows users: https://install.meteor.com/windows.
          Application Structure

                                                  - lib
                                                  - client
                                                  - server
                                                  - public
          Components

          Templates:Templates are used to create a connection between our interface and our JavaScript code.
          Sample snippet:
          <body>
                {{> loginButtons}}
          </body>
          <template name="leaderboard">
             <h1>Welcome to Meteor!</h1>
          </template>

          helpers: a helper function is a regular JavaScript function that’s attached to a template and allows us to execute code from within an interface.
          Sample snippet:
          Template.leaderboard.helper({
          'function reference name' : function(){
          return "janardhan randhi"
          }});

          Each block: It iterates the elements (like for loop in java).

          Sample snippet:
          {{#each player}}
          {{Filed name}}
          {{/each}}

          Events: Events allow us to trigger the execution of code when a user clicks on a button.
          Sample snippet:
          Template.leaderboard.events({
          'click': function(){
          // code goes here
          }
          });

          Sessions: sessions allow us to store small pieces of data that is not saved to the database.
          To create a Session use the below statement
          Session.set('Reference name ', 'value');
          To get the session use the below statement
          Session.get('Reference name');

          Methods: Methods are blocks of code that are executed on the server after being triggered by the client.
          Sample snippet:
          Meteor.methods({
          'MethodRefName': function(){
          console.log("Hello world");
          }
          });
          To call a method :Meteor.call('MethodRefName');

          Available packages
          • login provider: These packages make it extremely easy to add a back-end for an accounts system to an application.
          • Accounts-password: This package creates the back-end for an accounts system that relies on an email and password for registration and logging in.Accounts-UI : To instantly add the front-end of an accounts system to a project. etc....
          Useful Commands
          • For creating a project: meteor create project-name
          • For adding packages: meteor add package-name
          • For removing packages: meteor remove package-name
          • For running application: meteor run or meteor
          • For reset the database: meteor reset
          • For adding platform:meteor add-platform  name
          • For building the application: meteor build platform-name 
          Deployment
          • Create a server on a site like DigitalOcean.
          • Install the required software on that server.
          • Configure the install of that software.
          • Upload the project files to the server.
          Reference links

                SUBSCRIBE TO OUR NEWSLETTER

                I’m the Founder of quickdevops.com. I am a Professional Blogger, Application developer, YouTuber. I’ve been blogging since 2015.I spend a lot of time learning new techniques and actively help other people learn web development through a variety of help groups and writing web development tutorials for my website and blog about advancements in web design and development.Besides programming I love spending time with friends and family and can often be found together going out catching the latest movie or planning a trip to someplace I've never been before.

                0 Response to "Meteor JS for beginners"

                Post a Comment