Sammy.js
NOSQL, NO PROBLEM
NoSQL Meetup NYC 10/05/09
Sammy.js
Sammy is a simple
Javascript framework
built on top of jQuery.
Sammy.js
RESTFUL EVENTED
JAVASCRIPT
Sammy.js
var app = $.sammy(function(app) {
this.use(Sammy.Template);
var db = loadDatabase();
this.get('#/', function(cont...
Database (SQL)
Application
(Ruby, PHP, Python, etc)
Javascript Framework
(jQuery)
Your $(hit)
Frontend
Backend
Ye Olde App...
Database
(NoSQL)
DOM Framework
(jQuery)
Your $(hit)
Frontend
Backend
The NOW
JS Router/Controller
(Sammy)
Sammy.js
Sammy is a
restful database’s
best friend
Sammy.js
#/ JSON
NoSQLJSONHTML/JS
Sammy.js
var app = $.sammy(function(app) {
this.use(Sammy.Template);
var db = loadDatabase();
this.get('#/', function(cont...
Sammy.js
‣ TINY
‣ TESTED
‣ WELL DOCUMENTED
‣ SIMPLE API
‣ EXTENSIBLE
Sammy.js
http://code.quirkey.com/sammy
@sammy_js
#sammy
Upcoming SlideShare
Loading in...5
×

Sammy.js: NoSQL, No Problem

5,313

Published on

Quick intro to Sammy + NoSQL

Published in: Technology, Education
1 Comment
8 Likes
Statistics
Notes
  • Very interesting looking -- reminds of me of Nitrogen (erl) and Sinatra (rb) but in js. Could work real well with CouchDB, but CouchApp is another framework that implements a minimal CouchDB JS web app framework; it's just not signal routing the way frameworks like these are. Makes me a bit more partial to this and eager to play around with it.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
5,313
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
74
Comments
1
Likes
8
Embeds 0
No embeds

No notes for slide

Sammy.js: NoSQL, No Problem

  1. 1. Sammy.js NOSQL, NO PROBLEM NoSQL Meetup NYC 10/05/09
  2. 2. Sammy.js Sammy is a simple Javascript framework built on top of jQuery.
  3. 3. Sammy.js RESTFUL EVENTED JAVASCRIPT
  4. 4. Sammy.js var app = $.sammy(function(app) { this.use(Sammy.Template); var db = loadDatabase(); this.get('#/', function(context) { this.pages = db.allDocs(function(docs) { context.docs = docs; context.partial('index.template'); }); }); this.get('#/page/:id', function(context) { this.page = db.getDoc(this.params.id, function(doc) { context.doc = doc; doc.partial('page.template'); }); }); this.post('#/page/:id', function(context) { db.saveDoc(this.params.id, this.params, function(doc) { context.doc = doc; context.partial('page.template'); }); }); });
  5. 5. Database (SQL) Application (Ruby, PHP, Python, etc) Javascript Framework (jQuery) Your $(hit) Frontend Backend Ye Olde Application Architecture
  6. 6. Database (NoSQL) DOM Framework (jQuery) Your $(hit) Frontend Backend The NOW JS Router/Controller (Sammy)
  7. 7. Sammy.js Sammy is a restful database’s best friend
  8. 8. Sammy.js #/ JSON NoSQLJSONHTML/JS
  9. 9. Sammy.js var app = $.sammy(function(app) { this.use(Sammy.Template); var db = loadDatabase(); this.get('#/', function(context) { this.pages = db.allDocs(function(docs) { context.docs = docs; context.partial('index.template'); }); }); this.get('#/page/:id', function(context) { this.page = db.getDoc(this.params.id, function(doc) { context.doc = doc; doc.partial('page.template'); }); }); this.post('#/page/:id', function(context) { db.saveDoc(this.params.id, this.params, function(doc) { context.doc = doc; context.redirect('#', 'page', doc.id); }); }); });
  10. 10. Sammy.js ‣ TINY ‣ TESTED ‣ WELL DOCUMENTED ‣ SIMPLE API ‣ EXTENSIBLE
  11. 11. Sammy.js http://code.quirkey.com/sammy @sammy_js #sammy
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×