Overview:
This project supports the demo from the “Everything is a CMS!” talk at Next.js Conf 2020. It aims to showcase the ability to easily swap data sources in and out by using abstracted and normalized engines. There are two types of engines demonstrated: API-Based and File-Based. The project supports various data sources including Bear, Contentful, Dropbox, Fauna, Google Sheets, and Trello.
Features:
- API-Based Engine: This engine is an Apollo GraphQL server. It includes drivers for each supported data source and can be started to see it in action on the front-end.
- File-Based Engine: This engine has a reader and a writer. The reader reads local markdown files for front-end templates, while the writer pulls data from the data sources and writes them to markdown files in the
_data
directory.
Installation:
To run this project in development mode for demo purposes, follow these steps:
- Start the Next server by running the command:
next start
- Visit your browser at
localhost:3000
- Set up the required environment variables for the data sources you want to work with:
- For the API-Based Engine, set the necessary environment variables in the
api-engine/.env
file. Refer to the documentation for each data source to know the required variables. - For the File-Based Engine, run the appropriate command-line script to import files from the desired data source. Replace
[driver]
with the specific driver name (e.g.,bear
,contentful
,dropbox
,fauna
,sheets
,trello
).
Summary:
This project demonstrates the concept of abstracted and normalized engines to easily swap data sources in and out. It includes two types of engines: API-Based and File-Based. The API-Based engine is an Apollo GraphQL server with support for various data sources. The File-Based engine reads local markdown files for front-end templates and pulls data from external sources to write them to markdown files. The project provides installation instructions and highlights key features.