-
Notifications
You must be signed in to change notification settings - Fork 3
Application Services
This app exposes two basic services:
- A Data Service for routes, content, and models.
- A Mail Service for queuing and sending outgoing mail.
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
ContentPagecompoent 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
Contactcomponent.
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).
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.
The action creator that uses the mail service is /action/contact.
These services are a made seamlessly available both on the client and server via Yahoo's fetchr and fluxible-plugin-fetchr.
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.