SlideShare a Scribd company logo
Build your Own Trello
within 200100 LOC
Andy Dai
andy@dorm7.com
1
Who am I?
• Staff@PyCon Taiwan
• co-author@iCoding.co
• 寫 Python 比較多...
2
Andy
Trello
3
Trello
• Project Management Tool
3
Trello
• Project Management Tool
• Real-time Web APP
3
Trello
• Project Management Tool
• Real-time Web APP
• 來看個 Demo 好了...
3
A Real-Time Web APP
• Backbone.js
• HTML5 pushstate
• Mustache template
• Socket.io and websocket
• Ajax Polling
• node.js
• MongoDB
Reference: http://blog.fogcreek.com/the-trello-tech-stack/
4
Trallo - clone of Trello
5
Trallo - clone of Trello
• Demo - http://bit.ly/trallo
5
Trallo - clone of Trello
• Demo - http://bit.ly/trallo
• 59 LOC for template + 96 LOC for js
5
HOW?
6
USE Meteor!
7
Meteor
• http://www.meteor.com
• 9292 stars in Github (most among JS
projects in 2012)
• Real-Time Web Framework
• 2011/12/01 First Preview
8
Seven Principles of
Meteor
9
Data on the Wire
10
One Language
11
Database Everywhere
12
Latency Compensation
13
Full Stack Reactivity
14
Embrace the Ecosystem
15
Simplicity Equals
Productivity
16
Get Start!
17
Install
$ curl install.meteor.com | sh
Create Project
$ meteor create trallo
18
Meteor Project
$ cd trallo
$ meteor
Run Meteor Project
19
Meteor Project
.meteor
trallo.css
trallo.html
trallo.js
Project Structure
$ cd trallo
$ meteor
Run Meteor Project
19
trallo.js
// The Code here will run in both client & Server
Cards = new Meteor.Collection("cards");
if (Meteor.is_client) {
...
}
if (Meteor.is_server) {
...
}
20
Template
21
Handlebars.js
<template name="todo">
{{#each todos }}
{{> card }}
{{/each }}
</template>
<template name="card">
<li id="{{ _id }}" class="card ui-state-default"
data-status="{{ status }}">
{{ task }} <a class="edit" href='#'>edit</a>
</li>
</template>
22
Template Helpers
if (Meteor.is_client) {
Template.todo.helpers({
todos: ...
});
...
}
<template name="todo">
{{#each todos }}
{{> card }}
{{/each }}
</template>
<template name="card">
<li id="{{ _id }}" class="card ui-state-default"
data-status="{{ status }}">
{{ task }} <a class="edit" href='#'>edit</a>
</li>
</template>
23
Data
24
Meteor Use MongoDB
as database
25
Client Side - miniMongo
Cards = new Meteor.Collection("cards");
if (Meteor.is_client) {
Template.todo.helpers({
todos: Cards.find(
{status:'todo'},
{sort: {position: 1, task: 1}}
)
});
}
if (Meteor.is_server) {
...
}
26
Server Side
Cards = new Meteor.Collection("cards");
if (Meteor.is_client) {
...
}
if (Meteor.is_server) {
if ( Cards.find().count() === 0) {
Cards.insert({
task: 'One',
status: 'todo',
position: 1
});
}
}
27
Event
28
Event Handler
if (Meteor.is_client) {
...
Template.board.events = {
"click .edit": function() {
...
}
}
...
}
29
Deploy
meteor deploy http://trallo.meteor.com
meteor bundle trallo.tar.gz
Deploy to Meteor.com
Deploy to your own server
30
DEMO
31
小結
32
• Meteor is GOOD!
• 目前版號 0.6.4.1, 所以...
工商服務
• iCoding.co 徵稿中
• COSCUP 有 Python.tw 攤位
• 歡迎來 Taipei.py 玩玩
33
Q&A
34
35
• Meteor 初體驗 http://bit.ly/17q7RaA http://
bit.ly/17q7U6n
• Discover Meteor
www.discovermeteor.com
Reference

More Related Content

PDF
Workshop 12: AngularJS Parte I
PDF
Angular.js is super cool
PPTX
Knockoutjs UG meeting presentation
PDF
From Node.js to Design Patterns
PDF
Muster in Webcontrollern
PDF
Game jump: frontend introduction #1
PPTX
The War is Over, and JavaScript has won: Living Under the JS Regime
PDF
Building decentralised apps with js - Devoxx Morocco 2018
Workshop 12: AngularJS Parte I
Angular.js is super cool
Knockoutjs UG meeting presentation
From Node.js to Design Patterns
Muster in Webcontrollern
Game jump: frontend introduction #1
The War is Over, and JavaScript has won: Living Under the JS Regime
Building decentralised apps with js - Devoxx Morocco 2018

What's hot (18)

KEY
You Can Kick-Ass Too, AtlasCamp US 2012
PDF
Pengenalan AngularJS
PDF
Introduction to Polymer
PDF
jQuery in 15 minutes
PPTX
Ext JS Introduction
PPTX
Présentation et bonnes pratiques du pattern MVVM - MIC Belgique
PPTX
MV* presentation frameworks in Javascript: en garde, pret, allez!
PPT
AngularJS and SPA
PPTX
Fluent Python - Chapter 15
PDF
Drupal node access system & AUL 7.x.-2.x
PPTX
Building an End-to-End AngularJS Application
PPTX
Modules and injector
PDF
Cloud.ca and CloudOps cs_auth
PDF
Open Selector
PPT
Backbone js
PDF
Javascript session june 2013 (iii) jquery json
PPTX
SenchaCon 2016: Want to Use Ext JS Components with Angular 2? Here’s How to I...
PDF
Devoxx 2014-webComponents
You Can Kick-Ass Too, AtlasCamp US 2012
Pengenalan AngularJS
Introduction to Polymer
jQuery in 15 minutes
Ext JS Introduction
Présentation et bonnes pratiques du pattern MVVM - MIC Belgique
MV* presentation frameworks in Javascript: en garde, pret, allez!
AngularJS and SPA
Fluent Python - Chapter 15
Drupal node access system & AUL 7.x.-2.x
Building an End-to-End AngularJS Application
Modules and injector
Cloud.ca and CloudOps cs_auth
Open Selector
Backbone js
Javascript session june 2013 (iii) jquery json
SenchaCon 2016: Want to Use Ext JS Components with Angular 2? Here’s How to I...
Devoxx 2014-webComponents
Ad

Viewers also liked (6)

PDF
HTML5 and friends - Institutional Web Management Workshop 2010
PPTX
Trello - University of St Andrews web team
PDF
Meteor - building an email client
PPTX
Firehose
PPT
MongoDB Schema Design
PPTX
MongoDB Schema Design: Four Real-World Examples
HTML5 and friends - Institutional Web Management Workshop 2010
Trello - University of St Andrews web team
Meteor - building an email client
Firehose
MongoDB Schema Design
MongoDB Schema Design: Four Real-World Examples
Ad

Similar to Build your own trello witihin 100 LOC (with Meteor) (20)

KEY
网站无障碍阅读知识
KEY
网站无障碍阅读知识
PDF
Node azure
KEY
#NewMeetup Performance
PDF
Migrating from Struts 1 to Struts 2
PPT
Backbone js-slides
PPTX
10 ways to make your code rock
PDF
Using Backbone.js with Drupal 7 and 8
PDF
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
PDF
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
PDF
Introduction to REST API with Node.js
PPTX
Meteor Day Talk
PDF
Reactive Type-safe WebComponents
PPTX
Get together on getting more out of typescript &amp; angular 2
PDF
PDF
JavaScript Refactoring
PPTX
HTML5 and Other Modern Browser Game Tech
PPTX
Angular JS deep dive
PDF
PDF
Introduccion a HTML5
网站无障碍阅读知识
网站无障碍阅读知识
Node azure
#NewMeetup Performance
Migrating from Struts 1 to Struts 2
Backbone js-slides
10 ways to make your code rock
Using Backbone.js with Drupal 7 and 8
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Introduction to REST API with Node.js
Meteor Day Talk
Reactive Type-safe WebComponents
Get together on getting more out of typescript &amp; angular 2
JavaScript Refactoring
HTML5 and Other Modern Browser Game Tech
Angular JS deep dive
Introduccion a HTML5

More from Andy Dai (17)

PDF
Grpc + python.key
PDF
該怎麼樣(認真的)部署你的 Python Web 應用程式?
PDF
Power UP your CLI
PDF
Search search search
PDF
Django channels
PDF
Django Third party packages
PDF
Practical django secuirty
PDF
總之來講講 Search
PDF
Python web meetup 11 18
PDF
Django in heavy load environment
PDF
電腦不只會幫你選土豆,還會幫你選新聞
PDF
用 Python 打造你自己的 summly
PDF
Tradeoffs of replacing core components
PDF
ElastiCache
PDF
Dynamo db
PDF
Django deploy
PDF
Boost your django admin with Grappelli
Grpc + python.key
該怎麼樣(認真的)部署你的 Python Web 應用程式?
Power UP your CLI
Search search search
Django channels
Django Third party packages
Practical django secuirty
總之來講講 Search
Python web meetup 11 18
Django in heavy load environment
電腦不只會幫你選土豆,還會幫你選新聞
用 Python 打造你自己的 summly
Tradeoffs of replacing core components
ElastiCache
Dynamo db
Django deploy
Boost your django admin with Grappelli

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Empathic Computing: Creating Shared Understanding
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPT
Teaching material agriculture food technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Approach and Philosophy of On baking technology
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Cloud computing and distributed systems.
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Machine learning based COVID-19 study performance prediction
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Dropbox Q2 2025 Financial Results & Investor Presentation
Empathic Computing: Creating Shared Understanding
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Teaching material agriculture food technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
The Rise and Fall of 3GPP – Time for a Sabbatical?
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Understanding_Digital_Forensics_Presentation.pptx
Approach and Philosophy of On baking technology
sap open course for s4hana steps from ECC to s4
Cloud computing and distributed systems.
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Machine learning based COVID-19 study performance prediction
Encapsulation_ Review paper, used for researhc scholars
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Unlocking AI with Model Context Protocol (MCP)
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

Build your own trello witihin 100 LOC (with Meteor)