r/GoogleAppsScript • u/jjrides • Mar 01 '24
Question Thoughts on the current best stack for simple small business apps
Hello! I have been building simple apps with Apps Script for one client going back to 2017. What started as a few API requests to add new rows in Sheets has ballooned to 16 Apps Script projects across dozens of Sheets, Forms, custom UIs, and automated emails. While much of this functionality works well, there are some significant downsides and I’d like to hear feedback from this community on better approaches.
The current stack I use is:
Develop locally with vanilla JS and Prettier.
Push commits to Github and then sync changes via the Google Apps Script GitHub Assistant Chrome Extension.
A combination of triggers, menu functions, and custom UIs for the clients employees to invoke various business logic (import data, create invoices, generate documents, send emails, etc).
Most of the day to day work by the client employees is done in Sheets, Drive, and Forms.
Things I like about this current stack:
I don’t have to build and maintain any UIs. With the exception of a little HTML/CSS for emails and custom sidebars/modals, all the UIs the client uses daily Just Work.
Very easy to integrate with Mail, Drive, and everything in the Google ecosystem.
Good documentation and forums.
I have pretty good results running integration tests where I write a method that grabs the current data in a Spreadsheet or Sheet and then makes assertions about the expected schema/values. I run these data consistency tests via triggers and any failure sends an error email.
My clients' employees are pretty comfortable with Excel/Sheets so they can self service a lot of desired functionality using formulas in Sheets.
Downsides to current stack:
No unit testing.
No Typescript.
The Chrome Extension is a clunky way to deploy. I’d rather use something like Clasp and/or Github Actions.
Using Sheets as a data store has been quite slow for many business functions. Some of the projects are working with Spreadsheets that have tens of thousands of rows across dozens of Sheets. All of the reads and writes really slow down the human user experience especially when the client adds a bunch of array formulas and vlookups.
I’m also worried about read/write/delete conflicts with Sheets as a data store. I’m using
LockServicewhere I can, but it doesn’t seem nearly as safe as a proper relational database.
Questions:
Can I stay in the Google ecosystem but use a much faster/reliable data store that still provides Excel/Sheets like self service? If I move the data store to Google Tables or Firebase how easy would it be for the client to access data in Sheets?
What templates and tools provide the best foundation for a greenfield Apps Script project? I’m thinking about trying ez-clasp for my next new project.
4
Mar 01 '24
Have you tried out Appsheet? Pretty easy to make relational databases and user interface is pretty easy to interact with for the client
1
u/jjrides Mar 01 '24
Thanks for the reply. I have looked at AppSheet briefly, but I'm not sure if it provides enough granular control. For instance, can I write I custom script (or use a combination of "Actions" and custom scripts) that will:
accept user input,
make a series of API requests based on business logic, then
insert or update rows across multiple tables?
1
u/marcnotmark925 Mar 01 '24
Yes you could accomplish that.
1
1
u/byssh Mar 02 '24
You’re more advanced than me on just about everything, but AppSheet does allow you to create automations (they call them Bots) that call Apps Scripts. I’ve made a few apps that use a copy/paste specific row that proc on user action. I might be wrong, but I think they can call APIs as well. AppSheet also connects to other relational dbs, BigQuery for sure.
1
u/jjrides Mar 02 '24
Thanks for the advice. I see how to invoke an Apps Script from AppSheets, but it is not clear to me how an Apps Script would then add/update/or delete data in AppSheet. Many Google services have an App Script class that allows easy access to that service (example docs), but it doesn't seem like AppSheet is a first class service in App Scripts. So I'm guessing that in order to add/update/delete data in AppSheet using Apps Script I would first have to modify a data store somewhere else (like Sheets) and then have the AppSheet sync that data.
2
u/byssh Mar 02 '24
Right. The entire concept of AppSheet is that it is built off a Sheets, but I know it can connect to BQ. That’s not something I know anything about because I haven’t had a reason to yet, tbh. AppSheet also supports its own relational db. Your use case just sounds similar to mine, with a whole lot more data. It may be worth looking into the other data connectors in your case.
1
u/jjrides Mar 02 '24
Ok, that is helpful context. It seems like AppSheet isn't meant to be its own data store but rather to import or sync to other data stores. The primary value with AppSheet seems to be the no code (or light coding with linked Apps Scripts) easy Actions/Bots that allow a non-developer to create functionality.
I may use AppSheet for some future project, but for the client I have in mind, the lack of an API (or class) within Apps Script is a deal breaker.
2
u/byssh Mar 02 '24
Not only do I understand; I massively appreciate your civil and reasoned explanation. I hope you find a solution that works for you then. :)
1
u/fugazi56 Mar 01 '24
Love this topic. I could use your help with our Workplace stack. I sent you a DM.
1
5
u/marsili95 Mar 01 '24
Looks like Big Query is the way to go for you. It is really easy to integrate with apps script and it offers a really nice free tier.
Let me know if you want to try it and I can give you some code to understand how to use it.