Readit News logoReadit News
Posted by u/joaovcoliveira 2 years ago
Show HN: Using Google Sheets as the back end/APIs of your appzerosheets.com/...
Hello everyone!

At a company I worked for, we needed to develop an MVP (basically a web page) and apply certain business logic to a Google Drive spreadsheet that was frequently updated by the Sales team.

In this case, we had two options:

Develop a backend to replace the current spreadsheet and have the sales team use it as a new "backoffice" - This would take a very long time, and if the hypothesis we were testing was wrong, it would be time wasted.

Create the web page and use Google's SDK to extract data from the spreadsheet.

We chose to go with the second option because it was quicker. Indeed, it was much faster than creating a new backoffice. But not as quick as we imagined. Integrating with Google's SDK requires some effort, especially to handle the OAuth logic, configure it in the console, and understand the documentation (which is quite shallow, by the way).

Anyway! We did the project and I realized that maybe other devs might have encountered similar issues. Therefore, I developed a tool that transforms Google spreadsheets into "realtime APIs" with PATCH, GET, POST, and DELETE methods.

Since it's a product for devs, I think it would be cool to hear your opinions. It's still quite primitive, but the basic features already work.

https://zerosheets.com

seanhunter · 2 years ago
Just beware of the modern version of the "Excel noob trap" which lots of investment banks fell into in the 80s and 90s. Spreadsheets are amazing generic calculating frameworks and you can do a ton in them, so a lot of banks ended up building a huge ediface of excel spreadsheets that ran a wide variety of risk, pricing and operational functions.

With a few plugins and extensions you can really do amazing things with this type of setup. The problem is that your spreadsheets basically become an unmaintainable and impenetrable nightmare and all your business logic is held hostage in various people's personal sheets. Making wide changes becomes hard/impossible and doing something that in a traditional software framework would be easy ("Let's change the frobnicator to twizzle first and then twozzle afterwards, instead of the other way round as it does it now") become very difficult requiring many many changes in many many sheets with a lot of risk, and a lot of dilligence to be sure you have actually made a particular critical fix everywhere.

m12k · 2 years ago
This is remarkably similar to the situation you get with visual scripting in game development - it's intended as a way for designers and artists to do small coding tasks on their own without needing to bother a programmer (e.g. set up a pressure plate that opens a door when you step on it), but their creations also tend to spiral out of control. There's a whole website dedicated to examples of this from Unreal Engine[1]

Personally, I think good refactoring support would be the way to go - make it easier for a programmer to go in and "extract method" or similar to clean things up if they have gotten out of hand, without necessarily having to rewrite the whole thing from scratch.

[1] https://blueprintsfromhell.tumblr.com/

Havoc · 2 years ago
It's not always by choice. It took me around 4 hours of red tape at work to get into a place where I could run a policy compliant python hello world.

Not a full IDE or god forbid pip modules - just hello world. And that's one of the better experiences thus far. Some finance shops simple don't give you any options.

Its par for the course to give office workers access to only Excel and then people are surprised when they build abominations in excel...

smodo · 2 years ago
Totally agree. I’m working for a company right now that put off ‘refactoring’ their tangle of spreadsheets and database query export ‘pipelines’ for over a decade. We are hemorrhaging money right now because it does not scale. And you won’t notice that until it all breaks down.

Now you have effectively created bottlenecks for all critical processes because simultaneously working on spreadsheets is about the most dangerous thing you can do. Data integration becomes a perilous and time consuming affair; there’s no easy way to guarantee conformity between spreadsheets.

You paper over these problems with more code than you ever would have had if you switched to the proper tools earlier.

Karellen · 2 years ago
> Making wide changes becomes hard/impossible

To add to this - no revision control.

OK, maybe you can store your spreadsheets in a RCS, but can you get diffs of the changes, so you can confirm the revision you're about to push is what you meant to do? Can you review the history of diffs, so you can see how the system has changed over time? If multiple people make changes, can you do a merge? Do you even have a separate "working copy" where you can try stuff out, or are you just editing the production copy with no safety harness?

michaelmior · 2 years ago
> no revision control

I'm not claiming this is a sufficient solution, but Google Sheets does keep a version history and you can see changes. Doesn't solve the problem of working copies and merging though.

