# enuchi/react-google-apps-script architecture

> Architecture diagram of the GitHub repository enuchi/react-google-apps-script, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/enuchi/react-google-apps-script
- Repository: https://github.com/enuchi/react-google-apps-script

## Overview

This repository is a React–Google Apps Script starter for custom interfaces in Google Workspace dialogs and sidebars. The main sample workflow is: a spreadsheet user opens a menu, launches a sheet-editor dialog, and creates, deletes, lists, or activates sheets through a client-to-server bridge. Several parallel editors demonstrate React Bootstrap, MUI, Tailwind CSS, and plain React; a separate sidebar demonstrates a lightweight add-on page. The graph focuses on runtime behavior. The README also describes broader Workspace use and local development, but local-development tooling is not product runtime. Arrows are limited to documented or excerpted relationships.

Main entry points: [`src/server/ui.js`](https://github.com/enuchi/react-google-apps-script/blob/main/src/server/ui.js) (Menu and launchers), [`src/client/utils/serverFunctions.ts`](https://github.com/enuchi/react-google-apps-script/blob/main/src/client/utils/serverFunctions.ts) (Promise RPC wrapper), [`src/client/dialog-demo/components/SheetEditor.jsx`](https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo/components/SheetEditor.jsx) (React editor), [`src/client/dialog-demo-mui/components/SheetEditor.jsx`](https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo-mui/components/SheetEditor.jsx) (MUI editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace UI"]
  node_ui["Menu and launchers<br/>[ui.js]"]
end

subgraph group_clients["React samples"]
  node_plain_editor["React editor<br/>[SheetEditor.jsx]"]
  node_plain_input["Sheet name input<br/>[FormInput.jsx]"]
  node_plain_button["Sheet controls<br/>[SheetButton.jsx]"]
  node_bootstrap_editor["Bootstrap editor<br/>[SheetEditor.jsx]"]
  node_bootstrap_input["Bootstrap input<br/>[FormInput.tsx]"]
  node_mui_editor["MUI editor<br/>[SheetEditor.jsx]"]
  node_mui_input["MUI input<br/>[FormInput.tsx]"]
  node_mui_table["MUI sheet table<br/>[SheetTable.tsx]"]
  node_tailwind_editor["Tailwind editor<br/>[SheetEditor.jsx]"]
  node_tailwind_input["Tailwind input<br/>[FormInput.tsx]"]
  node_tailwind_button["Tailwind controls<br/>[SheetButton.jsx]"]
  node_about_page["About sidebar<br/>[About.jsx]"]
end

subgraph group_bridge["Client-server bridge"]
  node_gas_client["Promise RPC wrapper<br/>[serverFunctions.ts]"]
end

subgraph group_services["Apps Script services"]
  node_public_api["Public server API<br/>[index.ts]"]
  node_sheet_ops["Sheet operations<br/>[sheets.ts]"]
end

node_user(("Spreadsheet user"))
node_gas_ui["Workspace UI host"]
node_spreadsheet[("Active spreadsheet")]

node_user -->|"uses"| node_gas_ui
node_gas_ui -->|"invokes menu"| node_ui
node_ui -->|"opens views"| node_gas_ui
node_ui -->|"serves dialog"| node_plain_editor
node_ui -->|"serves dialog"| node_bootstrap_editor
node_ui -->|"serves dialog"| node_mui_editor
node_ui -->|"serves dialog"| node_tailwind_editor
node_ui -->|"serves sidebar"| node_about_page
node_plain_editor -->|"renders"| node_plain_input
node_plain_editor -->|"renders"| node_plain_button
node_bootstrap_editor -->|"renders"| node_bootstrap_input
node_mui_editor -->|"renders"| node_mui_input
node_mui_editor -->|"renders"| node_mui_table
node_tailwind_editor -->|"renders"| node_tailwind_input
node_tailwind_editor -->|"renders"| node_tailwind_button
node_plain_editor -->|"calls sheet RPCs"| node_gas_client
node_bootstrap_editor -->|"calls sheet RPCs"| node_gas_client
node_mui_editor -->|"calls sheet RPCs"| node_gas_client
node_tailwind_editor -->|"calls sheet RPCs"| node_gas_client
node_gas_client -->|"bridges calls"| node_public_api
node_public_api -->|"exports UI handlers"| node_ui
node_public_api -->|"exports sheet handlers"| node_sheet_ops
node_sheet_ops -->|"reads and updates"| node_spreadsheet

click node_ui "https://github.com/enuchi/react-google-apps-script/blob/main/src/server/ui.js"
click node_plain_editor "https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo/components/SheetEditor.jsx"
click node_plain_input "https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo/components/FormInput.jsx"
click node_plain_button "https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo/components/SheetButton.jsx"
click node_bootstrap_editor "https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo-bootstrap/components/SheetEditor.jsx"
click node_bootstrap_input "https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo-bootstrap/components/FormInput.tsx"
click node_mui_editor "https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo-mui/components/SheetEditor.jsx"
click node_mui_input "https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo-mui/components/FormInput.tsx"
click node_mui_table "https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo-mui/components/SheetTable.tsx"
click node_tailwind_editor "https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo-tailwindcss/components/SheetEditor.jsx"
click node_tailwind_input "https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo-tailwindcss/components/FormInput.tsx"
click node_tailwind_button "https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo-tailwindcss/components/SheetButton.jsx"
click node_about_page "https://github.com/enuchi/react-google-apps-script/blob/main/src/client/sidebar-about-page/components/About.jsx"
click node_gas_client "https://github.com/enuchi/react-google-apps-script/blob/main/src/client/utils/serverFunctions.ts"
click node_public_api "https://github.com/enuchi/react-google-apps-script/blob/main/src/server/index.ts"
click node_sheet_ops "https://github.com/enuchi/react-google-apps-script/blob/main/src/server/sheets.ts"

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_ui,node_user,node_gas_ui toneBlue
class node_plain_editor,node_plain_input,node_plain_button,node_bootstrap_editor,node_bootstrap_input,node_mui_editor,node_mui_input,node_mui_table,node_tailwind_editor,node_tailwind_input,node_tailwind_button,node_about_page,node_spreadsheet toneAmber
class node_gas_client toneMint
class node_public_api,node_sheet_ops toneRose
```

## Components

### Workspace UI

- [Menu and launchers](https://github.com/enuchi/react-google-apps-script/blob/main/src/server/ui.js): `src/server/ui.js`

### React samples

- [React editor](https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo/components/SheetEditor.jsx): `src/client/dialog-demo/components/SheetEditor.jsx`
- [Sheet name input](https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo/components/FormInput.jsx): `src/client/dialog-demo/components/FormInput.jsx`
- [Sheet controls](https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo/components/SheetButton.jsx): `src/client/dialog-demo/components/SheetButton.jsx`
- [Bootstrap editor](https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo-bootstrap/components/SheetEditor.jsx): `src/client/dialog-demo-bootstrap/components/SheetEditor.jsx`
- [Bootstrap input](https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo-bootstrap/components/FormInput.tsx): `src/client/dialog-demo-bootstrap/components/FormInput.tsx`
- [MUI editor](https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo-mui/components/SheetEditor.jsx): `src/client/dialog-demo-mui/components/SheetEditor.jsx`
- [MUI input](https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo-mui/components/FormInput.tsx): `src/client/dialog-demo-mui/components/FormInput.tsx`
- [MUI sheet table](https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo-mui/components/SheetTable.tsx): `src/client/dialog-demo-mui/components/SheetTable.tsx`
- [Tailwind editor](https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo-tailwindcss/components/SheetEditor.jsx): `src/client/dialog-demo-tailwindcss/components/SheetEditor.jsx`
- [Tailwind input](https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo-tailwindcss/components/FormInput.tsx): `src/client/dialog-demo-tailwindcss/components/FormInput.tsx`
- [Tailwind controls](https://github.com/enuchi/react-google-apps-script/blob/main/src/client/dialog-demo-tailwindcss/components/SheetButton.jsx): `src/client/dialog-demo-tailwindcss/components/SheetButton.jsx`
- [About sidebar](https://github.com/enuchi/react-google-apps-script/blob/main/src/client/sidebar-about-page/components/About.jsx): `src/client/sidebar-about-page/components/About.jsx`

### Client-server bridge

- [Promise RPC wrapper](https://github.com/enuchi/react-google-apps-script/blob/main/src/client/utils/serverFunctions.ts): `src/client/utils/serverFunctions.ts`

### Apps Script services

- [Public server API](https://github.com/enuchi/react-google-apps-script/blob/main/src/server/index.ts): `src/server/index.ts`
- [Sheet operations](https://github.com/enuchi/react-google-apps-script/blob/main/src/server/sheets.ts): `src/server/sheets.ts`

### Other components

- **Spreadsheet user**
- **Workspace UI host**
- **Active spreadsheet**

## Connections

- Spreadsheet user → Workspace UI host: uses (evidence: `README.md`)
- Workspace UI host → Menu and launchers: invokes menu (evidence: `src/server/ui.js`)
- Menu and launchers → Workspace UI host: opens views (evidence: `src/server/ui.js`)
- Menu and launchers → React editor: serves dialog (evidence: `src/server/ui.js`)
- Menu and launchers → Bootstrap editor: serves dialog (evidence: `src/server/ui.js`)
- Menu and launchers → MUI editor: serves dialog (evidence: `src/server/ui.js`)
- Menu and launchers → Tailwind editor: serves dialog (evidence: `src/server/ui.js`)
- Menu and launchers → About sidebar: serves sidebar (evidence: `src/server/ui.js`)
- React editor → Sheet name input: renders (evidence: `src/client/dialog-demo/components/SheetEditor.jsx`)
- React editor → Sheet controls: renders (evidence: `src/client/dialog-demo/components/SheetEditor.jsx`)
- Bootstrap editor → Bootstrap input: renders (evidence: `src/client/dialog-demo-bootstrap/components/SheetEditor.jsx`)
- MUI editor → MUI input: renders (evidence: `src/client/dialog-demo-mui/components/SheetEditor.jsx`)
- MUI editor → MUI sheet table: renders (evidence: `src/client/dialog-demo-mui/components/SheetEditor.jsx`)
- Tailwind editor → Tailwind input: renders (evidence: `src/client/dialog-demo-tailwindcss/components/SheetEditor.jsx`)
- Tailwind editor → Tailwind controls: renders (evidence: `src/client/dialog-demo-tailwindcss/components/SheetEditor.jsx`)
- React editor → Promise RPC wrapper: calls sheet RPCs (evidence: `src/client/dialog-demo/components/SheetEditor.jsx`)
- Bootstrap editor → Promise RPC wrapper: calls sheet RPCs (evidence: `src/client/dialog-demo-bootstrap/components/SheetEditor.jsx`)
- MUI editor → Promise RPC wrapper: calls sheet RPCs (evidence: `src/client/dialog-demo-mui/components/SheetEditor.jsx`)
- Tailwind editor → Promise RPC wrapper: calls sheet RPCs (evidence: `src/client/dialog-demo-tailwindcss/components/SheetEditor.jsx`)
- Promise RPC wrapper → Public server API: bridges calls (evidence: `src/client/utils/serverFunctions.ts`)
- Public server API → Menu and launchers: exports UI handlers (evidence: `src/server/index.ts`)
- Public server API → Sheet operations: exports sheet handlers (evidence: `src/server/index.ts`)
- Sheet operations → Active spreadsheet: reads and updates (evidence: `src/server/sheets.ts`)
