Building Hypermedia APIs with FoxxGenerator: ArangoDB Tutorial

This is the third and final part of Lucas blog series about building hypermedia APIs. In the previous part, we identified the needed transitions and collected some information about each of them. Begin with blog post one to get familiar with concepts on Hypermedia and JSON.

We can now describe the identified transitions using FoxxGenerator. To make the most common case simple, it defaults to the type follow. Therefore defining our four follow transitions is easy using FoxxGenerator:

generator.defineTransition('books');
generator.defineTransition('users');
generator.defineTransition('item');
generator.defineTransition('likes');

Note that at this point we are just defining the transitions, we are not adding them to the statemachine we are describing with the help of FoxxGenerator. In the case of creating a book, we need to add additional information. First of, it is a connect transition. Secondly we also need to define the parameters that this transition needs:

generator.defineTransition('createBook', {
  type: 'connect',

  parameters: {
    title: Joi.string()
  }
});

(more…)

More info...

Building Hypermedia APIs: Design Principles & Best Practices

This is the second blog post on building hypermedia APIs with the focus on API design. In part 1 Lucas describes the concept of links in JSON.

Imagine we have an API where people can like books and other people can then see, who likes a certain book. We want this API to be highly connected: We don’t want to look up URLs in a documentation, we want to follow links as we know it from the world wide web. All we want to do as the author of the API is give our users a single URL from which they can then follow links to all other resources. This is similar to the way we would do this with a website. Leonard Richardson and Mike Amundsen refer to this as the billboard URL for this reason: If you put this URL on some billboard, people know everything to get started with your API. (more…)

More info...

Building a Hypermedia API with JSON: ArangoDB Tutorial

When we create websites we don’t just create single pages that have no connection to other Web pages. From the beginning, hyperlinks were part of the core concept of the World Wide Web and for that reason HTML. Links are so essential to the Web that they are even used to rank the popularity of the Web pages on search engines. And who hasn’t gone on a journey through Wikipedia clicking link after link? Even though we all know and appreciate the importance of links on Websites, we rarely use links in our Web APIs. (more…)

More info...

FullStack London

I recently had the chance to visit FullStack London, a well organized conference. Thanks a lot to Skills Matter. FullStack was opened by Douglas Crockford about “The Better Parts” of ES6. I cannot wait to start using them. Douglas was followed by Isaac Schlueter talking about open source in companies. Although this talk was not technical I learned a lot and it was very inspiring.

The remainder of the conference was all about using JavaScript mostly on server-side using Node.js or in robotics. As robotics is not my kind of topic I visited the talks about server-side JS. They confirmed my impression where JS development is heading to: Microservices. (more…)

More info...

Handling Binary Data in Foxx: ArangoDB Tutorial

Handling binary data in JavaScript applications is a bit tricky because JavaScript does not provide a data type for binary data. This post explains how to use binary data in JavaScript actions written using ArangoDB’s Foxx.

String vs. binary data

Internally, JavaScript strings are sequences of 16 bit integer values. Furthermore, the ECMAScript standard requires that a JavaScript implementation should interpret characters in conformance with the Unicode standard, using either UCS-2 or UTF-16 encoding.

While this is fine for handling natural language, it becomes problematic when trying to work with arbitrary binary data. Binary data cannot be used safely in a JavaScript string because it may not be valid UTF-16 data.

Read more on Jan’s Blog

If you want to continue with other JavaScript related resources, you should start with ArangoDB NoSQL and JavaScript.

More info...

Cheerio with Node.js and CoffeeScript | ArangoDB Tutorial

Foxx’ main purpose is to create a beautiful API for your AngularJS, EmberJS or Backbone.js front-end. However, sometimes you want to do more. We, for example, needed to parse some HTML files. ArangoDB is capable of using some Node.js modules, but unfortunately Cheerio was not one of those. One problem was that we did not support loading of JSON data modules. So, this was a good excuse to rewrite the module loader in ArangoDB to make it even more Node.js-friendly.

With those improvements, that are currently available in ArangoDB’s devel branch. You can now also “require” a JSON data file. These files must have a filename ending with “.json”. If the filename ends with “.coffee” it is treated as coffee-script file and automatically compiled into JavaScript.

A Foxx app can now contain its own “node_modules” directory to include Node modules which it requires. This makes it much easier to deploy a Foxx app.

More info...

ArangoDB 1.4.0 Released: Discover New Features | ArangoDB ’13

This version is deprecated. Download the new version of ArangoDB

We are proud to announce that version 1.4.0 of ArangoDB has been released. The release is available for download here: https://www.arangodb.com/download Thanks to all contributors and testers for your enormous help!

Features This release is a major milestone for us, because it contains two of the most wanted features:

  • replication
  • multi-database support It also comes with:
  • Foxx, a lightweight framework for building APIs and applications, see https://www.arangodb.com/manuals/current/UserManualFoxx.html
  • a new and much improved admin web interface, including an intuitive graph browser, see http://www.arangodb.com/manuals/current/NewFeatures14.html#NewFeatures14WebInterface
  • full swagger API documentation, allowing you to easily test and play with the server API using a browser
  • an easy to use import/export tool, see http://www.arangodb.com/manuals/current/NewFeatures14.html#NewFeatures14DumpReload
  • an asynchronous request API (can be used for “fire-and-forget” requests and decrease client waiting time)
  • and several other improvments The complete list of new features can be found here:

http://www.arangodb.com/manuals/current/NewFeatures14.html (more…)

More info...

Ideas and Facts from Scotland.js in Edinburgh | ArangoDB ’13

Test Driven Development

I have been one of the lucky attendants of scotland.js in Edinburgh recently.
It was a really nice & informative conference, thanks to all people that made it possible.
I did really like to see that TDD is reaching the front-end developers finally.
A lot of useful tools for this have been presented by James Shore, Bernard Kobos and Sebastian Golasch.
In ArangoDB, TDD is in action all day and I am looking forward to improving our front-end testing even further using these awesome tools.

 

Front-end Development meets NoSQL

Furthermore several talks focussing on front-end development have been given, e.g. by Gregor Martynus presenting Hoodie.js.
These front-end talks and my discussions with other attendees gave me the impression that front-end developers spend a lot of time deciding which database they should use. (more…)

More info...

ArangoDB 1.3.0 Released: Explore New Features | ArangoDB ’13

This version is deprecated. Download the new version of ArangoDB

Features and Improvements The following list shows in detail which features have been added or improved in ArangoDB 1.3. ArangoDB 1.3 also contains several bugfixes that are not listed here.

Changes to the Datafile Structure As the datafile structure has changed, please read the

upgrade manual carefully.

Rapid API Development with FOXX A preview of the forthcoming Foxx is contained in 1.3. Please note that this is not the final version, Foxx is still experimental. Foxx is a lightweight Javascript “micro framework” which allows you to build applications directly on top of ArangoDB and therefore skip the middleman (Rails, Django, Symfony or whatever your favorite web framework is). Inspired by frameworks like Sinatra Foxx is designed with simplicity and the specific use case of modern client-side MVC frameworks in mind. The screencast at

http://foxx.arangodb.com explains how to use Foxx. (more…)

More info...

Foxx Screencast Part 2: Dive Deeper | ArangoDB ’13

It has taken some time, but now part 2 of the Foxx Screencast is available. I talk about some more advanced topics of Foxx and also plans for the future.

https://www.youtube.com/embed/d3TPtXEGhfk?rel=0

More info...

Get the latest tutorials,
blog posts and news: