RFC - Ripple Tide API module #57
dylankelly
started this conversation in
Feature Proposals - RFC
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
Move Tide request functionality in ripple-nuxt-tide module to new module making use of Nuxt 3 server routes to expose an API. Backend for frontend pattern to allow more straightforward data flow in Nuxt sites and open the possibility of reuse in other projects.
Motivation
Currently all requests for Tide Drupal CMS data needed to render a page in a Ripple frontend are made by calling the Drupal resource directly from the frontend via a proxy request to /api endpoints. A typical request to render a landing page might include the following requests
Making these requests in the Nuxt rendering layer has several disadvantages
Nuxt 3 has a concept of server routes used for API data endpoints only, which allows you to easily create an endpoint to serve JSON data. This ticket proposes moving the current requests from the Nuxt context to this layer.
Moving these requests to a dedicated server endpoint would allow us to wrap all the logic for massaging data from Drupal JSON API to a usable page data model. This would be accessed from Nuxt pages in SSR asyncData hook by a HTTP GET request to the custom API endpoint eg /api/routes/nameofpage or some agreed routing schema.
Proposal
Create a POC detailing proposed solution. This approach has already been implemented in the Victoria Together project in https://github.com/dpc-sdp/virtual-vic-gov-au/tree/develop/modules/tide-server-api .
An early proof of concept PR outlines how this works here - dpc-sdp/ripple#1025
The proposed solution does the following:
Ripple-Tide-Api
. This module does the following:Ripple-Nuxt
. This module is responsible for setting up the followingripple-tide-landing-page.
Each content type module adds the following:Proposed module API for creating a new content type
Benefits
Drawbacks
Adoption strategy
ripple-nuxt
andripple-tide-api
)Beta Was this translation helpful? Give feedback.
All reactions