1
9 Comments

Using Google Sheets as a database (React)

Hey all,

I'm pretty new to programming in general and have a simple, static, list based website I'm building. Right now, it pulls dummy data in json format from another local file.

For the next step, I've made a google sheet and set up some API credentials but haven't the slightest idea on how to get this Google Sheet data into my project in place of the dummy data.

This may be too newbie of a question but I've been reading all over the place and can't find an answer I can walk through! Any help from people using react is much appreciated!

  1. 2

    I made pageviews.ml as a side kick. It is simple. You can check the source for some insights. Used a JS plugin and Zapier to add rows.

    1. 1

      Thank you Shree!

    1. 1

      Thank you digitalronin!

  2. 2

    The biggest issue is that you're allowing the issue of playing with live data.

    Consider these situations:

    • What happens if you accidentally delete rows? Are you 100% certain you can get it back?
    • What is your backup plan?
    • How do you synchronise development updates from one location to another?
    • What happens if there's a payment dispute on your account?
    • What happens when you run out of rows?

    I would suggest using a conventional database. Perhaps look into docker tutorials to create an already ready database while you're developing locally. You'll find that there will be other languages that will need to be learnt too.

    1. 1

      Thank you Vincent! Very good things to consider and I'll look at these tutorials

  3. 2

    I would recommend using Airtable not Google Sheets - it's a much better replacement for a simple database and the documentation for the API is great!

    1. 2

      I use Airtable as the CMS/database for the Social Proof Gallery.

      It's really simple to get set up.

      1. 1

        Thank you Louis! Seems simple enough and a great idea - I'll try it out