FOXX - a Javascript application framework on top of ArangoDB

33.893 Aufrufe

Veröffentlicht am

Foxx allows you to build APIs directly on top of the database ArangoDB in Javascript and therefore skip the middleman (Rails, Django, Symfony or whatever your favorite web framework is). Foxx is designed with simplicity and the specific use case of modern client-side MVC frameworks in mind.

Veröffentlicht in: Technologie, Bildung
0 Kommentare
22 Gefällt mir
Statistik
Notizen
  • Als Erste(r) kommentieren

Keine Downloads
Aufrufe
Aufrufe insgesamt
33.893
Auf SlideShare
0
Aus Einbettungen
0
Anzahl an Einbettungen
21.793
Aktionen
Geteilt
0
Downloads
64
Kommentare
0
Gefällt mir
22
Einbettungen 0
Keine Einbettungen

Keine Notizen für die Folie

FOXX - a Javascript application framework on top of ArangoDB

  1. 1. RWTH Aachen, Computer Science Student on branch master triAGENS GmbH, Developer moonglum moonbeamlabs by Lucas Dohmen Create APIs on your database ArangoDB Foxx
  2. 2. Single Page Web Applications
  3. 3. 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?
  4. 4. Single Page Web Applications
  5. 5. Single Page Web Applications This doesn‘t mean its a Rails/… Killer
  6. 6. Client Server DB
  7. 7. Client Server DB with Foxx
  8. 8. Who is that guy? • ArangoDB Core Team • ArangoDB Foxx & Ruby Adapter • Student on the master branch • hacken.in & nerdkun.de
  9. 9. Who is that guy? • ArangoDB Core Team • ArangoDB Foxx & Ruby Adapter • Student on the master branch • hacken.in & nerdkun.de / (~( ) ) /_/ ( _-----_(@ @) ( / /|/--| V " " " "
  10. 10. What is ? • Free and Open Source… • … Document and Graph Store… • … with embedded JavaScript… • … and an amazing query language More about ArangoDB at Ruby UG Munich next week
  11. 11. / (~( ) ) /_/ ( _-----_(@ @) ( / /|/--| V " " " "
  12. 12. • …a feature of ArangoDB 1.4 (currently in alpha, release: End of September) • …an easy way to define REST APIs on top of ArangoDB • … a toolset for developing your single page web application • … not requiring any special code on the client side – use it with Backbone, Ember, Angular… Foxx is…
  13. 13. Why another solution? • ArangoDB Foxx is streamlined for API creation – not a Jack of all trades • There‘s no communication overhead between (serverside) application and database • It is designed for front end developers: Use JavaScript, you already know that
  14. 14. Foxx.Controller
  15. 15. Foxx = require("org/arangodb/foxx"); controller = new Foxx.Controller(appContext); controller.get("/users", function(req, res) { res.json({ hello: "world" }); });
  16. 16. Parameterize the routes • You may want a route like `users/:id`… • …and then access the value of `id` easily
  17. 17. Foxx = require("org/arangodb/foxx"); controller = new Foxx.Controller(appContext); controller.get("/users ", function(req, res) { res.json({ hello: }); }); req.params("name"); /:name
  18. 18. • 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
  19. 19. { "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/*" ] } } }
  20. 20. 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
  21. 21. Documentation as a first class citizen
  22. 22. Annotate your Routes • For Documentation • But it is also used for validation
  23. 23. 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. */
  24. 24. Automatically generate Swagger Docs
  25. 25. 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 ;)
  26. 26. Foxx Apps Repo • Look at demo applications • Install components from a central repository • Share your ideas
  27. 27. Foxx Demo App: Aye-Aye
  28. 28. Foxx Authentication https://github.com/moonglum/foxx_authentication
  29. 29. Foxx: The Future
  30. 30. A Glance into the Future • Configure filters for your assets: • UglifyJS2 • Later: Coffee, Sass, Client Templates… • Configurable Logging • Yo Generator
  31. 31. Thanks • Please try ArangoDB Foxx • We to get feedback
  32. 32. Contact • lucas@arangodb.org • @moonbeamlabs on Twitter
  33. 33. Thanks • Database icon designed by Romeo Barreto from The Noun Project • Browser icon designed by Fernando Vasconcelos from The Noun Project • Logos from Node.js, Ruby on Rails, Django and Symfony from the respective projects • All other icons are from Font Awesome

×