Use the Google Drive API as a Content Management System

Overview

Google Drive CMS

This shared Google Drive folder serves as the backend for this sample webpage.

Quick links: Github / NPM / Dockerhub / Heroku

NPM

npm i google-drive-cms

Run local demo

npm i
npm start

Note: The local demo app connects to a remote backend deployed on Heroku. To run your own backend and connect to your own Google Drive, you will need to create your own API credentials by following the steps in the next section.

Connecting to Google APIs via Service account credentials

Create a new Google Cloud project

Enable Google APIs for the project

Generate Service Account credentials

  • Go to Credentials
  • "Create Credentials" > "Service account"
    1. Choose a name and email for the account
    2. Skip step 2
    3. Give your primary google account admin rights to manage this service account
  • Select the Service account you just created
  • Go to the KEYS tab
    • "ADD KEY" > Create new key
    • Use key type "JSON" and download the credentials .json file
    • Rename the file to credentials.json and move it to /secret/credentials.json in this repo.

Node.js usage

const GoogleDriveCMS = require('google-drive-cms')
const cms = new GoogleDriveCMS();
cms.getDoc('1UC7Ah...').then(console.log);

Express server

node node_modules/google-drive-cms/express.js

Docker image

Get the image on Docker Hub.

# pull from docker hub
docker pull nathanbabcock/google-drive-cms

# or build locally:
docker build . -t nathanbabcock/google-drive-cms

# run container, passing in CLIENT_EMAIL and PRIVATE_KEY 
docker run \
  --name google-drive-cms \
  --restart=always \
  --log-opt max-size=100m \
  --log-opt max-file=5 \
  -e CLIENT_EMAIL=your-client-email-here@npm-drive-cms.iam.gserviceaccount.com \
  -e PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n entire private keyfile here \n-----END PRIVATE KEY-----\n" \
  -v cache:/usr/src/app/cache \
  -p 80:80 \
  -d \
  nathanbabcock/google-drive-cms
You might also like...

⚡️The Fullstack React Framework — built on Next.js

⚡️The Fullstack React Framework — built on Next.js

The Fullstack React Framework "Zero-API" Data Layer — Built on Next.js — Inspired by Ruby on Rails Read the Documentation “Zero-API” data layer lets y

Jan 4, 2023

The LMS (Life Management System) is a free tool for personal knowledge management and goal management based on Obsidian.md.

The LMS (Life Management System) is a free tool for personal knowledge management and goal management based on Obsidian.md.

README Documentation | 中文帮助 The LMS (Life Management System) is a tool for personal knowledge management and goal management based on Obsidian.md. It

Dec 21, 2022

Business class content management for Node.js (plugins, server cluster management, data-driven pages)

PencilBlue A full featured Node.js CMS and blogging platform (plugins, server cluster management, data-driven pages) First and foremost: If at any poi

Dec 30, 2022

Business class content management for Node.js (plugins, server cluster management, data-driven pages)

PencilBlue A full featured Node.js CMS and blogging platform (plugins, server cluster management, data-driven pages) First and foremost: If at any poi

Dec 30, 2022

MyDrive is an Open Source cloud file storage server (Similar To Google Drive)

MyDrive is an Open Source cloud file storage server (Similar To Google Drive)

MyDrive is an Open Source cloud file storage server (Similar To Google Drive). Host myDrive on your own server or trusted platform and then access myDrive through your web browser. MyDrive uses mongoDB to store file/folder metadata, and supports multiple databases to store the file chunks, such as Amazon S3, the Filesystem, or just MongoDB. MyDrive is built using Node.js, and Typescript. The service now even supports Docker images!

Dec 30, 2022

Index your Google Drive Easily and Free.

Index your Google Drive Easily and Free.

Google Personal/Shared Drive Index Full White label and Customizable Index | One of a kind Supports Both My and Team/Shared Drives with Dark Mode. Cli

Sep 22, 2021

Todas as aulas da Semana JS Expert 5.0 - Google Drive Clone

Todas as aulas da Semana JS Expert 5.0 - Google Drive Clone

Google Drive Clone - Semana JS Expert 5.0 Seja bem vindo(a) à quinta Semana Javascript Expert. Este é o código inicial para iniciar nossa jornada. Mar

Dec 29, 2022

This extension injects a button to the Google Drive WebUI.

This extension injects a button to the Google Drive WebUI.

This extension injects a button to the Google Drive WebUI. When clicking on it the current folder id is send to your gogdl-ng instance. It was developed and tested on the latest version of Mozilla Firefox and Chrome.

Jul 13, 2022

🔻 Generate a Google Drive direct download link based on the URL or ID

