CUE Front for Developers

If you are a back-end developer, then you will mainly be interested in the Cook. The Cook is a node.js application that supplies the content requested by the Waiter and/or other front-end components. The Waiter forwards each page request made by a client directly to the Cook. The Cook is responsible for assembling a response that contains all the content that the Waiter will need to render the page. Retrieving content requires the Cook to make multiple requests to the Content Store, but this complexity is hidden from the Waiter.

When the Cook receives a request from the Waiter, it:

  1. Sends the request URL to a Content Store web service called resolver. The resolver converts this external "pretty" URL to an internal web service URL

  2. Sends a request to the returned web service URL. The Content Store web service returns data in the form of Atom XML resources. In order to obtain all the information needed to respond to the Waiter's request, the Cook will usually need to follow links embedded in the returned Atom data, and send several requests to the web service.

  3. Assembles the information returned from the Content Store into a JSON structure.

  4. Returns the JSON structure to the Waiter.

In order to be able to perform these steps, the Cook needs to know what data the client will need to be able to render the requested page. A content item can have many different fields - which ones is the Waiter actually going to render on the page? A content item can be related to many other content items in a variety of ways - which ones are to be included or linked to on this page, and, which of their fields is required? This information is provided in a recipe. A recipe defines:

  • The information the Waiter needs to render specific page types

  • How the Waiter would like the information for each page type to be organized (that is, the required JSON structure)

Your main responsibility as a developer, therefore, is the creation of a recipe that correctly defines the information to be supplied to the Waiter.