r/GoogleAppsScript • u/johndavies112233 • Sep 09 '21
Question Approach when GAS project gets too big
Hi All,
Over the past 3 years, I have built an application using GAS for my small business. It started off as a few little scripts and has accidently grown to be an application with a mySQL database and about 30 or so web pages which perform various functionality. Essentially a client database with a whole bunch of data and the users can go and automate the creation of all sorts of Googler Docs - various reports and contracts etc. The users love using it and it is worth it's weight in gold in terms of time saving. I have cobbled together the scripts using the built in JS editor and use JQuery/Bootstrap etc . I have enjoyed using it but
I am about to embark on a doubling of the functionality (maybe even x3)
Some of other people I am friends with would like to start using it in their companies
I sometimes find it tricky to debug
So I am thinking GAS has reached it shelf life for this app and I want to migrate it to an Industry Standard dev stack and make it into a multi-tenanted application so other companies can use it also. Perhaps they will pay me some money if they like it.
Ideally I would like to keep the system in the Google Cloud for simplicity sake. I am not so worried about having to pay a bit extra to do this (as the MySQL currently costs me ~$20 per month). I would prefer to use a platform where I need to do the least possible to maintain it's upkeep and as much as possible it is looked after for me.
So my research points to using possibly Google App Engine. I would hook that up to my existing mySQL server but would need to rewrite the logic/backend/frontend code. If I need to pay someone to help me, then it would use fairly standard languages like Go or Java and I could use a nice clean UI framework. I would need to think about if other companies used it, would it hook into their google Docs/Drive or would I just store everything on mine and it gets shared with them.
Has anyone done anything like this before and how did it end up?
Do you think I am on the right track?
2
u/ubiquae Sep 09 '21
If you rely a lot on the Libraries/Services available in google script, then the migration could be a bit harder, since you need to start from scratch using other libraries. Google Script offers a lot integrated services (calendar, drive, docs, and so on... even triggers) that are not present in other platforms without using third party libraries.
Other than that, yes, the natural approach would be google app engine.
Anyway, if you are not facing limits in google script, such as execution times or performance, consider the cost of opportunity (you plan to invest time starting from scratch. Instead you improve the existing solution).
1
u/johndavies112233 Sep 11 '21
Thanks for your input ubiquae. I have used the Drive service to make copies of template docs and move them, make new folders etc and with the Docs service I use that quite a lot to add tables and text to documents, headings, search and replace text in documents, Add images in documents. Would all that capability be available if we used App engine?
1
u/ubiquae Sep 11 '21
I think there is an SDK available, built on top of the Drive API.
https://developers.google.com/drive/api/v3/quickstart/python
1
u/johndavies112233 Oct 03 '21
Well, As fate would have it, On Sep 1 google introduced some "updates" to GAS which means that many of my pages are now broken. They modified the iFrame sandbox security. There is no way for me to fix it. So it has just given me a shove along to pick a different platform - one where I have more control and someone cannot just turn things off on me and leave me helpless.
1
u/ubiquae Oct 03 '21
Ouch, what a nightmare... Do you have any links with more information about those changes?
4
u/mttbil Sep 09 '21
I have cobbled together the scripts using the built in JS editor and use JQuery/Bootstrap etc
If you find you don’t want to do a full rewrite, you could keep the code in GAS but make the development a little easier / more standard. If you use clasp you can deploy code from a local copy to a specific script or scripts. You can use modern JS tooling like webpack and even typescript. And the biggest win IMO is that you can easily keep the code under source control.
1
u/Oneandaharv Sep 09 '21
I’d recommend taking a look at AppSheet- not necessarily the perfect solution but I reach a simile point with a system inbuilt and this provided an incredible front end solution that requires minimal upkeep
4
u/DVC888 Sep 09 '21
Why don't you use NodeJS in Google App Engine? At least then it's all Javascript so you wouldn't have to rewrite as much.
You may be able to save yourself a lot of trouble by making your current functions API executable or switch them to run on doPost/doGet, meaning that you wouldn't necessarily have to port them to your hosted app at all.