Quiver.js


A New Paradigm for

Web Development


http://quiverjs.org

Soares Chen
soares.chen@gmail.com

Why Quiver?


  • Framework sux
  • Unix Philosophy rocks
  • REST rocks

  • Unix Philosophy + REST + JS + ... = Quiver
    • Server-side component system
    • New programming paradigm
      • Microservice?

Handler Component

  • Accepts key-value args and input stream
  • Returns output as result stream

Hello Handler


var helloHandler = function(args, callback) {
  callback(null, 'Hello World!')
}

exports.quiverComponents = [
  {
    name: 'demo hello handler',
    type: 'simple handler',
    inputType: 'void',
    outputType: 'text',
    handler: helloHandler
  }
]

Static File Server

  • Simple file server serving cat pictures


$ quiver-server . --config ./config.js --main \    'quiver file directory handler'

Image Convert



Command Handler

  • ImageMagick convert command

 $ convert in.jpg -resize 200 out.jpg

Convert Component


{
  name: 'demo resize image handler',
  type: 'stream handler',
  configOverride: {
    commandArgsExtractor: imageResizeCommandArgsExtractor,
  },
  resultContentType: 'image/jpeg',
  handler: 'quiver file convert command handler'
}

Pipeline Component


{
  name: 'demo image thumbnail handler',
  type: 'stream pipeline',
  pipeline: [
    'quiver file directory handler',
    'demo resize image handler'
  ]
}

$ quiver-server . --config ./config.js --main \
'demo image thumbnail handler'

Cache Filter


Final Thumbnail Component


{
  name: 'demo image thumbnail handler',
  type: 'stream pipeline',
  middlewares: [
    'quiver memory cache filter'
  ],
  pipeline: [
    'quiver file directory handler',
    'demo resize image handler'
  ]
}

One Pattern,

Unlimited Combination


  • File + Image Resize + Memory Cache
  • S3 + Audio Encode + Disk Cache
  • Git + Compilation + CDN Cache
  • Remote API + Template + Permission




Full Demo Preview



Individual Quiver Components 

can be used in any way

Resize Command



$ quiver-command . --main 'demo resize image handler' \     < static/images/blue-hat.jpg > temp/out.jpg

Resize Server


 $ quiver-server . --main 'demo resize image handler'

$ curl http://localhost:8080 -X POST \    --data-binary @static/images/blue-hat.jpg > temp/out.jpg


Proxy Pipeline



Development Status


  • Open source at GitHub
    • https://github.com/quiverjs
  • Still in early stage development
  • Ready for production
    • ScoreCloud - http://scorecloud.com
  • Lack of documentation
  • Contribution is welcomed


Q&A

Thank You

http://quiverjs.org

Soares Chen
soares.chen@gmail.com
Made with Slides.com