API Endpoints
The Laravel back end API server provides unified, module-generic access points organized by data/action requested
The server authenticates and validates the requests and directs them to the appropriate controls which in turn send them to the appropriate services. Http responses are sent back to the browser.
Endpoints loosely follow the the CRUD standard, with the addition of the init(), page(), sync() and media related mutations:
app/init() app-wide initialization. (S3 bucket details, accessibility details, etc)
model/init() returns the module-specific Trio (Categories/Groups/Option) data structure definitions to be stored on the front end, in addition to some statistics, texts, and other metadata.
model/index() returns a collection of item IDs according to the given filter parameters. This collection is referred to as “main” in the front end.
model/page() receives a list of IDs (a subarray of one of the frontend collections) and returns one of two arrays, according to the requested views:
Gallery:
array of urls to the item’s first related media, along with a short description. The short is defined by shortQuery() & shortFormat() in each module-specific configuration files.Tabular:
array of objects used to show items a tabular form. These objects are defined by tabularPageQuery() & tabularPageFormat() defined in each module-specifig configuration files.
The paging system limits the amount of data loaded to the front end.
item.show() returns an item with its related data. These include:
fields:
The item's record retrieved from the DBtags:
Array of related tag IDsonps:
Array of related optional numeric properties and their valuesmedia:
Array of related mediarelated:
Array of related item + relation name
carousel() returns details of an item sufficient to display it in a "carousel" form. Two options are available, dependent on the collection source:
main:
ID, media details, and a short description (short is the defined in the module-specific configuration file)related:
main details + relation_name
The mutation API endpoints are self-explanatory.