Вы находитесь на странице: 1из 33

RWTH Aachen, Computer Science Student on branch master

triAGENS GmbH, Developer


moonlum moonbeamlabs
by Lucas Dohmen
Create APIs on your database
AranoDB Foxx
Sinle Pae
Web Applications
The Idea

What if we could talk to


the database directly?

It would only need an API

What if we could dene


this API in JavaScript?
Sinle Pae
Web Applications
Sinle Pae
Web Applications
This doesnt mean its a Rails/ Killer
Client Server DB
Client Server DB
with Foxx
Who is that uy?

AranoDB Core Team

AranoDB Foxx &


Ruby Adapter

Student on the master


branch

hacken.in & nerdkun.de


Who is that uy?

AranoDB Core Team

AranoDB Foxx &


Ruby Adapter

Student on the master


branch

hacken.in & nerdkun.de


/\
(~(
) ) /\_/\
( _-----_(@ @)
( \ /
/|/--\|\ V
" " " "
What is ?

Free and Open Source

Document and Graph Store

with embedded JavaScript

and an amazin query lanuae


M
o
r
e

a
b
o
u
t

A
r
a
n

o
D
B

a
t
R
u
b
y

U
G

M
u
n
i
c
h

n
e
x
t

w
e
e
k
/\
(~(
) ) /\_/\
( _-----_(@ @)
( \ /
/|/--\|\ V
" " " "

a feature of AranoDB 1.4 (currently in


alpha, release: End of September)

an easy way to dene REST APIs on top of


AranoDB

a toolset for developin your sinle pae


web application

not requirin any special code on the client


side use it with Backbone, Ember, Anular
Foxx is
Why another solution?

AranoDB Foxx is streamlined for API


creation not a Jack of all trades

Theres no communication overhead


between (serverside) application and
database

It is desined for front end developers: Use


JavaScript, you already know that
Foxx.Controller
Foxx = require("org/arangodb/foxx");
controller = new Foxx.Controller(appContext);
controller.get("/users", function(req, res) {
res.json({
hello: "world"
});
});
Parameterize
the routes

You may want a route like `users/:id`

and then access the value of `id` easily


Foxx = require("org/arangodb/foxx");
controller = new Foxx.Controller(appContext);
controller.get("/users
", function(req, res) {
res.json({
hello:
});
});
req.params("name");
/:name

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


les
Manifest.json
{
"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/*"
]
}
}
}
More

Dene a setup and teardown function to


create and delete collections

Dene lib to set a base path for your require


statements

Dene les to deliver binary data unaltered


Documentation
as a rst class citizen
Annotate your Routes

For Documentation

But it is also used for validation


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.
*/
Automatically enerate
Swaer Docs
Models & Repositories

Foxx also helps you structure the M part of


MVC

We dont have time for that today

But you can see a demonstration in our


demo app

or come to me later ;)
Foxx Apps Repo

Look at demo applications

Install components from a central repository

Share your ideas


Foxx Demo App:
Aye-Aye
Foxx Authentication
https://ithub.com/moonlum/foxx_authentication
Foxx:
The Future
A Glance into
the Future

Conure lters for your assets:

UlifyJS2

Later: Cofee, Sass, Client Templates

Conurable Loin

Yo Generator
Thanks

Please try AranoDB Foxx

We to et feedback
Contact

lucas@aranodb.or

@moonbeamlabs on Twitter
Thanks

Database icon desined by Romeo Barreto


from The Noun Project

Browser icon desined by Fernando


Vasconcelos from The Noun Project

Loos from Node.js, Ruby on Rails, Djano


and Symfony from the respective projects

All other icons are from Font Awesome

Вам также может понравиться