SlideShare a Scribd company logo
Overview
1. What is Meteor? Why should I use it?
2. Example App
3. Apps using Meteor
4. Additional Resources
Web + Mobile Tutorial!
Discover Meteor Giveaway
Brandon Bechtel
@brandonbechtel
bsbechtel@gmail.com
What is Meteor??
• Not your traditional MVC framework
– Instead of html templates over http, data-over-
the-wire (DDP)
– Think Ruby on Rails + Angular.js
– Better yet, think of it as something completely
new
– -MongoDB Backend
• Built on top of Node.js – all JavaScript
Framework – meteor.js
• Fulltime meteor core dev team working on
tools for the entire developer lifecycle:
– Developer Accounts
– Package Repository – atmospherejs.com
• 1 line command to add or publish packages
– Deploy to web and mobile from same codebase
What is Meteor??
Platform – meteor.com
• 195,000 Unique Installs
• 20,357 stars on Github
• 2565 packages on atmosphere
• 134 Meteor Day Meetups across the globe
• $11.2mm in seed funding from @a16z
What is Meteor??
Community
Why Meteor??
• Modern UI with less code
– No more web pages with links to navigate, instead
modern, fast, JS transitions
• Live updates/hot code deploy
• Reactive – db updates visible in UI
immediately, across all clients
• Latency Compensation – super fast!!
Technical Case
• Rapid iteration and MVP development
(cheaper)
• All web devs know JS, HTML, and CSS (easy to
find tech help)
• Easy for a non-tech founder to get started
coding!
Why Meteor??
Business Case
Example
• Install:
$ curl https://install.meteor.com/ | sh
• Example App:
$ meteor create --example localmarket
$ cd localmarket
$ meteor
**Only for Mac and Linux, Windows users use nitrous.io
Best Resources
• Discover Meteor (discovermeteor.com)
– For learning Meteor from the ground up, this is
the best resource available
• Meteor-talk Google Group
– Many friendly developers ready to answer your
questions
• Official Documentation (docs.meteor.com)
• Online Meteor DevShops:
– EventMind, Meteor Hacks
Future Developments
• Roadmap.meteor.com
– SEO (Meteor serves entire pages that are
rendered in JS)
– SQL Integration
– Server Side Rendering
Tutorial!
• Windows users, open up and register at:
http://www.nitrous.io
• Follow along at:
– www.meteor.com/install
Tutorial!
• If you haven’t installed, do so now:
$ curl https://install.meteor.com/ | sh
• Create app:
$ meteor create simple-todos
$ cd simple-todos
$ meteor
With app running, you can view it at localhost:3000
Tutorial – simple-todos.css
Copy and paste from:
https://www.meteor.com/try/2
*Tutorial is to learn Meteor, not CSS
Tutorial – simple-todos.html
<head>
<title>Todo List</title>
</head>
<body>
<div class="container">
<header>
<h1>Todo List</h1>
</header>
<ul>
{{#each tasks}}
{{> task}}
{{/each}}
</ul>
</div>
</body>
<template name="task">
<li>{{text}}</li>
</template>
Tutorial – simple-todos.js
if (Meteor.isClient) {
// This code only runs on the client
Template.body.helpers({
tasks: [
{ text: "This is task 1" },
{ text: "This is task 2" },
{ text: "This is task 3" }
]
});
}
Tutorial – Collections (our data)
// At the top of simple-todos.js
Tasks = new Mongo.Collection("tasks");
MongoDB Collections
Data structure can be migrated and modified as desired, no additional code needed.
Data is structured similar to JSON.
Tutorial – Collections (our data)
// simple-todos.js
if (Meteor.isClient) {
// This code only runs on the client
Template.body.helpers({
tasks: function () {
return Tasks.find({});
}
});
}
Remember: tasks is the data variable (called expressions) in the template, we are now
pulling the data from the database
Tutorial – Forms
<!-- simple-todos.html -->
<header>
<h1>Todo List</h1>
<!-- add a form below the h1 -->
<form class="new-task">
<input type="text" name="text" placeholder="Type to add new
tasks" />
</form>
</header>
Tutorial – Saving Inputs
// simple-todos.js
// Inside the if (Meteor.isClient) block, right after Template.body.helpers:
Template.body.events({
"submit .new-task": function (event) {
// This function is called when the new task form is submitted
var text = event.target.text.value;
Tasks.insert({
text: text,
createdAt: new Date() // current time
});
// Clear form
event.target.text.value = "";
// Prevent default form submit
return false;
}
});
Tutorial – Sorting Results
// simple-todos.js
Template.body.helpers({
tasks: function () {
// Show newest tasks first
return Tasks.find({}, {sort: {createdAt: -1}});
}
});
We are now sorting our tasks based on the createdAt timestamp we added when
inserting our task in the collection
Tutorial – Updating and Deleting
<!-- simple-todos.html -->
<!-- replace the existing task template with this code -->
<template name="task">
<li class="{{#if checked}}checked{{/if}}">
<button class="delete">&times;</button>
<input type="checkbox" checked="{{checked}}" class="toggle-
checked" />
<span class="text">{{text}}</span>
</li>
</template>
We are adding check boxes and a delete button to each saved task
Tutorial – Updating and Deleting
// simple-todos.js
// In the client code, below everything else
Template.task.events({
"click .toggle-checked": function () {
// Set the checked property to the opposite of its current
value
Tasks.update(this._id, {$set: {checked: ! this.checked}});
},
"click .delete": function () {
Tasks.remove(this._id);
}
});
These event handlers update the db accordingly
Tutorial – Deploy!
$ meteor deploy my_app_name.meteor.com
Deploy your app to Meteor’s servers *need to create a meteor acct to do this
Tutorial – Deploy to Mobile
$ meteor install-sdk android
$ meteor add-platform android
$ meteor run android
Or
$ meteor run android-device
Tutorial – Sessions
<!-- simple-todos.html -->
<!-- add the checkbox to <body> right below the h1 -->
<label class="hide-completed">
<input type="checkbox" checked="{{hideCompleted}}" />
Hide Completed Tasks
</label>
Adding a checkbox to hide completed tasks
Tutorial – Sessions
// simple-todos.js
// Add to Template.body.events
"change .hide-completed input": function (event {
Session.set("hideCompleted", event.target.checked);
}
Adding event handler for checkbox
Tutorial – Sessions
// simple-todos.js
// Replace the existing Template.body.helpers
Template.body.helpers({
tasks: function () {
if (Session.get("hideCompleted")) {
// If hide completed is checked, filter tasks
return Tasks.find(
{checked: {$ne: true}},
{sort: {createdAt: -1}}
);
} else {
// Otherwise, return all of the tasks
return Tasks.find({}, {sort: {createdAt: -1}});
}
},
hideCompleted: function () {
return Session.get("hideCompleted");
}
});
Returning tasks expression with completed tasks filtered out if box is checked
Tutorial – Count of Incomplete Tasks
// simple-todos.js
// Add to Template.body.helpers
incompleteCount: function () {
return Tasks.find({checked: {$ne: true}}).count();
}
<!-- simple-todos.html -->
<!-- display the count at the end of the <h1> tag -->
<h1>Todo List ({{incompleteCount}})</h1>
Tutorial – Adding User Accounts
$ meteor add accounts-ui accounts-password
<!-- simple-todos.html -->
{{> loginButtons}}
// simple-todos.js
// At the bottom of the client code
Accounts.ui.config({
passwordSignupFields: "USERNAME_ONLY"
});
Tutorial – Adding User Accounts
// simple-todos.js
Tasks.insert({
text: text,
createdAt: new Date(), // current time
owner: Meteor.userId(), // _id of logged in user
username: Meteor.user().username // username of
logged in user
});
Tutorial – Adding User Accounts
// simple-todos.js
{{#if currentUser}}
<form class="new-task">
<input type="text" name="text" placeholder="Type to
add new tasks" />
</form>
{{/if}}
<!-- simple-todos.html -->
<span class="text"><strong>{{username}}</strong> - {{text}}</span>
Tutorial – Adding User Accounts
$ meteor add accounts-facebook
$ meteor add accounts-twitter
$ meteor add accounts-github
$ meteor add accounts-google
$ meteor add accounts-meetup
Tutorial – Security
$ meteor remove insecure
Meteor automatically adds insecure package to new
projects for getting started.
Insecure allows editing of database from client.
We don’t want this on a production app!
Tutorial – Security
Now our client side db operations (insert, update, and
remove) don’t work!
We need to replace these with a call to a Meteor Method.
Meteor Methods run on both the client and server to
immediately update the local copy of the db (mini-
mongo) and speed up operation – latency
compensation.
Tutorial – Defining Methods
// At the bottom of simple-todos.js, outside of the client-only block
Meteor.methods({
addTask: function (text) {
// Make sure the user is logged in before inserting a task
if (! Meteor.userId()) {
throw new Meteor.Error("not-authorized");
}
Tasks.insert({
text: text,
createdAt: new Date(),
owner: Meteor.userId(),
username: Meteor.user().username
});
},
deleteTask: function (taskId) {
Tasks.remove(taskId);
},
setChecked: function (taskId, setChecked) {
Tasks.update(taskId, { $set: { checked: setChecked} });
}
});
Tutorial – Defining Methods
// replace Tasks.insert( ... ) with:
Meteor.call("addTask", text);
// replace Tasks.update( ... ) with:
Meteor.call("setChecked", this._id, ! this.checked);
// replace Tasks.remove( ... ) with:
Meteor.call("deleteTask", this._id);
Tutorial – Filtering Data
Use Publications and Subscriptions to send the right data
to the right templates instead of sending your whole db
to the client!
$ meteor remove autopublish
Tutorial – Publications and
Subscriptions
// At the bottom of simple-todos.js
if (Meteor.isServer) {
Meteor.publish("tasks", function () {
return Tasks.find();
});
}
// At the top of our client code
Meteor.subscribe("tasks");

More Related Content

What's hot

How to Build SPA with Vue Router 2.0
How to Build SPA with Vue Router 2.0How to Build SPA with Vue Router 2.0
How to Build SPA with Vue Router 2.0
Takuya Tejima
 
The Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.jsThe Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.js
Holly Schinsky
 
Building and deploying React applications
Building and deploying React applicationsBuilding and deploying React applications
Building and deploying React applications
Astrails
 
Building a js widget
Building a js widgetBuilding a js widget
Building a js widget
Tudor Barbu
 
Vue.js
Vue.jsVue.js
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Luciano Mammino
 
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
Katy Slemon
 
Create a meteor chat app in 30 minutes
Create a meteor chat app in 30 minutesCreate a meteor chat app in 30 minutes
Create a meteor chat app in 30 minutes
Designveloper
 
Vuex
VuexVuex
Vue business first
Vue business firstVue business first
Vue business first
Vitalii Ratyshnyi
 
Testing frontends with nightwatch & saucelabs
Testing frontends with nightwatch & saucelabsTesting frontends with nightwatch & saucelabs
Testing frontends with nightwatch & saucelabs
Tudor Barbu
 
Instant and offline apps with Service Worker
Instant and offline apps with Service WorkerInstant and offline apps with Service Worker
Instant and offline apps with Service Worker
Chang W. Doh
 
Meet VueJs
Meet VueJsMeet VueJs
Meet VueJs
Mathieu Breton
 
Vue.js is boring - and that's a good thing
Vue.js is boring - and that's a good thingVue.js is boring - and that's a good thing
Vue.js is boring - and that's a good thing
Joonas Lehtonen
 
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Jeado Ko
 
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas EmbletongDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
George Nguyen
 
Vue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue routerVue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue router
Katy Slemon
 
WordPress 2017 with VueJS and GraphQL
WordPress 2017 with VueJS and GraphQLWordPress 2017 with VueJS and GraphQL
WordPress 2017 with VueJS and GraphQL
houzman
 
Vuejs testing
Vuejs testingVuejs testing
Vuejs testing
Greg TAPPERO
 
Drupal point of vue
Drupal point of vueDrupal point of vue
Drupal point of vue
David Ličen
 

What's hot (20)

How to Build SPA with Vue Router 2.0
How to Build SPA with Vue Router 2.0How to Build SPA with Vue Router 2.0
How to Build SPA with Vue Router 2.0
 
The Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.jsThe Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.js
 
Building and deploying React applications
Building and deploying React applicationsBuilding and deploying React applications
Building and deploying React applications
 
Building a js widget
Building a js widgetBuilding a js widget
Building a js widget
 
Vue.js
Vue.jsVue.js
Vue.js
 
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
 
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
 
Create a meteor chat app in 30 minutes
Create a meteor chat app in 30 minutesCreate a meteor chat app in 30 minutes
Create a meteor chat app in 30 minutes
 
Vuex
VuexVuex
Vuex
 
Vue business first
Vue business firstVue business first
Vue business first
 
Testing frontends with nightwatch & saucelabs
Testing frontends with nightwatch & saucelabsTesting frontends with nightwatch & saucelabs
Testing frontends with nightwatch & saucelabs
 
Instant and offline apps with Service Worker
Instant and offline apps with Service WorkerInstant and offline apps with Service Worker
Instant and offline apps with Service Worker
 
Meet VueJs
Meet VueJsMeet VueJs
Meet VueJs
 
Vue.js is boring - and that's a good thing
Vue.js is boring - and that's a good thingVue.js is boring - and that's a good thing
Vue.js is boring - and that's a good thing
 
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
 
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas EmbletongDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
 
Vue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue routerVue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue router
 
WordPress 2017 with VueJS and GraphQL
WordPress 2017 with VueJS and GraphQLWordPress 2017 with VueJS and GraphQL
WordPress 2017 with VueJS and GraphQL
 
Vuejs testing
Vuejs testingVuejs testing
Vuejs testing
 
Drupal point of vue
Drupal point of vueDrupal point of vue
Drupal point of vue
 

Viewers also liked

exchang server 2007
exchang server 2007exchang server 2007
exchang server 2007
mrzape
 
S4 tarea4 golom
S4 tarea4 golomS4 tarea4 golom
S4 tarea4 golom
Miriam Gomez Lopez
 
New Housing New York: Built Project South Bronx (Bloomberg + EPA + AIA Propos...
New Housing New York: Built Project South Bronx (Bloomberg + EPA + AIA Propos...New Housing New York: Built Project South Bronx (Bloomberg + EPA + AIA Propos...
New Housing New York: Built Project South Bronx (Bloomberg + EPA + AIA Propos...
Makrand Bhoot
 
S4 tarea4 golom
S4 tarea4 golomS4 tarea4 golom
S4 tarea4 golom
Miriam Gomez Lopez
 
Lição 9 Coisas sacrificadas aos ídolos
Lição 9   Coisas sacrificadas aos ídolosLição 9   Coisas sacrificadas aos ídolos
Lição 9 Coisas sacrificadas aos ídolos
Wander Sousa
 
從台灣輸入公民軟體的香港經驗
從台灣輸入公民軟體的香港經驗從台灣輸入公民軟體的香港經驗
從台灣輸入公民軟體的香港經驗
CODE4HK
 
2013.11.07 Reporting Back
2013.11.07 Reporting Back2013.11.07 Reporting Back
2013.11.07 Reporting Back
MAYDAY.US
 
Lição 35 o cuidado com a língua
Lição 35   o cuidado com a línguaLição 35   o cuidado com a língua
Lição 35 o cuidado com a língua
Wander Sousa
 
arthimatic progressions
arthimatic progressionsarthimatic progressions
arthimatic progressions
Häřšhāđ Kîñg
 
skydrive_ppt_doc
skydrive_ppt_docskydrive_ppt_doc
skydrive_ppt_doc
JohniBcpO1107-133143 Doe
 
Prorocanstva i tajne
Prorocanstva i tajneProrocanstva i tajne
Prorocanstva i tajne
srbenda
 
M.Tech_final_presentation
M.Tech_final_presentationM.Tech_final_presentation
M.Tech_final_presentation
Devanil Choudhury
 
Biodiesel presentation1
Biodiesel presentation1Biodiesel presentation1
Biodiesel presentation1
Bharat Pandey
 
Lição 5 Os Dons Espirituais
Lição 5   Os Dons EspirituaisLição 5   Os Dons Espirituais
Lição 5 Os Dons Espirituais
Wander Sousa
 
MAYDAY.US Report on 2014 Elections
MAYDAY.US Report on 2014 ElectionsMAYDAY.US Report on 2014 Elections
MAYDAY.US Report on 2014 Elections
MAYDAY.US
 
Introduction to Creating Websites
Introduction to Creating WebsitesIntroduction to Creating Websites
Introduction to Creating Websites
Justin Clune
 
sand_filter
sand_filtersand_filter
sand_filter
Phil Madrigal
 
Applying
Applying Applying
Applying
Rossan Niraula
 
Analisis Kebijakan Internasional
Analisis Kebijakan InternasionalAnalisis Kebijakan Internasional
Analisis Kebijakan Internasional
Novia Anwar
 

Viewers also liked (20)

exchang server 2007
exchang server 2007exchang server 2007
exchang server 2007
 
S4 tarea4 golom
S4 tarea4 golomS4 tarea4 golom
S4 tarea4 golom
 
New Housing New York: Built Project South Bronx (Bloomberg + EPA + AIA Propos...
New Housing New York: Built Project South Bronx (Bloomberg + EPA + AIA Propos...New Housing New York: Built Project South Bronx (Bloomberg + EPA + AIA Propos...
New Housing New York: Built Project South Bronx (Bloomberg + EPA + AIA Propos...
 
S4 tarea4 golom
S4 tarea4 golomS4 tarea4 golom
S4 tarea4 golom
 
Lição 9 Coisas sacrificadas aos ídolos
Lição 9   Coisas sacrificadas aos ídolosLição 9   Coisas sacrificadas aos ídolos
Lição 9 Coisas sacrificadas aos ídolos
 
從台灣輸入公民軟體的香港經驗
從台灣輸入公民軟體的香港經驗從台灣輸入公民軟體的香港經驗
從台灣輸入公民軟體的香港經驗
 
2013.11.07 Reporting Back
2013.11.07 Reporting Back2013.11.07 Reporting Back
2013.11.07 Reporting Back
 
Lição 35 o cuidado com a língua
Lição 35   o cuidado com a línguaLição 35   o cuidado com a língua
Lição 35 o cuidado com a língua
 
arthimatic progressions
arthimatic progressionsarthimatic progressions
arthimatic progressions
 
skydrive_ppt_doc
skydrive_ppt_docskydrive_ppt_doc
skydrive_ppt_doc
 
Prorocanstva i tajne
Prorocanstva i tajneProrocanstva i tajne
Prorocanstva i tajne
 
M.Tech_final_presentation
M.Tech_final_presentationM.Tech_final_presentation
M.Tech_final_presentation
 
Biodiesel presentation1
Biodiesel presentation1Biodiesel presentation1
Biodiesel presentation1
 
Lição 5 Os Dons Espirituais
Lição 5   Os Dons EspirituaisLição 5   Os Dons Espirituais
Lição 5 Os Dons Espirituais
 
MAYDAY.US Report on 2014 Elections
MAYDAY.US Report on 2014 ElectionsMAYDAY.US Report on 2014 Elections
MAYDAY.US Report on 2014 Elections
 
Introduction to Creating Websites
Introduction to Creating WebsitesIntroduction to Creating Websites
Introduction to Creating Websites
 
sand_filter
sand_filtersand_filter
sand_filter
 
Applying
Applying Applying
Applying
 
Let go
Let goLet go
Let go
 
Analisis Kebijakan Internasional
Analisis Kebijakan InternasionalAnalisis Kebijakan Internasional
Analisis Kebijakan Internasional
 

Similar to Meteor Day Talk

Javascript MVVM with Vue.JS
Javascript MVVM with Vue.JSJavascript MVVM with Vue.JS
Javascript MVVM with Vue.JS
Eueung Mulyana
 
Meteor.js Workshop by Dopravo
Meteor.js Workshop by DopravoMeteor.js Workshop by Dopravo
Meteor.js Workshop by Dopravo
ArabNet ME
 
Writing HTML5 Web Apps using Backbone.js and GAE
Writing HTML5 Web Apps using Backbone.js and GAEWriting HTML5 Web Apps using Backbone.js and GAE
Writing HTML5 Web Apps using Backbone.js and GAE
Ron Reiter
 
code-camp-meteor
code-camp-meteorcode-camp-meteor
code-camp-meteor
meghna gogna
 
Using RequireJS with CakePHP
Using RequireJS with CakePHPUsing RequireJS with CakePHP
Using RequireJS with CakePHP
Stephen Young
 
Nuxtjs cheat-sheet
Nuxtjs cheat-sheetNuxtjs cheat-sheet
Nuxtjs cheat-sheet
ValeriaCastillo71
 
Level up apps and websites with vue.js
Level up  apps and websites with vue.jsLevel up  apps and websites with vue.js
Level up apps and websites with vue.js
Violetta Villani
 
Level up apps and websites with vue.js
Level up  apps and websites with vue.jsLevel up  apps and websites with vue.js
Level up apps and websites with vue.js
Commit University
 
METEOR 101
METEOR 101METEOR 101
METEOR 101
Tin Aung Lin
 
Having Fun Building Web Applications (Day 2 slides)
Having Fun Building Web Applications (Day 2 slides)Having Fun Building Web Applications (Day 2 slides)
Having Fun Building Web Applications (Day 2 slides)
Clarence Ngoh
 
Google app engine by example
Google app engine by exampleGoogle app engine by example
Google app engine by example
Alexander Zamkovyi
 
Creating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlCreating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-html
Ilia Idakiev
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
Marco Vito Moscaritolo
 
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mohammad Shaker
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
tutorialsruby
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
tutorialsruby
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
tutorialsruby
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
tutorialsruby
 
Angular js
Angular jsAngular js
Angular js
Eueung Mulyana
 
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSAngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
murtazahaveliwala
 

Similar to Meteor Day Talk (20)

Javascript MVVM with Vue.JS
Javascript MVVM with Vue.JSJavascript MVVM with Vue.JS
Javascript MVVM with Vue.JS
 
Meteor.js Workshop by Dopravo
Meteor.js Workshop by DopravoMeteor.js Workshop by Dopravo
Meteor.js Workshop by Dopravo
 
Writing HTML5 Web Apps using Backbone.js and GAE
Writing HTML5 Web Apps using Backbone.js and GAEWriting HTML5 Web Apps using Backbone.js and GAE
Writing HTML5 Web Apps using Backbone.js and GAE
 
code-camp-meteor
code-camp-meteorcode-camp-meteor
code-camp-meteor
 
Using RequireJS with CakePHP
Using RequireJS with CakePHPUsing RequireJS with CakePHP
Using RequireJS with CakePHP
 
Nuxtjs cheat-sheet
Nuxtjs cheat-sheetNuxtjs cheat-sheet
Nuxtjs cheat-sheet
 
Level up apps and websites with vue.js
Level up  apps and websites with vue.jsLevel up  apps and websites with vue.js
Level up apps and websites with vue.js
 
Level up apps and websites with vue.js
Level up  apps and websites with vue.jsLevel up  apps and websites with vue.js
Level up apps and websites with vue.js
 
METEOR 101
METEOR 101METEOR 101
METEOR 101
 
Having Fun Building Web Applications (Day 2 slides)
Having Fun Building Web Applications (Day 2 slides)Having Fun Building Web Applications (Day 2 slides)
Having Fun Building Web Applications (Day 2 slides)
 
Google app engine by example
Google app engine by exampleGoogle app engine by example
Google app engine by example
 
Creating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlCreating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-html
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhone
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
 
Angular js
Angular jsAngular js
Angular js
 
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSAngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
 

Recently uploaded

办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
xjq03c34
 
Bengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal BrandingBengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal Branding
Tarandeep Singh
 
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
thezot
 
HijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process HollowingHijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process Hollowing
Donato Onofri
 
Securing BGP: Operational Strategies and Best Practices for Network Defenders...
Securing BGP: Operational Strategies and Best Practices for Network Defenders...Securing BGP: Operational Strategies and Best Practices for Network Defenders...
Securing BGP: Operational Strategies and Best Practices for Network Defenders...
APNIC
 
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
3a0sd7z3
 
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
APNIC
 
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
k4ncd0z
 
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
3a0sd7z3
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
davidjhones387
 
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
rtunex8r
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
Paul Walk
 

Recently uploaded (12)

办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
 
Bengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal BrandingBengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal Branding
 
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
 
HijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process HollowingHijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process Hollowing
 
Securing BGP: Operational Strategies and Best Practices for Network Defenders...
Securing BGP: Operational Strategies and Best Practices for Network Defenders...Securing BGP: Operational Strategies and Best Practices for Network Defenders...
Securing BGP: Operational Strategies and Best Practices for Network Defenders...
 
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
 
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
 
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
 
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
 
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
 

Meteor Day Talk

  • 1.
  • 2. Overview 1. What is Meteor? Why should I use it? 2. Example App 3. Apps using Meteor 4. Additional Resources Web + Mobile Tutorial! Discover Meteor Giveaway Brandon Bechtel @brandonbechtel bsbechtel@gmail.com
  • 3. What is Meteor?? • Not your traditional MVC framework – Instead of html templates over http, data-over- the-wire (DDP) – Think Ruby on Rails + Angular.js – Better yet, think of it as something completely new – -MongoDB Backend • Built on top of Node.js – all JavaScript Framework – meteor.js
  • 4. • Fulltime meteor core dev team working on tools for the entire developer lifecycle: – Developer Accounts – Package Repository – atmospherejs.com • 1 line command to add or publish packages – Deploy to web and mobile from same codebase What is Meteor?? Platform – meteor.com
  • 5. • 195,000 Unique Installs • 20,357 stars on Github • 2565 packages on atmosphere • 134 Meteor Day Meetups across the globe • $11.2mm in seed funding from @a16z What is Meteor?? Community
  • 6. Why Meteor?? • Modern UI with less code – No more web pages with links to navigate, instead modern, fast, JS transitions • Live updates/hot code deploy • Reactive – db updates visible in UI immediately, across all clients • Latency Compensation – super fast!! Technical Case
  • 7. • Rapid iteration and MVP development (cheaper) • All web devs know JS, HTML, and CSS (easy to find tech help) • Easy for a non-tech founder to get started coding! Why Meteor?? Business Case
  • 8. Example • Install: $ curl https://install.meteor.com/ | sh • Example App: $ meteor create --example localmarket $ cd localmarket $ meteor **Only for Mac and Linux, Windows users use nitrous.io
  • 9.
  • 10.
  • 11. Best Resources • Discover Meteor (discovermeteor.com) – For learning Meteor from the ground up, this is the best resource available • Meteor-talk Google Group – Many friendly developers ready to answer your questions • Official Documentation (docs.meteor.com) • Online Meteor DevShops: – EventMind, Meteor Hacks
  • 12. Future Developments • Roadmap.meteor.com – SEO (Meteor serves entire pages that are rendered in JS) – SQL Integration – Server Side Rendering
  • 13. Tutorial! • Windows users, open up and register at: http://www.nitrous.io • Follow along at: – www.meteor.com/install
  • 14. Tutorial! • If you haven’t installed, do so now: $ curl https://install.meteor.com/ | sh • Create app: $ meteor create simple-todos $ cd simple-todos $ meteor With app running, you can view it at localhost:3000
  • 15. Tutorial – simple-todos.css Copy and paste from: https://www.meteor.com/try/2 *Tutorial is to learn Meteor, not CSS
  • 16. Tutorial – simple-todos.html <head> <title>Todo List</title> </head> <body> <div class="container"> <header> <h1>Todo List</h1> </header> <ul> {{#each tasks}} {{> task}} {{/each}} </ul> </div> </body> <template name="task"> <li>{{text}}</li> </template>
  • 17. Tutorial – simple-todos.js if (Meteor.isClient) { // This code only runs on the client Template.body.helpers({ tasks: [ { text: "This is task 1" }, { text: "This is task 2" }, { text: "This is task 3" } ] }); }
  • 18. Tutorial – Collections (our data) // At the top of simple-todos.js Tasks = new Mongo.Collection("tasks"); MongoDB Collections Data structure can be migrated and modified as desired, no additional code needed. Data is structured similar to JSON.
  • 19. Tutorial – Collections (our data) // simple-todos.js if (Meteor.isClient) { // This code only runs on the client Template.body.helpers({ tasks: function () { return Tasks.find({}); } }); } Remember: tasks is the data variable (called expressions) in the template, we are now pulling the data from the database
  • 20. Tutorial – Forms <!-- simple-todos.html --> <header> <h1>Todo List</h1> <!-- add a form below the h1 --> <form class="new-task"> <input type="text" name="text" placeholder="Type to add new tasks" /> </form> </header>
  • 21. Tutorial – Saving Inputs // simple-todos.js // Inside the if (Meteor.isClient) block, right after Template.body.helpers: Template.body.events({ "submit .new-task": function (event) { // This function is called when the new task form is submitted var text = event.target.text.value; Tasks.insert({ text: text, createdAt: new Date() // current time }); // Clear form event.target.text.value = ""; // Prevent default form submit return false; } });
  • 22. Tutorial – Sorting Results // simple-todos.js Template.body.helpers({ tasks: function () { // Show newest tasks first return Tasks.find({}, {sort: {createdAt: -1}}); } }); We are now sorting our tasks based on the createdAt timestamp we added when inserting our task in the collection
  • 23. Tutorial – Updating and Deleting <!-- simple-todos.html --> <!-- replace the existing task template with this code --> <template name="task"> <li class="{{#if checked}}checked{{/if}}"> <button class="delete">&times;</button> <input type="checkbox" checked="{{checked}}" class="toggle- checked" /> <span class="text">{{text}}</span> </li> </template> We are adding check boxes and a delete button to each saved task
  • 24. Tutorial – Updating and Deleting // simple-todos.js // In the client code, below everything else Template.task.events({ "click .toggle-checked": function () { // Set the checked property to the opposite of its current value Tasks.update(this._id, {$set: {checked: ! this.checked}}); }, "click .delete": function () { Tasks.remove(this._id); } }); These event handlers update the db accordingly
  • 25. Tutorial – Deploy! $ meteor deploy my_app_name.meteor.com Deploy your app to Meteor’s servers *need to create a meteor acct to do this
  • 26. Tutorial – Deploy to Mobile $ meteor install-sdk android $ meteor add-platform android $ meteor run android Or $ meteor run android-device
  • 27. Tutorial – Sessions <!-- simple-todos.html --> <!-- add the checkbox to <body> right below the h1 --> <label class="hide-completed"> <input type="checkbox" checked="{{hideCompleted}}" /> Hide Completed Tasks </label> Adding a checkbox to hide completed tasks
  • 28. Tutorial – Sessions // simple-todos.js // Add to Template.body.events "change .hide-completed input": function (event { Session.set("hideCompleted", event.target.checked); } Adding event handler for checkbox
  • 29. Tutorial – Sessions // simple-todos.js // Replace the existing Template.body.helpers Template.body.helpers({ tasks: function () { if (Session.get("hideCompleted")) { // If hide completed is checked, filter tasks return Tasks.find( {checked: {$ne: true}}, {sort: {createdAt: -1}} ); } else { // Otherwise, return all of the tasks return Tasks.find({}, {sort: {createdAt: -1}}); } }, hideCompleted: function () { return Session.get("hideCompleted"); } }); Returning tasks expression with completed tasks filtered out if box is checked
  • 30. Tutorial – Count of Incomplete Tasks // simple-todos.js // Add to Template.body.helpers incompleteCount: function () { return Tasks.find({checked: {$ne: true}}).count(); } <!-- simple-todos.html --> <!-- display the count at the end of the <h1> tag --> <h1>Todo List ({{incompleteCount}})</h1>
  • 31. Tutorial – Adding User Accounts $ meteor add accounts-ui accounts-password <!-- simple-todos.html --> {{> loginButtons}} // simple-todos.js // At the bottom of the client code Accounts.ui.config({ passwordSignupFields: "USERNAME_ONLY" });
  • 32. Tutorial – Adding User Accounts // simple-todos.js Tasks.insert({ text: text, createdAt: new Date(), // current time owner: Meteor.userId(), // _id of logged in user username: Meteor.user().username // username of logged in user });
  • 33. Tutorial – Adding User Accounts // simple-todos.js {{#if currentUser}} <form class="new-task"> <input type="text" name="text" placeholder="Type to add new tasks" /> </form> {{/if}} <!-- simple-todos.html --> <span class="text"><strong>{{username}}</strong> - {{text}}</span>
  • 34. Tutorial – Adding User Accounts $ meteor add accounts-facebook $ meteor add accounts-twitter $ meteor add accounts-github $ meteor add accounts-google $ meteor add accounts-meetup
  • 35. Tutorial – Security $ meteor remove insecure Meteor automatically adds insecure package to new projects for getting started. Insecure allows editing of database from client. We don’t want this on a production app!
  • 36. Tutorial – Security Now our client side db operations (insert, update, and remove) don’t work! We need to replace these with a call to a Meteor Method. Meteor Methods run on both the client and server to immediately update the local copy of the db (mini- mongo) and speed up operation – latency compensation.
  • 37. Tutorial – Defining Methods // At the bottom of simple-todos.js, outside of the client-only block Meteor.methods({ addTask: function (text) { // Make sure the user is logged in before inserting a task if (! Meteor.userId()) { throw new Meteor.Error("not-authorized"); } Tasks.insert({ text: text, createdAt: new Date(), owner: Meteor.userId(), username: Meteor.user().username }); }, deleteTask: function (taskId) { Tasks.remove(taskId); }, setChecked: function (taskId, setChecked) { Tasks.update(taskId, { $set: { checked: setChecked} }); } });
  • 38. Tutorial – Defining Methods // replace Tasks.insert( ... ) with: Meteor.call("addTask", text); // replace Tasks.update( ... ) with: Meteor.call("setChecked", this._id, ! this.checked); // replace Tasks.remove( ... ) with: Meteor.call("deleteTask", this._id);
  • 39. Tutorial – Filtering Data Use Publications and Subscriptions to send the right data to the right templates instead of sending your whole db to the client! $ meteor remove autopublish
  • 40. Tutorial – Publications and Subscriptions // At the bottom of simple-todos.js if (Meteor.isServer) { Meteor.publish("tasks", function () { return Tasks.find(); }); } // At the top of our client code Meteor.subscribe("tasks");

Editor's Notes

  1. Inclusions, expressions, and block helpers