Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ArangoDB Foxx at Munich.js

Lucas Dohmen
September 05, 2013

ArangoDB Foxx at Munich.js

These are the slides from my talk at Munich.js last night. If you have any questions, please feel free to ping me on Twitter (@moonbeamlabs) or via email ([email protected])

Lucas Dohmen

September 05, 2013
Tweet

More Decks by Lucas Dohmen

Other Decks in Programming

Transcript

  1. RWTH Aachen, Computer Science Student on branch master triAGENS GmbH,

    Developer moon lum moonbeamlabs by Lucas Dohmen Create APIs on your database Aran oDB Foxx
  2. The Idea • What if we could talk to the

    database directly? • It would only need an API • What if we could define this API in JavaScript?
  3. Who is that uy? • Aran oDB Core Team •

    Aran oDB Foxx & Ruby Adapter • Student on the master branch • hacken.in & nerdkun.de
  4. Who is that uy? • Aran oDB Core Team •

    Aran oDB Foxx & Ruby Adapter • Student on the master branch • hacken.in & nerdkun.de /\ (~( ) ) /\_/\ ( _-----_(@ @) ( \ / /|/--\|\ V " " " "
  5. What is ? • Free and Open Source… • …

    Document and Graph Store… • … with embedded JavaScript… • … and an amazin query lan ua e More about Aran oDB at Ruby UG Munich next week
  6. • …a feature of Aran oDB 1.4 (currently in alpha,

    release: End of September) • …an easy way to define REST APIs on top of Aran oDB • … a toolset for developin your sin le pa e web application • … not requirin any special code on the client side – use it with Backbone, Ember, An ular… Foxx is…
  7. Why another solution? • Aran oDB Foxx is streamlined for

    API creation – not a Jack of all trades • There‘s no communication overhead between (serverside) application and database • It is desi ned for front end developers: Use JavaScript, you already know that
  8. Parameterize the routes • You may want a route like

    `users/:id`… • …and then access the value of `id` easily
  9. • In your Foxx.Controller you describe your routes • But

    your application can consist of multiple Foxx.Controllers • … and you also want to deliver assets and files Manifest.json
  10. { "name": "my_website", "version": "1.2.1", "description": "My Website with a

    blog and a shop", "thumbnail": "images/website-logo.png", "controllers": { "/blog": "apps/blog.js", "/shop": "apps/shop.js" }, "assets": { "application.js": { "files": [ "vendor/jquery.js", "assets/javascripts/*" ] } } }
  11. More • Define a setup and teardown function to create

    and delete collections • Define lib to set a base path for your require statements • Define files to deliver binary data unaltered
  12. controller.get("/users/:name", function(req, res) { res.json({ hello: req.params("name"); }); }) .pathParam("name",

    { description: "Name of the User", dataType: "string" }); /** What's my name? * * This route knows it. */
  13. Models & Repositories • Foxx also helps you structure the

    M part of MVC • We don‘t have time for that today • But you can see a demonstration in our demo app • … or come to me later ;)
  14. Foxx Apps Repo • Look at demo applications • Install

    components from a central repository • Share your ideas
  15. A Glance into the Future • Confi ure filters for

    your assets: • U lifyJS2 • Later: Co ee, Sass, Client Templates… • Confi urable Lo in • Yo Generator
  16. Thanks • Database icon desi ned by Romeo Barreto from

    The Noun Project • Browser icon desi ned by Fernando Vasconcelos from The Noun Project • Lo os from Node.js, Ruby on Rails, Djan o and Symfony from the respective projects • All other icons are from Font Awesome