Code for Devcon 2021 talk by Javier Gamarra. Slides are here
The idea is to a simple TikTok clone like this:
-> Tested in 7.4/7.3 but Headless code is backported to 7.2 and 7.1.
- Launch your Liferay instance
- Clone this repo, cd to web directory and launch npm i
- Run npm start and Play! :)
- Learn the existing APIs with /o/api && /o/openapi and the documentation
- Show and create GIFs with the REST APIs
- Use GraphQL
- Installing Apollo: npm install @apollo/client graphql
- Create an Apollo client
- Use useQuery
- Conditionally render elements of the UI based on backend permissions with actions
- Store and retrieve documents and web contents in the new Asset libraries
- Return any asset with ContentElements API
- Add new fields using WebContent or RelatedContents or CustomFields -> API extensibility
- Let's define our API, REST Builder
- Improve performance -> fields && restrictFields
- Transform your results with filter, search, sort and flatten
- Embed image with NestedFields & 'data:video/mp4;base64,'
- Return or create all translations & window.navigator.language from chrome://settings/languages#lang
- Aggregate information with facets
- Disable endpoints in headless settings
- Headless channel in Liferay Community Slack
- OLD Headless APIs documentation
- New Liferay Learn documentation
- SwaggerHub (but use /o/api)
- TikTok React template from CleverProgrammers
- Sample videos from Vertical Video: Current State of the Art