# Glossary — Sessions 0–6

You do not need to memorise this. Look up a term when you need it. File names, functions, the `Registres` tab and example column headers stay unchanged so that the code can still find the data.

## The restaurant

| Restaurant | Our app | Part used in the exercise |
|---|---|---|
| Dining room | Frontend | Index.html in the browser |
| Kitchen | Backend | Codi.gs in Apps Script |
| Pantry | Database | The Registres tab in Sheets |
| Storeroom | File storage | Drive, in a later extension |
| Order and response | Communication | Network requests |

The analogy helps locate responsibilities; it does not describe every possible architecture.

## Session 0: the parts

- **App:** a program that performs a task on a device, in a browser or by combining services.
- **Frontend:** the interface and code running in the browser; the dining room.
- **Backend:** code handling requests on the server; the kitchen. The client can contain logic too.
- **Client:** a program making a request; in this exercise, the browser.
- **Server:** a program handling requests, running on a computer. It does not necessarily have to be remote.
- **Request and response:** information sent to a service and the result it returns.
- **Cloud:** services running on computers accessible over a network. Permissions determine who has access.
- **URL:** the address of a resource or service.
- **Database:** information organised for storage and retrieval. Sheets will serve as a simple practice table.
- **Storage:** a service or medium for saving files. A common pattern stores a file and puts its reference in a table, but this is not a universal rule.
- **Apps Script:** Google's service where our backend will run.
- **Language model or LLM:** a model that generates responses from learned patterns and context, using text units called tokens. A plausible response may be wrong.
- **Prompt:** instructions and context you give AI.
- **Hallucination:** apparently plausible content that is false or invented. Check it and test the result.

## Session 1: building and testing

- **Codi.gs:** the backend file. The initial file may be called Code.gs depending on the language; do not duplicate the same functions.
- **Index.html:** the frontend file. Its name must match the file the backend loads; we use Index in this course.
- **doGet():** the function returning the page when someone opens the app URL.
- **google.script.run:** communication from the frontend to server functions, with success and failure handlers.
- **Spreadsheet document ID:** the identifier between `/spreadsheets/d/` and the next slash. It is not the Script ID or Deployment ID.
- **SpreadsheetApp.openById:** explicitly opens a spreadsheet on the server.
- **Registres:** the data tab name, distinct from the document name.
- **Headers:** column names in row 1; the code checks that they match its configuration.
- **comprovaConnexio():** the practice function checking the document and headers from the editor without adding data.
- **Deploy:** make a code version accessible at a URL to authorised people. This does not necessarily make it public.
- **/exec:** a deployment's URL. Updating the same deployment keeps the address; its settings control access.
- **/dev:** a test URL for project editors, using the latest saved code.
- **New deployment and new version:** create the deployment the first time; afterwards, edit it and select a new version to keep the link.
- **One app, one spreadsheet:** a course convention for separating exercises, not a Google limitation.
- **Authorisation:** permission for a project to access account services. Review the project, code and scope before accepting.
- **Google verification warning:** the app has not completed that verification. It does not guarantee safety or mean you must proceed.
- **MailApp:** an email service with its own permissions and quotas, for an extension beyond the initial log.

## Session 2: improving the app

- **Debug:** reproduce an error, investigate its cause, review a fix and check it.
- **Regression:** a previously working feature fails after a change. A regression test checks it is preserved.
- **/dev:** test URL running the latest saved code, accessible only to project editors.
- **/exec:** URL of a deployed version. Update the deployment to release changes.
- **Data migration:** planned adaptation of the schema or existing data. Requires a copy and checks; reverting code does not undo migration.
- **Record ID:** stable identifier, unlike a row’s changing position.
- **Pagination:** retrieve data in batches. To reduce reads, the server must also bound queried ranges.
- **Storeroom / storage:** service saving files. The spreadsheet can store a reference; app access does not automatically grant file access.

## Session 3: GitHub and the context method

- **Repository:** project files and their version history.
- **GitHub:** service hosting the remote repository and supporting collaboration.
- **Codespace:** cloud development machine with VS Code, accessible through a browser. Compute and storage have account-dependent limits.
- **github.dev:** lightweight web editor without a machine or terminal for running the project.
- **Local / remote:** in Git, the Codespace working copy is “local” relative to the GitHub repository, even though both are in the cloud.
- **Stage:** select changes for a commit. **Commit:** record them locally. **Push:** send them to the remote. **Pull:** incorporate remote changes; conflicts can occur.
- **Diff:** comparison between versions to review additions and removals.
- **Agent:** AI with tools that may read, edit or act according to permissions and configuration. An external chat needs attached material.
- **Context method:** describe what the project does, its constraints and how to verify it before asking for a change. `que-ha-de-fer.md` describes product and tests; `arquitectura.md` describes technical rules.
- **main:** main branch. In S3, practise individually in your new repository; S4 introduces branches and review.

## Session 4 — Branches and pull requests

- **Branch** — a line of commits for working on a change separately from main. It does not create another copy of the data or Apps Script.
- **Pull request (PR)** — a proposal to integrate one branch into another. Opening it does not merge the change.
- **Base / compare** — the branch receiving the change / the branch proposing it.
- **Diff** — differences between versions: additions, removals and context. Review the latest commit’s diff.
- **Review** — check the change against its goal and tests. AI helps but can make mistakes.
- **Merge** — integrate the change into the destination branch. This does not publish an app by itself.
- **Revert** — a change undoing a commit’s effect. In shared history, review it before integration; it does not restore data.

## Session 5 — From repository to deployment

- **Workflow / GitHub Actions** — a process defined in YAML, with events, permissions, steps and conditions. It can run manually or on a push.
- **clasp** — Google’s tool for managing Apps Script code, versions and deployments. The kit pins 3.4.1; prepare login in a trusted environment and publish on the runner.
- **`.clasp.json`** — project configuration: Script ID, folder and extensions. It is not the credential.
- **`.clasprc.json`** — the credential generated by login. Treat it as a secret, outside the repo, chat and logs.
- **Script ID** — identifies the project. **Deployment ID** identifies a deployment of that project. **Spreadsheet ID** identifies the spreadsheet.
- **Version** — a numbered code snapshot. **Deployment** — configuration serving a version at a URL with access settings.
- **clasp push** — uploads code to the project; it may replace all content and does not itself update the version served at /exec.
- **Secret / variable** — configuration separate from code: a sensitive credential / a non-secret value such as an ID. Do not print secrets to diagnose a problem.
- **AUTO_DEPLOY** — kit option: empty keeps publishing manual; true allows pushes to main to publish.
- **Branch protection** — rules limiting changes, subject to plan availability and possible exceptions. Check what is effective in the repo.
- **Recovery** — return to a known version, review the repo and handle data separately.


## Session 6 — Decide, test and recover

- **Origin**: protocol, host and port. Storage also depends on browser and profile.
- **PWA**: web app with installation and intended resources; installation does not guarantee offline use.
- **Service worker**: manages resources within its scope; it does not make remote services available offline.
- **Persistence**: data retained after closing and reopening; test it.
- **JSON backup**: versioned, structured export that must be restorable.
- **Declared status**: in progress, tested and published are portfolio declarations.
- **Public configuration / secret**: client-intended values / privileged credentials that must stay out of the browser.
