Quick Introduction to Strapi Headless CMS for Ionic ReactJS Mobile App
Strapi.io — Strapi is the leading open-source headless CMS. It’s 100% Javascript, fully customizable, and developer-first.
www.strapi.io
Ionic Framework — An open source mobile UI toolkit for building high quality, cross-platform native and web app experiences. Move faster with a single code base, running everywhere with JavaScript and the Web. https://ionicframework.com
What Is A Headless CMS
A headless CMS is content management software that enables writers to produce and organize content while providing developers with structured data that can be displayed using a separate system on the frontend of a website or app.
We quickly setup Strapi as a headless CMS for an Ionic Framework VueJS Application. The Application creates content that contains some text fields and an image field. The video walks through reading the data from Strapi and adding additional documents to the CMS through the Ionic VueJS Application.
ImagePost Object In Strapi
- title: text
- body: text
- image: media
We enable public access to all the content in the application for the purpose of the tutorial.
ReactJS Code
- We use Ionic Framework ReactJS Components
- Start a blank template application using the ionic/cli
- Application has two main components, Home and AddItem
Home.tsx
: displays a list of the ImagePost objectAddItem.tsx
: Input form to add the text fields and to select the image to include with the post
PART TWO
React Query Integration, Email Authentication, and Account Creation
The first part of this section is the integration of React Query to manage the state of the data.
⚛️ REACT QUERY: Hooks for fetching, caching, and updating asynchronous data in React More information on React Query: https://react-query.tanstack.com/
In the second part of this session, we focus on integrating user login and user account creation in the application.