Google Apps Script is a great way to build and deploy web apps. See Google's developer guide [here](https://developers.google.com/apps-script/guides/web).
## creating a project
You can create a web app project directly from a spreadsheet (Extensions > Apps Script) or as a standalone in Drive (New > Apps Script). You may need to add Apps Script as an extension first (New > More > Connect more apps).
An Apps Script project created from a spreadsheet (or other Google document) is called a "container-bound" script.
The standalone version could be used if you don't need a backend or if you will use multiple Sheets in a single app. Creating directly from a spreadsheet is best if you are not creating a web app (e.g., custom functions or menu items) or only have a single Sheet for a backend. Either way, it doesn't much matter for a web app.
For a web app, you'll want to keep the Code.gs file that the project is initiated with and add at least one `.html` file where you will store your html files. Your Code.gs file must contain a [[doGet function]]. The home page of a web app is by convention named `index.html`. If you are building a large web app, before you get too far along consider using [[UI frameworks]] and modularizing your project as described in [[project organization]].
## initial deployment
Once you have the basic project components set up, you should deploy the app so you can test as you go.
Under Deploy (top right corner), select **New Deployment**. Click the gear next to "Select type" and choose **Web App**. Execute as yourself for now (you will likely change this if you plan to distribute the app) by selecting "Restrict access to only myself". (Or set to "Anyone" if you need to share the draft with others).
Click the link in the dialog to see the draft web app.
This deployment will not show any changes to the code you make as you go. To see changes (after initially deploying according to the instructions above), select *Deploy > Test deployments*. Click the provided link to access the test site, which will "hot reload" to reflect any saved changes to your code as soon as you save them.
## updating deployments
It is best practice to update the Active deployment rather than deploy multiple versions of the same application. This will keep the link to your project the same, so your users can find it again after you update it. The Apps Script editor maintains a version history that will allow you to roll back changes if you need to.
## adding permissions to a spreadsheet
To read and write data from a spreadsheet, you will need to add permissions. You can do this only after you have written code that will attempt to connect to a spreadsheet (e.g., `SpreadsheetApp.openById(id)`).
In the code editor with `Code.gs` open, select the function that interacts with a Google service and click Run. This will prompt you to add permissions. Follow the on-screen dialog (you may need to go to Advanced and past the Unsafe warning and Allow).
## authorization
If your app is interacting with other Google services (like Drive), it will require [[authorization]] (follow link for more).
## index
[[project organization]]
[[include]]
[[script tags in HTML]]
[[passing variables on load]]
[[read data from a spreadsheet on load]]
[[passing HTML]]
[[storing data client-side]]
[[initialize app]]
[[logging]]
[[event listeners]]
[[user input]]
[[write to a spreadsheet]]
[[interacting with a spreadsheet]]
[[methods for reading data]]
[[objects]]
[[form validation]]
[[multi-page app]]
[[UI frameworks]]
[[tables]]
[[deploying as an IFrame]]
[[deploying to a Google Site]]
[[concurrent users]]
[[rapid testing]]
[[read project from CDN]]
[[success handlers]]
[[client-side and server-side code]]