Skip to content
Lance Pollard edited this page Sep 25, 2012 · 3 revisions

Examples

No examples yet really. Coming soon.

Todos

tower new todo --single-page
tower page todo
doctype 5
html ->
  head ->
    stylus """
    
    html, body
      margin: 0
      
    #todos
    """
    
    # http://addyosmani.github.com/todomvc
    script src: "https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"
    script src: "http://towerjs.org/javascripts/underscore.js"
    script src: "http://towerjs.org/javascripts/coffeekup.js"
    script src: "http://towerjs.org/javascripts/tower.js"
  
  body ->
    coffeescript ->
      class window.App extends Tower.Application
      
      class App.Todo extends Tower.Model
        @field "id", type: "Id"
        @field "name"
        @field "done", type: "Boolean"
  
        @scope "active", @where(done: false)
        @scope "done", @where(done: true)
      
      class App.TodosController extends Tower.Controller
        @on "submit form", "create"
        @on "change", "toggle"
        @on "click .destroy", "destroy"
        
        index: ->
          App.Todo.where(@criteria()).all (error, todos) =>
            @render "index"
        
        toggle: ->
          @todo.set "done", !@todo.get("done")
          @todo.save()
      
      App.views    
        "todos/_form": ->
        "todos/_item": ->
          li class: "todo", ->
            input type: "checkbox"
            span todo.get("name")
            a class: "destroy"
        "todos/index": ->
        "todos/new": ->
        "todos/edit": ->
      
      App.routes ->
        @resources "todos", pathName: ""
    
      App.run()

GeekList / CoderWall / WorkingWithRails

You can chat with other node.js hackers too, and send code samples back and forth

tower new node-hacker
cd node-hacker
npm install
tower generate scaffold user firstName lastName email website twitter github
tower generate scaffold company website twitter email description:text founded:date
node server

Tower-Login-Demo

Tower-Blog-Demo

Cached Commons

tower new cached-commons --namespace CC

InspiredBy

  • site where you can submit awesome sites
  • background processing

Events (Attend)

  • site like eventbrite
  • geo location
  • maps
  • subscription billing
  • mongodb (should be able to swap out with couchdb)
  • passport

Deals

  • geo location
  • subscription billing
  • mongodb
  • phonegap
  • passport

ECommerce

Something like google groups

Todos

On top of Rails

Sites in the Wild

Neo4j Example

Simple node-relationship interface with 3 inputs at the bottom and a d3.js graph at the top:

[subject]-[action]-[object] Newton mastered physics

Or maybe just try to tell a story:

John meets Stacy Stacy spills water

Or maybe you login to github and it shows your commits and forks to other projects

Or maybe like mrdoob's visualization of commits over time to specific files in threejs

Find all repos where a user follows a user who forked another repo, that might be a better example. Start with GitHub users with over 1000 followers or 100 repos, then add people as they come. Then grab all the users repos, contributions, forks, and follows

Find commits made by user who made more than 2 commits

nevermind... http://code.google.com/p/gource/

Or, enter in relationship taxonomy (building an ontology of relationships)

Clone this wiki locally