# northwestcoder/appsheet-drivemerge architecture

> Architecture diagram of the GitHub repository northwestcoder/appsheet-drivemerge, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/northwestcoder/appsheet-drivemerge
- Repository: https://github.com/northwestcoder/appsheet-drivemerge

## Overview

This is an AppSheet-backed documentation request app with Google Apps Script automation. Users curate Drive documents and links, create private email templates, and trigger delivery of packaged PDFs; an optional merge flow personalizes copied Docs or Sheets before delivery. The README documents the two spreadsheet-triggered scripts and the main entry point, but source excerpts were unavailable, so internal function calls between script files are not asserted.

Main entry points: [`main.gs`](https://github.com/northwestcoder/appsheet-drivemerge/blob/main/main.gs) (Main handler), [`email.gs`](https://github.com/northwestcoder/appsheet-drivemerge/blob/main/email.gs) (Email sender), [`getdocnamefromid.gs`](https://github.com/northwestcoder/appsheet-drivemerge/blob/main/getdocnamefromid.gs) (Document trigger)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_appsheet["AppSheet app"]
  node_globals[("Globals settings")]
end

subgraph group_curation["Content curation"]
  node_documents[("Document library")]
  node_links[("Link library")]
  node_requests[("Request templates")]
end

subgraph group_automation["Script automation"]
  node_docs_trigger["Document trigger"]
  node_send_trigger["Request trigger<br/>[main.gs]"]
  node_main["Main handler<br/>[main.gs]"]
  node_parser["Merge parser<br/>[parser.gs]"]
  node_columns["Column dictionary"]
end

subgraph group_delivery["Document delivery"]
  node_email["Email sender<br/>[email.gs]"]
  node_drive["Google Drive"]
  node_pdfs["PDF attachments"]
end

node_user(("App user"))
node_recipients(("Email recipients"))
node_api["AppSheet REST API"]

node_user -->|"manages content"| node_appsheet
node_appsheet -->|"updates settings"| node_globals
node_appsheet -->|"curates documents"| node_documents
node_appsheet -->|"curates links"| node_links
node_appsheet -->|"edits templates"| node_requests
node_documents -->|"triggers verification"| node_docs_trigger
node_requests -->|"triggers sending"| node_send_trigger
node_send_trigger -->|"dispatches"| node_main
node_main -->|"updates status"| node_requests
node_main -->|"uses attached files"| node_drive
node_main -->|"sends message"| node_email
node_email -->|"delivers PDFs"| node_recipients
node_drive -->|"provides content"| node_pdfs
node_api -.->|"edits rows"| node_requests

click node_docs_trigger "https://github.com/northwestcoder/appsheet-drivemerge/blob/main/getdocnamefromid.gs"
click node_send_trigger "https://github.com/northwestcoder/appsheet-drivemerge/blob/main/main.gs"
click node_main "https://github.com/northwestcoder/appsheet-drivemerge/blob/main/main.gs"
click node_parser "https://github.com/northwestcoder/appsheet-drivemerge/blob/main/parser.gs"
click node_columns "https://github.com/northwestcoder/appsheet-drivemerge/blob/main/columndictionary.gs"
click node_email "https://github.com/northwestcoder/appsheet-drivemerge/blob/main/email.gs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_appsheet,node_globals,node_user toneBlue
class node_documents,node_links,node_requests toneAmber
class node_docs_trigger,node_send_trigger,node_main,node_parser,node_columns,node_api toneMint
class node_email,node_drive,node_pdfs toneRose
class node_recipients toneIndigo
```

## Components

### App experience

- **AppSheet app**
- **Globals settings**

### Content curation

- **Document library**
- **Link library**
- **Request templates**

### Script automation

- [Document trigger](https://github.com/northwestcoder/appsheet-drivemerge/blob/main/getdocnamefromid.gs): `getdocnamefromid.gs`
- [Request trigger](https://github.com/northwestcoder/appsheet-drivemerge/blob/main/main.gs): `main.gs`
- [Main handler](https://github.com/northwestcoder/appsheet-drivemerge/blob/main/main.gs): `main.gs`
- [Merge parser](https://github.com/northwestcoder/appsheet-drivemerge/blob/main/parser.gs): `parser.gs`
- [Column dictionary](https://github.com/northwestcoder/appsheet-drivemerge/blob/main/columndictionary.gs): `columndictionary.gs`

### Document delivery

- [Email sender](https://github.com/northwestcoder/appsheet-drivemerge/blob/main/email.gs): `email.gs`
- **Google Drive**
- **PDF attachments**

### Other components

- **App user**
- **Email recipients**
- **AppSheet REST API**

## Connections

- App user → AppSheet app: manages content
- AppSheet app → Globals settings: updates settings
- AppSheet app → Document library: curates documents
- AppSheet app → Link library: curates links
- AppSheet app → Request templates: edits templates
- Document library → Document trigger: triggers verification
- Request templates → Request trigger: triggers sending
- Request trigger → Main handler: dispatches
- Main handler → Request templates: updates status
- Main handler → Google Drive: uses attached files
- Main handler → Email sender: sends message
- Email sender → Email recipients: delivers PDFs
- Google Drive → PDF attachments: provides content
- AppSheet REST API → Request templates: edits rows
