Git Product home page Git Product logo

node-prismic-typescript's Introduction

prismic-react-typescript

A detailed example of Prismic CMS integration in ReactJS and TypeScript.

About

The solution is a fully working example of headless Prismic CMS (https://prismic.io/) integration with a bespoke NodeJS/React application with TypeScript.

What it contains

  1. Separated and fully tested Prismic module that you can plug to your application
  2. Smart React application where Prismic content is provided to components as a prop

Approach

There are many different ways to integrate Prismic CMS with your NodeJS project. Prismic endpoints are relatively fast in providing the response, although I felt like I prefer to checkout whole the content upon loading the project first time, then cache it on my end and process accordingly as per React App route settings. It allows to avoid a constant spinner and helps in prerending in-flight. The working, commercial example you can see on my website: https://www.bazazeglarska.pl

In order to correctly address the issue we need to create some assumtions on web application side and on Prismic side.

Prismic CMS

In regard with the Prismic repository

  1. keep the Prismic repository reasonabily simple so that users (other department team members and content editors) can understand it and intuitively start working on it without a fear of change
  2. make Prismic responsible only for content delivery
  3. split the content on Prismic side into two categories:
  4. dynamic data (i.e. list of podcasts, posts, articles, news, images etc.)
  5. text within a layout
  6. each page can have a different layout
  7. each page can have dynamic content assigned or linked as the same slug
  8. support many languages

Web application

  1. Keep it simple for junior/mid devs on React side
  2. There needs to be a logical bridge and consistency between Prismic naming and application naming
  3. Keep TypeScript simple

node-prismic-typescript's People

Contributors

g-wozniak avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.