The best way to do something like this is to develop it outside of GAS, say using node. Get all your dependencies, etc, and get it working. Then compile everything into a single html page that you can then upload to GAS and use as a webapp.
Even better, if you don't need Google to host this, then simply interact with Sheets using the Sheets API from your app using
Node. You only need to get a Client secret which serves as your Auth.
I've never used this, but that is where I would start.
You want to be using
Sheets Advanced services.