Skip to content

goodform-ai/drive-cms

Repository files navigation

Drive CMS

Use Google Drive as a free, simple, headless CMS!

Why we made it

Drive CMS is developed by the team behind GoodForm AI, a startup which helps physical therapy patients get their exercise done at home.

A key part of our strategy is to have lots of educational articles about physical therapy, written by a lot of people.

We researched many existing Content Management Systems, only to find that many of them either require high monthly fees or need to be hosted on a costly private server.

With the power of Google Drive, you get a powerful document editor that everyone knows how to use, and a free API to retrieve your documents as HTML.

We were already using Google Drive to write business documents, spreadsheets, and ideas, and now we can use it to publish content directly to our website!

Getting Started

Well, if you've heard enough, let's get started!

Google Cloud Platform Setup

To use Google Drive as a CMS, first you'll have to do some setup in Google Cloud Platform.

  • Enable the Google Drive API
  • Create a Service Account and obtain its credentials
  • Share your website's files or folder with the Service Account's email address
    • Ex. Create a google drive folder and called "Content". Share the folders content with the Service Account's email address. Now every document in there will be accessible through drive-cms

More detailed instructions here: Setting up Google Cloud Platform.

Usage

We designed this for easy use in a NextJS application, but it should be easy to use in any server side JavaScript or TypeScript application.

  1. Install the package in your project with npm install drive-cms.
  2. Create an instance of DriveCMS. Here, you can pass in an auth credential. You can authenticate any way GoogleAuth allows. Read more about Authenticating to Google
// src/lib/drive.ts

import DriveCMS from "drive-cms";

export const driveCMS = new DriveCMS({ keyFile: "./credentials.json" });
  1. Use it in your application!

Coming Soon

Keep an eye out for some fancy features we have planned for the future!

Future Features

  • File Hierarchy Routing
  • Google Sheets support
  • Internationalization
  • Internal Linking
  • Image Optimization
  • YAML Description Metadata
  • Code Block Support
  • Shortcodes like WordPress or Components like MDX

Development Improvements

  • Improved error handling
  • Improve TypeScript "DriveDocument"
  • Configuration in the constructor
  • Integration tests
  • Automated package deploys
  • Improved documentation
  • Documentation site on GitHub Pages
  • Fix link query param handling

License

This project is licensed under the MIT License - see the LICENSE file for details.

Resources

About

Use Google Drive as a free, simple, headless CMS!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors