JSON all the way
-
Upload
ronan-berder -
Category
Technology
-
view
777 -
download
1
Transcript of JSON all the way
![Page 1: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/1.jpg)
JSON all the wayJavascript in the humanitarian world
![Page 2: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/2.jpg)
Who the hell..?我们是谁
Ronan Berder小熊
Makara Wang王浩宇
Wiredcrafthttp://wiredcraft.com
![Page 3: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/3.jpg)
And what do you do?我们做什么
• Data centric apps
• Humanitarian and non-profit space
• In Shanghai and Washington, DC(and soon SF)
![Page 4: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/4.jpg)
Before we get started引言
![Page 5: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/5.jpg)
What’s Reliefweb?Reliefweb是什么
• Re-launched in 2011
• News for the humanitarian world
• Built on Drupal... I know(PHP + MySQL + Sphinx)
![Page 7: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/7.jpg)
What then?客户需求
• Need to innovate
• Built a prototype and pitched it:
User profiles + Mobile
![Page 8: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/8.jpg)
The breakup失败
![Page 9: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/9.jpg)
What happened?为什么
• Fighting the framework
• Performance concerns
• Way too many layers
![Page 10: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/10.jpg)
![Page 11: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/11.jpg)
Back to the whiteboard更高要求
• We need consistency
• We need simplicity
• We need flexibility
• We need speed
And about a million other things...
![Page 12: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/12.jpg)
So, what do we build?目标
![Page 14: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/14.jpg)
Who will save us?救星来了
![Page 15: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/15.jpg)
Why JS?
• Great for a RESTful API
• Great too for a light client
• Other perks; performance, tools...
And... we already know it.
![Page 16: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/16.jpg)
The back-end服务端
![Page 17: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/17.jpg)
Bones for the API什么是 � Bones
• RESTful JSON + OAuth
• Bones = express.js + backbone.jshttps://github.com/developmentseed/bones
• Share models on client and server
![Page 18: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/18.jpg)
Show me the code
</>
![Page 19: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/19.jpg)
And then some more...更多规范
• JSON Schema
• OAuth
• REST
![Page 20: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/20.jpg)
The front-end客户端
![Page 21: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/21.jpg)
Using what we know最流行的
• HTML5 + jQuery mobile + Backbone.js
• Phonegap
• and... Jekyll
![Page 22: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/22.jpg)
Why Jekyll?
• HTML5 apps can get messy
• Jekyll gives us templates & includesAnd we’ll be able to host it on Github pages...
![Page 23: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/23.jpg)
Show me the code
</>
![Page 24: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/24.jpg)
A tiny bit about storage存储方案
![Page 25: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/25.jpg)
Elastic search
• Started with CouchDB
• Now Elastic Search & Redis, because:
• Full text search,
• Document oriented,
• REST API,
Slower, but we don’t care.
![Page 26: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/26.jpg)
Show me the code
</>
![Page 27: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/27.jpg)
A few thoughts少少结论
![Page 28: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/28.jpg)
Why so serious?不好的
• Not a lot of best practicesbut we’re trying hard to build some
• Some stuff still sucksjQuery mobile, I’m looking at you
![Page 29: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/29.jpg)
The good stuff好的
• JSON all the way
• Javascript all the way
And performance, tools, community...
![Page 30: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/30.jpg)
![Page 31: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/31.jpg)
What we see我们看到的未来
• The line is getting blurry:
• more fragmentation...
• but more communication
• Loosely coupled systems
![Page 32: JSON all the way](https://reader034.fdocuments.us/reader034/viewer/2022052622/5591bafc1a28abe3088b46e6/html5/thumbnails/32.jpg)
Questions?有问题吗?