Skip to content
This repository was archived by the owner on Jan 27, 2018. It is now read-only.

Application Services

Alex Grant edited this page Aug 3, 2015 · 3 revisions

Services

This app exposes two basic services:

  • A Data Service for routes, content, and models.
  • A Mail Service for queuing and sending outgoing mail.

Data Service

The data service that provides the content and data for this example is just a Github repo with a simple resource model. The resource model defines application routes, content, and models that go with each app route.
A github repo was chosen for this example to present a simple, familiar backend. Also, you can understand the data model format at a glance without reading any code.

Two types of routes are used in this example. Both route types have additional models associated with them for consumption by various areas of the application. Additional associated models can be assigned to them, and these can vary per-route.

  • Simple Content which references a content markdown document. This type of route references the ContentPage compoent and is consumed by the ContentPage component.
  • Complex Content which references a json response. This type of route references a specific component for consumption, in this example the Contact component.

Data Service Action Creators

The action creators that use the data service are /action/page and /action/routes. In this example, for simplicity, the page action runs on the client and the routes action runs on the server. The page action is available for reference by routes defined in the backend data service. Actions are made available for reference on the backend in the actions interface file.
Interestingly, routes could be included in the interface for referencing on the backend. This would enable routes to dynamically reference other routes (and so on).

Mail Service

The mail service for this example consists of an MQ service on the application tier to collect the outgoing mail, and defaults to Mandrill for the actual mail service - It could use any well-known mail service.

Mail Service Action Creators

The action creator that uses the mail service is /action/contact.

Service Availability

These services are a made seamlessly available both on the client and server via Yahoo's fetchr and fluxible-plugin-fetchr.

Image Service

In addition to the services exposed by the app, an image processing service is consumed on the client side. The current live reference on Heroku is configured to use Cloudinary.

Clone this wiki locally