Quickstart eliobones

Nutshell

Restful eliobones API implement a common standard.

Anatomy of an eliobones API

Auth

Engage

List

Schema

The idea. A bit like how nedb works, but without the merge.

Bones APIs

All eliobones APIs should, by design, enforce the priciple's of elioWay.

All eliobones APIs should provide endpoints for data modelled on every https://schema.org documented schemaTypes.

Largely speaking eliobones APIs handle standard requests like PATCH, DELETE, GET as you would expect, except with a couple of notable exceptions which are detailed below.

SchemaType is a parameter

Where http://bones.api/ is your domain, there should always be a parameter for schemaType, e.g

We will call this the engage parameter, representing the schemaType being engaged (duh!).

schema Endpoint

There should always be an endpoint which can respond with the meta information of a given schemaType. The client can use this meta data to auto-generate the MVC classes, or simply to render a form with inputs tailored to the fields of the schemaType.

Takes 1 parameter:

Examples:

signup Endpoint

In eliobones there is no separate Auth model. We take the view that because one Thing isn't so unlike another, the Auth Model will just be one of the many schemaTypes.

login and logout Endpoints

These endpoints do not need parameters. Simply post the username and password (or credentials) to login, and send nothing except an active session to logout.

get Endpoint

Returns a single Thing with all its fields.

Takes 2 parameters:

list Endpoint

Returns a slim list of Things belonging to the list property of the engaged Thing.

Takes the same parameters as get

Comparing get with get list:

list with Filter Endpoint

Returns a slim list of Things belonging to the list property of the engaged Thing which are filtered to just one schemaType.

Takes the same parameters as get +

Examples:

create Endpoint

In eliobones you can't POST to CREATE a new Thing to a parameterless URL. New Things are always created for an engaged Thing, and added to its list.

Starting from scratch, you should use the signup endpoint described above.

Takes the same parameters as get +

Examples:

update and delete Endpoints

These work as you'd expect:

Both take the same parameters as get.

Creating a new eliobones app

  1. Use yo thing to create a new app elioway/eliobones/bones-inFramework.
  2. Build a Restful API in the framework of your choice.
  3. If required: Create a new Schema Builder in your/repo/elioway/eliothing/thing-inFramework folder.
  4. Get it working.
  5. Test it.
  6. Document it using chisel.
  7. Brand it using generator-art. Tell everyone about it.
  8. Use it to do things the elioWay.
  9. Push it to the https://gitlab.com/eliobones/.