mananaysiempre · 2 years ago
Only thinking of this now, but a flat OpenDocument shreadsheet (“FODS”, a single XML file, unlike the usual XMLs-in-ZIP flavor) should actually be amenable to text-based version control.
DeathArrow · 2 years ago
But it would be ok maybe to use sheets just for storage. I wonder what size limitation do they have.
Maxion · 2 years ago
Sadly many companies WANT to be in the excel trap...
Yiin · 2 years ago
Can you elaborate? I understand the reasoning "we need to grow no matter the cost, will deal with problems when they arise", but deliberately sabotaging yourself doesn't sound reasonable.
vhiremath4 · 2 years ago
Funny story. Before pivoting my startup to Loom, we were a user testing company named Opentest. Instead of spinning up a DB and creating a dashboard for my co-founders to look at who requested certain user tests, I just dumped everything into a Google Sheet. It was so good. No downtime. Open access. Only 3 people looking/editing, so no conflict. Didn't have to deal with database upgrades or maintenance. I often think about this decision and feel like I've learned a bunch of "good engineering practices" that pale in comparison to how being truly scrappy can be a genius unlock at any level.
ydant · 2 years ago
Agreed. Google Sheets is a great scrappy option for a startup / small company.

I've used it for a lot of system data that needs to be modified by a few people at most. With a little bit of careful code and caching (I like validating and syncing to S3) you can easily use it as a crud frontend for important system data.

It also can make great adhoc dashboards - plug into APIs (even private ones if you add in custom Google Scripts code) or push data updates to the sheets. I've had rather large reports auto updated on a schedule with multiple views of the data (pivot tables, queries, lookups, etc). Fully focused customized views into the data needed to solve specific internal problems with really quick delivery times.

Sure, a custom developed option should be substantially better than Google Sheets, but you won't develop it quicker. By the time you actually need something bigger/better, you should be at a place where your needs are better defined and you can afford the resources to develop something better.

niutech · 2 years ago
Why anybody would like to store their sensitive business data on a public cloud such as Google Sheets?
xcrunner529 · 2 years ago
Yeah my client uses Google forms for some simple use cases and it goes straight to google sheets and I just pull from that for verifying submissions and such in code. Not bad at all.
hot_gril · 2 years ago
Google Sheets is the backbone of several projects I work on, even though I'm a SWE at a large company. It's used as a fronend in some places or a backend in others. But part of this is because we have too much red tape around using simple eng tools like React or Postgres.
datascienced · 2 years ago
Google sheets can also be thought of as a managed nosql DB with a built in management UI.
jakjak123 · 2 years ago
If you can do this one-way data dump, it sounds like a good idea. The issue starts when you have seven different sheets that is supposed to authoritatively control some other processes. The people writing in the spreadsheet can basically do any kind of mutation to the spreadsheet, so it will break extremely easily.

Deleted Comment

2OEH8eoCRo0 · 2 years ago
Sounds neat, let me ask permission first before I put company data into Google Sheets.
NSMutableSet · 2 years ago
All five employers in my work history used Google Workspace / G-Suite. I wouldn't say it's uncommon.
xtracto · 2 years ago
If your email is Google based , chances are your company already have plenty of its data on Googles services.
joaovcoliveira · 2 years ago
its a honor to hear from a loom founder, Ive been using your product for a long time and I love it! 100% onboard on what you said.
vhiremath4 · 2 years ago
Thank you for recording with us! And good luck with this product. There's definitely a bunch of use cases for scrappy prototyping or early mocks!
yangff · 2 years ago
You don't actaully need any fancy wrapping.. just open https://script.google.com/ you can already access all google's APIs + you will be able to integrate your sheets with your gmail (send email), calendar (you can modify the calendar when the sheet get changes), create pages, allow inputs from form and etc..) The problem with that is the sheet will not have any .. transaction based ops like a real database so for example you want to lock certain resources.. you may fail..
forgotmypwlol · 2 years ago
Every time someone makes a simple solution for a problem on this website someone else points out that a much more complicated option already exists.
deepfriedbits · 2 years ago
I'd like to nominate this comment for the HN Hall of Fame
throwaway290 · 2 years ago
It's not a simple solution if it suggests replacing one API with two APIs (sheets + this wrapper). It defeats the point of going with Sheets. Both APIs can break now.

Deleted Comment

nextaccountic · 2 years ago
Is it more complicated, really?
aku286 · 2 years ago
It depends on the end user actually. If it is a developer then it might not be that complicated.

Deleted Comment

yawnxyz · 2 years ago
I'm surprised no one's posted Spread API yet: https://spreadapi.roombelt.com/

It's a free Google Sheets / Apps Script you just paste to your sheet, and it turns the sheet into a full CRUD. It's kind of rate limited though but completely free!