Drive Link Generate a Google Drive direct download link based on the URL or ID. Usage The API is the same on all this platforms ✔️ Deno 🦕 import { dr

Nov 1, 2022

Javascript Content Management System running on Node.js

Cody CMS A Javascript Content Management System running on Node.js We finally took upon the task, we are happy to announce the transition to Express 4

Oct 31, 2022

Calipso is a simple NodeJS content management system based on Express, Connect & Mongoose.

Calipso Calipso is a simple NodeJS content management system, built along similar themes to Drupal and Wordpress, that is designed to be fast, flexibl

Dec 21, 2022

Its a Advanced Content Management System built on top of Frappe.

Its a Advanced Content Management System built on top of Frappe.

Go1 CMS Go1 CMS - Its a Advanced Content Management System built on top of Frappe with Advanced Page builder. Lead your business towards the future of

Dec 29, 2022

[WIP] A micro content management system

T8 CMS T8 is a minimal CMS for static sites and blogs. Tech Stack ReactJS TypeScript Material UI Styled Components Supabase(BaaS) Project Folder Struc

Oct 15, 2022

A bodacious, secure, headless content management system.

A bodacious, secure, headless content management system. Cassiopeia allows you to create your blog with a customizable interface and comes with a dyna

Jan 6, 2023

A helper to use immer as Solid.js Signal to drive state

Solid Immer A helper to use immer as Solid.js Signal to drive state. Installation $ npm install solid-immer Usage Use createImmerSignal to create a im

Nov 22, 2022

A Nest.js API for a restaurant storage management system.

Restaurant Storage Management System Description A Nest.js API for a restaurant storage management system. Installation $ yarn install Database Seeder

Sep 12, 2022

Central service used for management of CodeSupport user generated content.

Central service used for management of CodeSupport user generated content.

CodeSupport API About This repository contains the code for the CodeSupport API. The project is written in TypeScript using the NestJS framework with

Oct 14, 2022

Google Clone using NEXT JS ,SSR, Tailwind and Google API's to search data.

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Sep 23, 2022
Comments
  • Missing return statement?

    Missing return statement?

    Thanks for the great article and for sharing this code. Now I haven't run this code, let alone tested it really, but I noticed that the getSheet function doesn't return early if an error occurs. Shouldn't there be a return statement on line 128? There is one in the similar getDoc function.

    I'm happy to create a pull request if needed.

    opened by Caster 3
  • Return on error in the `getSheet` function

    Return on error in the `getSheet` function

    This commit ensures that all code paths that handle an error by calling the reject function also return as they should. Only getSheet missed a return statement, the other places were already good.

    Closes issue #1.

    opened by Caster 1
Business class content management for Node.js (plugins, server cluster management, data-driven pages)

PencilBlue A full featured Node.js CMS and blogging platform (plugins, server cluster management, data-driven pages) First and foremost: If at any poi

PencilBlue, LLC. 1.6k Dec 30, 2022
Javascript Content Management System running on Node.js

Cody CMS A Javascript Content Management System running on Node.js We finally took upon the task, we are happy to announce the transition to Express 4

Johan Coppieters 669 Oct 31, 2022
Calipso is a simple NodeJS content management system based on Express, Connect & Mongoose.

Calipso Calipso is a simple NodeJS content management system, built along similar themes to Drupal and Wordpress, that is designed to be fast, flexibl

Clifton Cunningham 1.7k Dec 21, 2022
🎉 Next Generation API-first CMS for developers. Generate an API-first CMS from a GraphQL schema with offline prototyping and an inline editor

Tipe Next Generation API-first CMS Design your content Shape and design content for any project you and your team are working on. Create your content

Tipe 2.2k Oct 22, 2021
Reaction is an API-first, headless commerce platform built using Node.js, React, GraphQL. Deployed via Docker and Kubernetes.

Reaction Commerce Reaction is a headless commerce platform built using Node.js, React, and GraphQL. It plays nicely with npm, Docker and Kubernetes. G

Reaction Commerce 11.9k Jan 3, 2023
Use the Google Drive API as a Content Management System

Google Drive CMS This shared Google Drive folder serves as the backend for this sample webpage. Quick links: Github / NPM / Dockerhub / Heroku NPM npm

Nathan Babcock 40 Nov 22, 2022
This is a simple script to upload Multiple files into google drive using google drive API and Nodejs.

Welcome to gDrive Multiple File Upload ?? This is a simple script to upload Multiple files into google drive using google drive API and Nodejs Install

Jayamal Sanuka Hettiarachchi 1 Dec 29, 2021
The Frontend of Escobar's Inventory Management System, Employee Management System, Ordering System, and Income & Expense System

Usage Create an App # with npx $ npx create-nextron-app my-app --example with-javascript # with yarn $ yarn create nextron-app my-app --example with-

Viver Bungag 4 Jan 2, 2023
Warp drive is a lightweight jQuery plugin that helps you create a cool, interactive, configurable, HTML5 canvas based warp drive/starfield effect.

Warp drive jQuery plugin (jquery-warpdrive-plugin) Preview Description Warp drive is a lightweight jQuery plugin that helps you create a cool, interac

Niklas 51 Nov 15, 2022