SlideShare a Scribd company logo
1 of 12
Download to read offline
TodoAppwith Meteor
» Long Nguyen
» @vangnol
Whatis Meteor?
Meteor is a framework for building incredible web
application. Meteor helps you build complex web
application but in minimal amount of time. It's full-
stack framework. On the server it runs on Nodejs,
which means Meteor written in Javascript. Meteor has
out of the box integration with MongoDB database.
Meteor uses DDP Protocal to communicate between
client and server.
Setup
» MacOS or Ubuntu
curl https://install.meteor.com/ | sh
» Windows
Go get a Mac or a Ubuntu laptop
Demo
Simple Todo App with Meteor
♡♡♡
task.html
<head>
<title>Simple Todo App</title>
</head>
<body>
<h1>Awesome Todo App</h1>
<hr/>
<div class="container">
{{> CreateTask}}
{{> ListTasks}}
{{> CompleteCounter}}
</div>
</body>
<template name="ListTasks">
<ul>
{{#each tasks}}
<li class="task {{doneClass}}">{{> Task}}</li>
{{/each}}
</ul>
</template>
<template name="Task">
<input type="checkbox" name="is_done" {{isDoneChecked}} />
{{subject}}
</template>
<template name="CreateTask">
<form class="create-task" >
<input type="text" placeholder="Creating new task...!" />
</form>
</template>
<template name="CompleteCounter">
<h3>{{completeTask}} / {{totalTasks}} tasks completed</h3>
</template>
task.css
.task{
font-size: 20px;
background-color: #EBEBEB;
padding: 10px;
margin-bottom: 2px;
}
.done{
text-decoration: line-through;
}
task.js
Todos = new Meteor.Collection('todos');
if(Meteor.isClient){
Template.ListTasks.helpers({
tasks: function(){
return Todos.find();
},
doneClass: function(){
return this.is_done ? 'done' : '';
}
});
Template.Task.helpers({
isDoneChecked: function(){
return this.is_done ? 'checked' : ''
}
});
Template.Task.events({
"click [name=is_done]": function(e, tmpl){
var id = this._id;
var isDone = tmpl.find('input').checked;
Todos.update({_id: id}, {$set: { is_done: isDone}});
}
});
Template.CreateTask.events({
'submit form': function(e, tmpl){
e.preventDefault();
var subject = tmpl.find('input').value;
Todos.insert({subject: subject, created_at: new Date, is_done: false});
var form = tmpl.find('form');
form.reset();
}
});
}
Template.CompleteCounter.helpers({
completeTask: function(){
return Todos.find({is_done: true}).count();
},
totalTasks: function(){
return Todos.find({}).count();
}
});
}
if(Meteor.isServer){
}
References
» MeteorHacks
» Best Learning Resources
» Meteor Packages
» Why Meteor will kill Ruby on Rails
» Meteor Won’t Kill Rails Anytime Soon
» How to Learn JavaScript Properly
Thankyou!

More Related Content

What's hot

What's hot (20)

Robust web apps with React.js
Robust web apps with React.jsRobust web apps with React.js
Robust web apps with React.js
 
Getting started with node JS
Getting started with node JSGetting started with node JS
Getting started with node JS
 
Meteor Day Athens (2014-11-07)
Meteor Day Athens (2014-11-07)Meteor Day Athens (2014-11-07)
Meteor Day Athens (2014-11-07)
 
Gatling
GatlingGatling
Gatling
 
Qtp Tutorial 4 Recording Of Tests In Qtp With Drag And Drop Web Elements
Qtp Tutorial 4   Recording Of Tests In Qtp With Drag And Drop Web ElementsQtp Tutorial 4   Recording Of Tests In Qtp With Drag And Drop Web Elements
Qtp Tutorial 4 Recording Of Tests In Qtp With Drag And Drop Web Elements
 
IBM and Node.js - Old Doge, New Tricks
IBM and Node.js - Old Doge, New TricksIBM and Node.js - Old Doge, New Tricks
IBM and Node.js - Old Doge, New Tricks
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
 
Web Development with NodeJS
Web Development with NodeJSWeb Development with NodeJS
Web Development with NodeJS
 
React JS - Introduction
React JS - IntroductionReact JS - Introduction
React JS - Introduction
 
007. Redux middlewares
007. Redux middlewares007. Redux middlewares
007. Redux middlewares
 
HTML5
HTML5HTML5
HTML5
 
JavaScript innovaties: ECMAScript 6 & 7
JavaScript innovaties: ECMAScript 6 & 7JavaScript innovaties: ECMAScript 6 & 7
JavaScript innovaties: ECMAScript 6 & 7
 
Brad wood - Integrating MVC Into Legacy [Into The Box 2020]
Brad wood - Integrating MVC Into Legacy [Into The Box 2020]Brad wood - Integrating MVC Into Legacy [Into The Box 2020]
Brad wood - Integrating MVC Into Legacy [Into The Box 2020]
 
Building time machine with .net core
Building time machine with .net core Building time machine with .net core
Building time machine with .net core
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
 
React, Flux and more (p1)
React, Flux and more (p1)React, Flux and more (p1)
React, Flux and more (p1)
 
Enterprise level application in 5 min
Enterprise level application in 5 minEnterprise level application in 5 min
Enterprise level application in 5 min
 
Wicket Live on Stage
Wicket Live on StageWicket Live on Stage
Wicket Live on Stage
 
JavaScript Roadmap - DOM Manipulation
JavaScript Roadmap - DOM ManipulationJavaScript Roadmap - DOM Manipulation
JavaScript Roadmap - DOM Manipulation
 

Viewers also liked

Myriam al dhaheri 201017821 - wunderlist – helps you manage your daily list...
Myriam al dhaheri   201017821 - wunderlist – helps you manage your daily list...Myriam al dhaheri   201017821 - wunderlist – helps you manage your daily list...
Myriam al dhaheri 201017821 - wunderlist – helps you manage your daily list...
Myriam Al Dhaheri
 
Empower Customer Engagement with Mobile Context
Empower Customer Engagement with Mobile ContextEmpower Customer Engagement with Mobile Context
Empower Customer Engagement with Mobile Context
Mobile Marketing Association
 

Viewers also liked (20)

AWS Summit Berlin 2013 - Keynote - 6wunderkinder
AWS Summit Berlin 2013 - Keynote - 6wunderkinderAWS Summit Berlin 2013 - Keynote - 6wunderkinder
AWS Summit Berlin 2013 - Keynote - 6wunderkinder
 
Nano Goals App
Nano Goals AppNano Goals App
Nano Goals App
 
Bibstrip Wunderlist - lijstjes maken
Bibstrip Wunderlist - lijstjes makenBibstrip Wunderlist - lijstjes maken
Bibstrip Wunderlist - lijstjes maken
 
Project
ProjectProject
Project
 
Engineering Wunderlist for Android - Ceasr Valiente, 6Wunderkinder
Engineering Wunderlist for Android - Ceasr Valiente, 6WunderkinderEngineering Wunderlist for Android - Ceasr Valiente, 6Wunderkinder
Engineering Wunderlist for Android - Ceasr Valiente, 6Wunderkinder
 
Myriam al dhaheri 201017821 - wunderlist – helps you manage your daily list...
Myriam al dhaheri   201017821 - wunderlist – helps you manage your daily list...Myriam al dhaheri   201017821 - wunderlist – helps you manage your daily list...
Myriam al dhaheri 201017821 - wunderlist – helps you manage your daily list...
 
To Do List Karma - Life style gamification - Manu Melwin Joy
To Do List Karma - Life style gamification - Manu Melwin JoyTo Do List Karma - Life style gamification - Manu Melwin Joy
To Do List Karma - Life style gamification - Manu Melwin Joy
 
Todoist iPhone App - Onboarding Roast
Todoist iPhone App - Onboarding RoastTodoist iPhone App - Onboarding Roast
Todoist iPhone App - Onboarding Roast
 
Todoist Logo Design Process
Todoist Logo Design ProcessTodoist Logo Design Process
Todoist Logo Design Process
 
9 Daily Habits of Entrepreneurs.
9 Daily Habits of Entrepreneurs.9 Daily Habits of Entrepreneurs.
9 Daily Habits of Entrepreneurs.
 
How To Grow Your SMS Marketing Database
How To Grow Your SMS Marketing DatabaseHow To Grow Your SMS Marketing Database
How To Grow Your SMS Marketing Database
 
Empower Customer Engagement with Mobile Context
Empower Customer Engagement with Mobile ContextEmpower Customer Engagement with Mobile Context
Empower Customer Engagement with Mobile Context
 
Mobile Means Business
Mobile Means BusinessMobile Means Business
Mobile Means Business
 
The Mobile Content Mandate
The Mobile Content MandateThe Mobile Content Mandate
The Mobile Content Mandate
 
The Do's and Dont's of Stellar Push and In-App Messaging: September 2014 Webinar
The Do's and Dont's of Stellar Push and In-App Messaging: September 2014 WebinarThe Do's and Dont's of Stellar Push and In-App Messaging: September 2014 Webinar
The Do's and Dont's of Stellar Push and In-App Messaging: September 2014 Webinar
 
Create and Convert Mobile Moments of Truth
Create and Convert Mobile Moments of TruthCreate and Convert Mobile Moments of Truth
Create and Convert Mobile Moments of Truth
 
Social Action Mobile Marketing
Social Action Mobile MarketingSocial Action Mobile Marketing
Social Action Mobile Marketing
 
Mobile Metrics 101: Everything web marketers need to know about app analytics
Mobile Metrics 101: Everything web marketers need to know about app analyticsMobile Metrics 101: Everything web marketers need to know about app analytics
Mobile Metrics 101: Everything web marketers need to know about app analytics
 
Computers
ComputersComputers
Computers
 
Selling The Mobile Web
Selling The Mobile WebSelling The Mobile Web
Selling The Mobile Web
 

Similar to Simple todo app with meteor

Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar TechnologiesRob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
george.james
 
Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN Stack
Rob Davarnia
 
Ta Javaserverside Eran Toch
Ta Javaserverside Eran TochTa Javaserverside Eran Toch
Ta Javaserverside Eran Toch
Adil Jafri
 
Java Script - A New Look
Java Script - A New LookJava Script - A New Look
Java Script - A New Look
rumsan
 

Similar to Simple todo app with meteor (20)

code-camp-meteor
code-camp-meteorcode-camp-meteor
code-camp-meteor
 
METEOR 101
METEOR 101METEOR 101
METEOR 101
 
Meteor.js Workshop by Dopravo
Meteor.js Workshop by DopravoMeteor.js Workshop by Dopravo
Meteor.js Workshop by Dopravo
 
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar TechnologiesRob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
 
Frontend microservices: architectures and solutions
Frontend microservices: architectures and solutionsFrontend microservices: architectures and solutions
Frontend microservices: architectures and solutions
 
Javascript MVVM with Vue.JS
Javascript MVVM with Vue.JSJavascript MVVM with Vue.JS
Javascript MVVM with Vue.JS
 
Meteor Day Talk
Meteor Day TalkMeteor Day Talk
Meteor Day Talk
 
Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN Stack
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
 
State of modern web technologies: an introduction
State of modern web technologies: an introductionState of modern web technologies: an introduction
State of modern web technologies: an introduction
 
Ta Javaserverside Eran Toch
Ta Javaserverside Eran TochTa Javaserverside Eran Toch
Ta Javaserverside Eran Toch
 
Test Automation for NoSQL Databases
Test Automation for NoSQL DatabasesTest Automation for NoSQL Databases
Test Automation for NoSQL Databases
 
Rest web service_with_spring_hateoas
Rest web service_with_spring_hateoasRest web service_with_spring_hateoas
Rest web service_with_spring_hateoas
 
Node JS Express: Steps to Create Restful Web App
Node JS Express: Steps to Create Restful Web AppNode JS Express: Steps to Create Restful Web App
Node JS Express: Steps to Create Restful Web App
 
AngularJS for Web and Mobile
 AngularJS for Web and Mobile AngularJS for Web and Mobile
AngularJS for Web and Mobile
 
CraftCamp for Students - Introduction to Meteor.js
CraftCamp for Students - Introduction to Meteor.jsCraftCamp for Students - Introduction to Meteor.js
CraftCamp for Students - Introduction to Meteor.js
 
Java Script - A New Look
Java Script - A New LookJava Script - A New Look
Java Script - A New Look
 
How to Build ToDo App with Vue 3 + TypeScript
How to Build ToDo App with Vue 3 + TypeScriptHow to Build ToDo App with Vue 3 + TypeScript
How to Build ToDo App with Vue 3 + TypeScript
 
Practical OData
Practical ODataPractical OData
Practical OData
 
Magento Performance Optimization 101
Magento Performance Optimization 101Magento Performance Optimization 101
Magento Performance Optimization 101
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Simple todo app with meteor

  • 1. TodoAppwith Meteor » Long Nguyen » @vangnol
  • 2. Whatis Meteor? Meteor is a framework for building incredible web application. Meteor helps you build complex web application but in minimal amount of time. It's full- stack framework. On the server it runs on Nodejs, which means Meteor written in Javascript. Meteor has out of the box integration with MongoDB database. Meteor uses DDP Protocal to communicate between client and server.
  • 3. Setup » MacOS or Ubuntu curl https://install.meteor.com/ | sh » Windows Go get a Mac or a Ubuntu laptop
  • 4. Demo Simple Todo App with Meteor ♡♡♡
  • 5. task.html <head> <title>Simple Todo App</title> </head> <body> <h1>Awesome Todo App</h1> <hr/> <div class="container"> {{> CreateTask}} {{> ListTasks}} {{> CompleteCounter}} </div> </body> <template name="ListTasks"> <ul> {{#each tasks}} <li class="task {{doneClass}}">{{> Task}}</li> {{/each}} </ul> </template>
  • 6. <template name="Task"> <input type="checkbox" name="is_done" {{isDoneChecked}} /> {{subject}} </template> <template name="CreateTask"> <form class="create-task" > <input type="text" placeholder="Creating new task...!" /> </form> </template> <template name="CompleteCounter"> <h3>{{completeTask}} / {{totalTasks}} tasks completed</h3> </template>
  • 7. task.css .task{ font-size: 20px; background-color: #EBEBEB; padding: 10px; margin-bottom: 2px; } .done{ text-decoration: line-through; }
  • 8. task.js Todos = new Meteor.Collection('todos'); if(Meteor.isClient){ Template.ListTasks.helpers({ tasks: function(){ return Todos.find(); }, doneClass: function(){ return this.is_done ? 'done' : ''; } }); Template.Task.helpers({ isDoneChecked: function(){ return this.is_done ? 'checked' : '' } });
  • 9. Template.Task.events({ "click [name=is_done]": function(e, tmpl){ var id = this._id; var isDone = tmpl.find('input').checked; Todos.update({_id: id}, {$set: { is_done: isDone}}); } }); Template.CreateTask.events({ 'submit form': function(e, tmpl){ e.preventDefault(); var subject = tmpl.find('input').value; Todos.insert({subject: subject, created_at: new Date, is_done: false}); var form = tmpl.find('form'); form.reset(); } }); }
  • 10. Template.CompleteCounter.helpers({ completeTask: function(){ return Todos.find({is_done: true}).count(); }, totalTasks: function(){ return Todos.find({}).count(); } }); } if(Meteor.isServer){ }
  • 11. References » MeteorHacks » Best Learning Resources » Meteor Packages » Why Meteor will kill Ruby on Rails » Meteor Won’t Kill Rails Anytime Soon » How to Learn JavaScript Properly