Edit: I've thought about creating a company around Sheets before, and the problem is that once you get to the "willing to pay" stage, you also kind of outgrow Sheets. I'd rather migrate to Turso, Cloudflare D1, or Pocketbase instead of staying with Sheets or SpreadAPI, because of the limitations.

ziolko · 2 years ago
So glad that people find my little project useful!

Please keep in mind that you can always post your improvement ideas or PR's here https://github.com/ziolko/spreadapi.

johtso · 2 years ago
Looks neat! Seems very limited though.. like you can't even insert multiple lines in one request?
altbdoor · 2 years ago
Just tried it out. The script is able to handle multiple commands (GET, POST, etc) in one go, but you will have to package the payload as an array.

See https://github.com/ziolko/spreadapi/blob/master/spread-api.j...

As an example:

    curl -L \
        --data '[{ "method": "POST", "sheet": "Sheet1", "payload": { "username": "John", "age": 25 } }, { "method": "GET", "sheet": "Sheet1" }]' \
        "https://script.google.com/macros/s/$APP_ID/exec"
A single curl request, that POSTs a user, and then GETs the data. So you can do multiple POSTs to add multiple rows too.

nbbaier · 2 years ago
Wow this is really cool, thanks for linking!
_sidewalkchalk_ · 2 years ago
what are the Spread API rate limits? Wasn't able to find info about this on the site
office_drone · 2 years ago
I'd like to plug PocketBase [0] for a similar use case.

Last week I was looking for a place to store random data with API access, and was looking at making a Google Sheets backend, but PocketBase was easy and didn't have a 60 rpm quota [1].

Deploying to a cheap VPS was very easy with CapRover.

[0] https://pocketbase.io/

[1] https://developers.google.com/sheets/api/limits

tonyhart7 · 2 years ago
one vouch for pocketbase, I use pocketbase as general collecting data and export it to csv via api and transfer it to google sheet for viewing,edit etc

super easy for prototyping and getting the job done, while google sheet as a backend is nice too but I need authentication etc etc

hgyjnbdet · 2 years ago
I was looking at pocketbase but I didn't really understand how to use it. I know sqlite and am good at SQL, but couldn't work out how to use it.
crashabr · 2 years ago
You will probably enjoy Datasette more for this use case
phantompeace · 2 years ago
You need to query/write using HTTPS requests
joaovcoliveira · 2 years ago
I loved your product!!

My infrastructure is 100% focused in scale so I think we can work together, we just need to share the costs.

Please send me a message here https://www.zerosheets.com/contact so I can get your contact.

eeue56 · 2 years ago
I recently made a full web app using only AppsScript and Google Sheets as the database, and wrote about it here [0], and open sourced it here [1]. It was a novel experience, but I felt particularly compelled by the idea of having a data store than non-devs can easily interact with while having a web app in front of it that didn't require a server to be set up. But, AppsScript is too slow for this kinda thing to be a nice experience. Zerosheets looks nice, and I'll investigate it further if I look into this idea again!

- [0] https://thetechenabler.substack.com/i/142898781/making-a-sim...

- [1] https://github.com/eeue56/simple-link-aggregator

enumjorge · 2 years ago
> having a data store than non-devs can easily interact with while having a web app in front of it that didn't require a server to be set up

Isn't this one of the use cases for Airtable?

Dead Comment

sfink · 2 years ago
My next user script project idea would require something like this. It's for my own use, but I have to fill out grade sheets using an incredibly painful web UI. The data would be far more easily entered into a spreadsheet. (That's exactly what they used to use, but in order to make things "easier" the school implemented a horrific parody of an ultra basic CRUD web app...) So I want to make a user script that reads from a spreadsheet to populate the painful-to-use web form.

I haven't started yet because (1) I still haven't finished writing up my last user script experience blog post, and (2) I'm terrified of the auth nightmare. It might be easier or harder in the user script context—I am in the context of a web page, so maybe that means I can do a normal oauth flow from there or something?

amf12 · 2 years ago
Have you checked out Apps Script?
aardvarkr · 2 years ago
If you’re using Google sheets then yeah you’ll have to do a normal oauth flow. Alternatively you could use excel and write a simple macro to automate the flow. The easiest thing IMO would be to skip the complicated part of the script (auth) and just copy and paste the values from the clipboard and process the data accordingly.
nativeit · 2 years ago
I was exploring some alternatives for templating and CMSs a few days ago, and stumbled over NPR’s internal toolkit[1] for publishing articles with data, charts, visualizations, etc., and thought it was interesting that they included Google-Sheets-as-a-CMS.

1. https://github.com/nprapps/dailygraphics-next