SlideShare a Scribd company logo
1 of 17
Download to read offline
Introduction to MeteorJS
by Andrew McPherson
a bit about me.
Andrew McPherson
I like videogames.
1. Aspiring developer and entrepreneur.
2. Born and raised here in Chattanooga.
3. Student of computer science at UTC.
github.com/arcym
twitter.com/andrewmcp333
I once had a beard.
My current project is
“the online video editor”
● Originally it was built through a lot of
NodeJS with MongoDB and SocketIO.
● But I had a lot of issues in maintaining
consistency of data between clients.
● Then I stumbled upon MeteorJS!
a bit about my projects.
a bit about meteor.
Meteor is a javascript framework that offers...
● client data synchronization.
● reactive updating templates.
● external module interoperability.
● just really simple syntax.
It doesn’t want to replace existing
frameworks, but integrate upon them.
Want to see a bit of
syntax?
Starting the project
To initialize...
meteor create NoogaDocs
> NoogaDocs created!
cd NoogaDocs
ls
> .meteor
> NoogaDocs.css
> NoogaDocs.html
> NoogaDocs.js
To execute...
meteor
> Started proxy.
> Started database.
> Started application.
> App at 127.0.0.1:3000
In the .html
<head>
<title>NoogDocs</title>
</head>
<body>
<div id=“greeting”>
Hello, {{name}}!
</div>
</body>
In the .js
if(Meteor.isClient)
{
Template.name = “World”;
}
In the .css
#greeting
{
font-weight: bold;
}
Trying it out
In the .js
if(Meteor.isClient)
{
var who = “World”
Template.greet.name = who
}
In the .html
<template name=“greet”>
<div id=“greeting”>
Hello, {{name}}!
</div>
</template>
<body>
{{> greet}}
</body>
Defining a template
In the .js
if(Meteor.isClient)
{
Template.greet.name = function()
{
var who = “World”;
return who;
}
//this is just another way of doing it.
}
Using more functions
In the .js
if(Meteor.isClient)
{
Template.greet.name = function()
{
var who = this || “World”;
return who;
}
}
In the .html
{{> greet “Andrew”}}
{{> greet “Anthny”}}
{{> greet “Adam”}}
Accessing the data
In the .js
Template.list.persons = [
{name: “Andrew”},
{name: “Anthony”},
{name: “Adam”}
];
In the .html
<template name=“list”>
<ul>
{{#each persons}}
<li>{{name}}</li>
{{/each}}
</ul>
</template>
<body>
{{> list}}
</body>
Iterating via helpers
In the .js
var Persons = new Meteor.Collection(“persons”);
if(Meteor.isClient)
{
Template.list.persons = Persons.find({});
}
if(Meteor.isServer)
{
Persons.insert({name: “Andrew”});
Persons.insert({name: “Anthony”});
Persons.insert({name: “Adam”});
}
Including a database
Binding to events
In the .js
var Persons = new Meteor.Collection(“persons”);
if(Meteor.isClient)
{
Template.list.persons = Persons.find({});
Template.list.events = {
“click li”: function() {
Persons.remove(this._id);
}
}
}
So let’s try a live demo!
Hopefully I won’t mess this up! (May the programming gods have mercy on my soul)
some issues with meteor
● potential networking latency
● best for single page apps
● still in development :
●
●
●
● not much else than that.
some resources for meteor
Meteor Documentation: docs.meteor.com
Meteor Examples: meteor.com/learn-meteor
NoogaDocs Github: github.com/arcym/noogadocs
“Useful Meteor Resources”
discovermeteor.com/blog/useful-meteor-resources
“How to learn Javascript properly”
javascriptissexy.com/how-to-learn-javascript-properly
Thank you so much!

More Related Content

What's hot

PHP - Getting good with cookies
PHP - Getting good with cookiesPHP - Getting good with cookies
PHP - Getting good with cookiesFirdaus Adib
 
Forgot password for protected sheet on Microsoft Excel!?
Forgot password for protected sheet on Microsoft Excel!?Forgot password for protected sheet on Microsoft Excel!?
Forgot password for protected sheet on Microsoft Excel!?perfectpredesti94
 
Yearning jQuery
Yearning jQueryYearning jQuery
Yearning jQueryRemy Sharp
 
Lecture8 php page control by okello erick
Lecture8 php page control by okello erickLecture8 php page control by okello erick
Lecture8 php page control by okello erickokelloerick
 
Cookies in Angular | Install CookiesService
Cookies in Angular | Install CookiesServiceCookies in Angular | Install CookiesService
Cookies in Angular | Install CookiesServicePradeep Kumar
 
Cookies and sessions
Cookies and sessionsCookies and sessions
Cookies and sessionsUdaAs PaNchi
 
Session Management & Cookies In Php
Session Management & Cookies In PhpSession Management & Cookies In Php
Session Management & Cookies In PhpHarit Kothari
 
Operational transformation
Operational transformationOperational transformation
Operational transformationMatteo Collina
 
Cookie & Session In ASP.NET
Cookie & Session In ASP.NETCookie & Session In ASP.NET
Cookie & Session In ASP.NETShingalaKrupa
 
Pro bun-fighting - Working with JavaScript projects
Pro bun-fighting - Working with JavaScript projectsPro bun-fighting - Working with JavaScript projects
Pro bun-fighting - Working with JavaScript projectsFrances Berriman
 
async/await in Swift
async/await in Swiftasync/await in Swift
async/await in SwiftPeter Friese
 
To Err Is Human
To Err Is HumanTo Err Is Human
To Err Is HumanAlex Liu
 

What's hot (20)

Introduction to php web programming - sessions and cookies
Introduction to php   web programming - sessions and cookiesIntroduction to php   web programming - sessions and cookies
Introduction to php web programming - sessions and cookies
 
PHP - Getting good with cookies
PHP - Getting good with cookiesPHP - Getting good with cookies
PHP - Getting good with cookies
 
Mongo db for C# Developers
Mongo db for C# DevelopersMongo db for C# Developers
Mongo db for C# Developers
 
Forgot password for protected sheet on Microsoft Excel!?
Forgot password for protected sheet on Microsoft Excel!?Forgot password for protected sheet on Microsoft Excel!?
Forgot password for protected sheet on Microsoft Excel!?
 
Yearning jQuery
Yearning jQueryYearning jQuery
Yearning jQuery
 
Lecture8 php page control by okello erick
Lecture8 php page control by okello erickLecture8 php page control by okello erick
Lecture8 php page control by okello erick
 
Cookies in Angular | Install CookiesService
Cookies in Angular | Install CookiesServiceCookies in Angular | Install CookiesService
Cookies in Angular | Install CookiesService
 
Cookies and sessions
Cookies and sessionsCookies and sessions
Cookies and sessions
 
Php cookies
Php cookiesPhp cookies
Php cookies
 
java Cookies
java Cookiesjava Cookies
java Cookies
 
Session Management & Cookies In Php
Session Management & Cookies In PhpSession Management & Cookies In Php
Session Management & Cookies In Php
 
Operational transformation
Operational transformationOperational transformation
Operational transformation
 
Php sessions
Php sessionsPhp sessions
Php sessions
 
Cookie & Session In ASP.NET
Cookie & Session In ASP.NETCookie & Session In ASP.NET
Cookie & Session In ASP.NET
 
Pro bun-fighting - Working with JavaScript projects
Pro bun-fighting - Working with JavaScript projectsPro bun-fighting - Working with JavaScript projects
Pro bun-fighting - Working with JavaScript projects
 
async/await in Swift
async/await in Swiftasync/await in Swift
async/await in Swift
 
To Err Is Human
To Err Is HumanTo Err Is Human
To Err Is Human
 
Cookies & Session
Cookies & SessionCookies & Session
Cookies & Session
 
ASP.NET-Web Programming - Sessions and Cookies
ASP.NET-Web Programming - Sessions and CookiesASP.NET-Web Programming - Sessions and Cookies
ASP.NET-Web Programming - Sessions and Cookies
 
Cookies in PHP
Cookies in PHPCookies in PHP
Cookies in PHP
 

Similar to Introduction to MeteorJS Framework

Basic Tutorial of React for Programmers
Basic Tutorial of React for ProgrammersBasic Tutorial of React for Programmers
Basic Tutorial of React for ProgrammersDavid Rodenas
 
Taller evento TestingUY 2017 - API Testing utilizando Chakram
Taller evento TestingUY 2017 - API Testing utilizando ChakramTaller evento TestingUY 2017 - API Testing utilizando Chakram
Taller evento TestingUY 2017 - API Testing utilizando ChakramTestingUy
 
Yeoman AngularJS and D3 - A solid stack for web apps
Yeoman AngularJS and D3 - A solid stack for web appsYeoman AngularJS and D3 - A solid stack for web apps
Yeoman AngularJS and D3 - A solid stack for web appsclimboid
 
ADO.NET Entity Framework by Jose A. Blakeley and Michael Pizzo
ADO.NET Entity Framework by Jose A. Blakeley and Michael PizzoADO.NET Entity Framework by Jose A. Blakeley and Michael Pizzo
ADO.NET Entity Framework by Jose A. Blakeley and Michael PizzoHasnain Iqbal
 
Simple todo app with meteor
Simple todo app with meteorSimple todo app with meteor
Simple todo app with meteorAlex Long
 
Data models in Angular 1 & 2
Data models in Angular 1 & 2Data models in Angular 1 & 2
Data models in Angular 1 & 2Adam Klein
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup PerformanceJustin Cataldo
 
The Theory Of The Dom
The Theory Of The DomThe Theory Of The Dom
The Theory Of The Domkaven yan
 
Fun Teaching MongoDB New Tricks
Fun Teaching MongoDB New TricksFun Teaching MongoDB New Tricks
Fun Teaching MongoDB New TricksMongoDB
 
Build your own trello witihin 100 LOC (with Meteor)
Build your own trello witihin 100 LOC (with Meteor)Build your own trello witihin 100 LOC (with Meteor)
Build your own trello witihin 100 LOC (with Meteor)Andy Dai
 
Intro to MVC 3 for Government Developers
Intro to MVC 3 for Government DevelopersIntro to MVC 3 for Government Developers
Intro to MVC 3 for Government DevelopersFrank La Vigne
 
! Modernizr v2.0.6 httpwww.modernizr.com Copyri.docx
!  Modernizr v2.0.6  httpwww.modernizr.com   Copyri.docx!  Modernizr v2.0.6  httpwww.modernizr.com   Copyri.docx
! Modernizr v2.0.6 httpwww.modernizr.com Copyri.docxMARRY7
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizationsChris Love
 
Ajax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesAjax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesDoris Chen
 

Similar to Introduction to MeteorJS Framework (20)

code-camp-meteor
code-camp-meteorcode-camp-meteor
code-camp-meteor
 
Basic Tutorial of React for Programmers
Basic Tutorial of React for ProgrammersBasic Tutorial of React for Programmers
Basic Tutorial of React for Programmers
 
Taller evento TestingUY 2017 - API Testing utilizando Chakram
Taller evento TestingUY 2017 - API Testing utilizando ChakramTaller evento TestingUY 2017 - API Testing utilizando Chakram
Taller evento TestingUY 2017 - API Testing utilizando Chakram
 
Yeoman AngularJS and D3 - A solid stack for web apps
Yeoman AngularJS and D3 - A solid stack for web appsYeoman AngularJS and D3 - A solid stack for web apps
Yeoman AngularJS and D3 - A solid stack for web apps
 
ADO.NET Entity Framework by Jose A. Blakeley and Michael Pizzo
ADO.NET Entity Framework by Jose A. Blakeley and Michael PizzoADO.NET Entity Framework by Jose A. Blakeley and Michael Pizzo
ADO.NET Entity Framework by Jose A. Blakeley and Michael Pizzo
 
Simple todo app with meteor
Simple todo app with meteorSimple todo app with meteor
Simple todo app with meteor
 
Sequelize
SequelizeSequelize
Sequelize
 
Data models in Angular 1 & 2
Data models in Angular 1 & 2Data models in Angular 1 & 2
Data models in Angular 1 & 2
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
 
Green dao
Green daoGreen dao
Green dao
 
The Theory Of The Dom
The Theory Of The DomThe Theory Of The Dom
The Theory Of The Dom
 
Fun Teaching MongoDB New Tricks
Fun Teaching MongoDB New TricksFun Teaching MongoDB New Tricks
Fun Teaching MongoDB New Tricks
 
Build your own trello witihin 100 LOC (with Meteor)
Build your own trello witihin 100 LOC (with Meteor)Build your own trello witihin 100 LOC (with Meteor)
Build your own trello witihin 100 LOC (with Meteor)
 
Intro to MVC 3 for Government Developers
Intro to MVC 3 for Government DevelopersIntro to MVC 3 for Government Developers
Intro to MVC 3 for Government Developers
 
! Modernizr v2.0.6 httpwww.modernizr.com Copyri.docx
!  Modernizr v2.0.6  httpwww.modernizr.com   Copyri.docx!  Modernizr v2.0.6  httpwww.modernizr.com   Copyri.docx
! Modernizr v2.0.6 httpwww.modernizr.com Copyri.docx
 
AngularJS Basics with Example
AngularJS Basics with ExampleAngularJS Basics with Example
AngularJS Basics with Example
 
前端概述
前端概述前端概述
前端概述
 
Meteor Day Talk
Meteor Day TalkMeteor Day Talk
Meteor Day Talk
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizations
 
Ajax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesAjax Performance Tuning and Best Practices
Ajax Performance Tuning and Best Practices
 

Recently uploaded

Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 

Recently uploaded (20)

Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 

Introduction to MeteorJS Framework

  • 1. Introduction to MeteorJS by Andrew McPherson
  • 2. a bit about me. Andrew McPherson I like videogames. 1. Aspiring developer and entrepreneur. 2. Born and raised here in Chattanooga. 3. Student of computer science at UTC. github.com/arcym twitter.com/andrewmcp333 I once had a beard.
  • 3. My current project is “the online video editor” ● Originally it was built through a lot of NodeJS with MongoDB and SocketIO. ● But I had a lot of issues in maintaining consistency of data between clients. ● Then I stumbled upon MeteorJS! a bit about my projects.
  • 4. a bit about meteor. Meteor is a javascript framework that offers... ● client data synchronization. ● reactive updating templates. ● external module interoperability. ● just really simple syntax. It doesn’t want to replace existing frameworks, but integrate upon them.
  • 5. Want to see a bit of syntax?
  • 6. Starting the project To initialize... meteor create NoogaDocs > NoogaDocs created! cd NoogaDocs ls > .meteor > NoogaDocs.css > NoogaDocs.html > NoogaDocs.js To execute... meteor > Started proxy. > Started database. > Started application. > App at 127.0.0.1:3000
  • 7. In the .html <head> <title>NoogDocs</title> </head> <body> <div id=“greeting”> Hello, {{name}}! </div> </body> In the .js if(Meteor.isClient) { Template.name = “World”; } In the .css #greeting { font-weight: bold; } Trying it out
  • 8. In the .js if(Meteor.isClient) { var who = “World” Template.greet.name = who } In the .html <template name=“greet”> <div id=“greeting”> Hello, {{name}}! </div> </template> <body> {{> greet}} </body> Defining a template
  • 9. In the .js if(Meteor.isClient) { Template.greet.name = function() { var who = “World”; return who; } //this is just another way of doing it. } Using more functions
  • 10. In the .js if(Meteor.isClient) { Template.greet.name = function() { var who = this || “World”; return who; } } In the .html {{> greet “Andrew”}} {{> greet “Anthny”}} {{> greet “Adam”}} Accessing the data
  • 11. In the .js Template.list.persons = [ {name: “Andrew”}, {name: “Anthony”}, {name: “Adam”} ]; In the .html <template name=“list”> <ul> {{#each persons}} <li>{{name}}</li> {{/each}} </ul> </template> <body> {{> list}} </body> Iterating via helpers
  • 12. In the .js var Persons = new Meteor.Collection(“persons”); if(Meteor.isClient) { Template.list.persons = Persons.find({}); } if(Meteor.isServer) { Persons.insert({name: “Andrew”}); Persons.insert({name: “Anthony”}); Persons.insert({name: “Adam”}); } Including a database
  • 13. Binding to events In the .js var Persons = new Meteor.Collection(“persons”); if(Meteor.isClient) { Template.list.persons = Persons.find({}); Template.list.events = { “click li”: function() { Persons.remove(this._id); } } }
  • 14. So let’s try a live demo! Hopefully I won’t mess this up! (May the programming gods have mercy on my soul)
  • 15. some issues with meteor ● potential networking latency ● best for single page apps ● still in development : ● ● ● ● not much else than that.
  • 16. some resources for meteor Meteor Documentation: docs.meteor.com Meteor Examples: meteor.com/learn-meteor NoogaDocs Github: github.com/arcym/noogadocs “Useful Meteor Resources” discovermeteor.com/blog/useful-meteor-resources “How to learn Javascript properly” javascriptissexy.com/how-to-learn-javascript-properly
  • 17. Thank you so much!