Getting Started Guide (Frontend)
Last updated on
2 March 2023
This documentation needs work. See "Help improve this page" in the sidebar.
Who is this guide for?
Developers who are consuming data from Drupal’s JSON:API.
What will they learn?
They will learn how to retrieve data from Drupal for their application.
Goal
Create a decoupled frontend application that demonstrates best practices for consuming data from Drupal JSON:API.
Questions the guide should answer
- How do I use JSON:API? - https://www.drupal.org/docs/core-modules-and-themes/core-modules/jsonapi...
- Error handling
- Are there any existing JS libraries I should use as a starting point?
- Understanding the Drupal data model
- How can I find documentation for a specific site’s JSON:API content architecture
- How can I preview data from a specific site’s JSON:API?
Examples:
- https://www.contentful.com/developers/docs/javascript/tutorials/using-js...
- https://strapi.io/documentation/developer-docs/latest/developer-resource...
Outline
- Concept: JSON:API
- Scaffold the application using a framework of choice. E.g. `create-react-app`
- Existing JS libraries to use as a starting point
- Task: Create a list of pages
- Task: Display an individual page - hard code node id?
- Task: Create a menu based on Drupal API data
- Task: Routing. The user landed at a URL because they followed a link in the menu, display that page for them.
- (phase 2?) Allow a user to register
- (phase 2?) Make authenticated requests to Drupal’s API
- Allow a user to create a comment form that submits to Drupal
- Task: Deploy your application
Help improve this page
Page status: Needs work
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion