# eateamagon/testcoordinator architecture

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

- Interactive diagram: https://gitdiagram.com/eateamagon/testcoordinator
- Repository: https://github.com/eateamagon/testcoordinator

## Overview

##### What this project is (type + purpose)
From the file tree and README, this is a **Google Apps Script (GAS) Web App** (or HTML Service UI) intended to assist with “Testing Coordinator” workflows.

Key indicators:
- `Code.gs` → server-side Apps Script entry point / backend logic.
- `index.html` + `javascript.html` + `stylesheet.html` → GAS **HTML Service** UI split into template + client JS + CSS.
- Minimal README suggests a small internal tool, not a multi-service backend.

So your “system” is primarily: **Browser UI ↔ Apps Script Web App (server) ↔ Google Workspace services (potentially Sheets/Drive/Gmail/Calendar, etc.)**.

##### Client/UI (runs in the user’s browser)
- `index.html`
- Likely the main HTML template rendered by `doGet()` in `Code.gs`.
- Contains layout placeholders and `<script>`/`<?!= include(...) ?>` style includes.
- `javascript.html`
- Client-side logic: DOM events, validation, calling server functions via `google.script.run`.
- `stylesheet.html`
- Styling.

##### Server/Backend (runs in Google Apps Script runtime)
- `Code.gs`
- Web entrypoint: typically `doGet(e)` (and possibly `doPost(e)`).
- Server-side functions called by the client (`google.script.run.someFunction()`).
- Integration with Google services (if present in code): `SpreadsheetApp`, `DriveApp`, `GmailApp`, etc.

##### Data stores / external dependencies (not in repo, but likely in runtime)
Even though not visible in the file tree, GAS apps almost always depend on one or more of:
- Google Sheets (as a database)
- Google Drive (files/templates)
- Gmail (notifications)
- Calendar (scheduling)
- PropertiesService (configuration)
- External HTTP APIs (via `UrlFetchApp`)

Before drawing, scan `Code.gs` and list:
##### Data operations
- Which Spreadsheet IDs? Which tabs? Reads/writes?
- Any Drive folders/files used?
##### Auth/permissions
- Does it run “as user accessing” or “as me” (deployment setting)?
- Any triggers (time-based, onEdit, etc.)?
##### External integrations
- `UrlFetchApp.fetch()` targets
- OAuth scopes / advanced services

##### Client (Browser)
- `index.html` (UI layout/template)
- `javascript.html` (client logic; calls server)
- `stylesheet.html` (styling)
##### Server (Apps Script runtime)
- `Code.gs`
- `doGet()` (renders UI)
- “API functions” (server functions callable from client)
- “Data Access” functions (Sheets/Drive operations)
##### Data/Services
- Google Sheets (if used)
- Drive (if used)
- Gmail (if used)
- PropertiesService (if used)

- `doGet()` → returns HTML (index.html plus includes)
- `javascript.html` → `google.script.run.<serverFn>` → `Code.gs:<serverFn>`
- `Code.gs` → `SpreadsheetApp/DriveApp/...` → Google services
- Return path: server function returns data → client success handler

**Patterns to highlight explicitly:**
- **Thin client + server callbacks** pattern (HTML Service + `google.script.run` RPC)
- **Server-side integration layer** (Apps Script services) acting as the “backend”
- Any **Spreadsheet-as-DB** pattern if present

##### RPC mechanism
- Call out `google.script.run` explicitly (this is the API layer).
##### Authorization
- If known, annotate “Runs as: user/me” and “Who has access: domain/anyone” because this strongly affects behavior and data access.

##### “Be detailed, don’t overthink it”: how to split into many components safely
Given the tiny repo, the best way to be “very detailed” is to **subdivide by responsibility**, even if everything is in one file:

- Web handler: `doGet(e)` / `doPost(e)`
- “Business logic” (coordination rules)
- “Data access layer” (all Sheets/Drive calls)
- “Notification layer” (Gmail/Chat/etc., if present)
- “Config” (PropertiesService/constants)

- UI event handlers
- Client validation
- RPC calls + success/failure handlers
- Client-side rendering / DOM updates

## Diagram (Mermaid)

```mermaid
flowchart TD
  %% =========================
  %% System Context (High Level)
  %% =========================
  subgraph "System Context"
    direction TB

    U["Testing Coordinator (User)"]:::external
    B["Browser (End User)"]:::client

    subgraph "Testcoordinator Web App (Google Apps Script Deployment)"
      direction TB
      GAS["Google Apps Script Web App"]:::server
      RPC["google.script.run (Client↔Server RPC)"]:::rpc
    end

    subgraph "Google Workspace Services (Runtime Dependencies)"
      direction TB
      GS[(Google Sheets)]:::datastore
      GD[(Google Drive)]:::datastore
      GM["Gmail / Notifications"]:::service
      PS["PropertiesService (Config)"]:::service
    end

    EXT["External APIs (Optional via UrlFetchApp)"]:::external

    U -->|"uses"| B
    B -->|"HTTPS GET:doGet() -> HTML Service UI"| GAS
    B -->|"invokes server functions"| RPC
    RPC -->|"executes in Apps Script runtime"| GAS

    GAS -->|"reads/writes data"| GS
    GAS -->|"reads/writes files/templates"| GD
    GAS -->|"sends emails/alerts (optional)"| GM
    GAS -->|"loads config/constants (optional)"| PS
    GAS -->|"HTTP(S) calls (optional)"| EXT
  end

  %% =======================================
  %% Container / Component (Repo-Aligned View)
  %% =======================================
  subgraph "Container / Component View (Project Structure + Runtime Split)"
    direction TB

    subgraph "Client (Browser)"
      direction TB
      UI["index.html (HTML Template / Layout)"]:::client
      JS["javascript.html (Client Logic:DOM,validation,RPC handlers)"]:::client
      CSS["stylesheet.html (Styles)"]:::client
    end

    subgraph "Server (Google Apps Script Runtime)"
      direction TB

      CODE["Code.gs (Apps Script Backend)"]:::server

      subgraph "Code.gs Responsibilities (Logical Components)"
        direction TB
        DG["doGet(e) / doPost(e) (Web Entrypoints)"]:::server
        API["Server Functions (RPC Endpoints)"]:::server
        BL["Business Logic (Testing Coordinator rules)"]:::server
        DAL["Data Access Helpers (Sheets/Drive)"]:::server
        NOTIF["Notification Layer (Gmail/Chat/etc., optional)"]:::server
        CFG["Config (PropertiesService/constants, optional)"]:::server
      end
    end

    subgraph "Data / Services (GAS Built-ins)"
      direction TB
      SVC_SHEETS["SpreadsheetApp -> Google Sheets"]:::service
      SVC_DRIVE["DriveApp -> Google Drive"]:::service
      SVC_GMAIL["GmailApp -> Gmail"]:::service
      SVC_PROPS["PropertiesService"]:::service
      SVC_URLFETCH["UrlFetchApp (Optional)"]:::service
    end

    %% Client composition
    UI -->|"includes"| JS
    UI -->|"includes"| CSS

    %% Web app rendering and RPC
    DG -->|"renders HTML Service output"| UI
    JS -->|"google.script.run.<fn>()"| API
    API -->|"calls"| BL
    BL -->|"uses"| DAL
    BL -->|"uses (optional)"| NOTIF
    BL -->|"reads (optional)"| CFG

    %% Apps Script service integrations
    DAL -->|"SpreadsheetApp CRUD"| SVC_SHEETS
    DAL -->|"DriveApp file ops"| SVC_DRIVE
    NOTIF -->|"GmailApp send"| SVC_GMAIL
    CFG -->|"get/set"| SVC_PROPS
    API -->|"UrlFetchApp.fetch() (optional)"| SVC_URLFETCH

    %% Map runtime services to external systems (to avoid long horizontal edges)
    SVC_SHEETS -->|"Google Workspace API"| GS
    SVC_DRIVE -->|"Google Workspace API"| GD
    SVC_GMAIL -->|"Google Workspace API"| GM
    SVC_PROPS -->|"GAS internal store"| PS
    SVC_URLFETCH -->|"HTTP(S)"| EXT

    %% Tie server file to responsibilities
    CODE -->|"contains"| DG
    CODE -->|"contains"| API
    CODE -->|"contains"| BL
    CODE -->|"contains"| DAL
    CODE -->|"contains (optional)"| NOTIF
    CODE -->|"contains (optional)"| CFG
  end

  %% ============
  %% Click Events
  %% ============
  click UI "https://github.com/eateamagon/testcoordinator/blob/main/index.html"
  click JS "https://github.com/eateamagon/testcoordinator/blob/main/javascript.html"
  click CSS "https://github.com/eateamagon/testcoordinator/blob/main/stylesheet.html"
  click CODE "https://github.com/eateamagon/testcoordinator/blob/main/Code.gs"
  click B "https://github.com/eateamagon/testcoordinator/blob/main/README.md"

  %% ======
  %% Styles
  %% ======
  classDef client fill:#1e88e5,stroke:#0d47a1,color:#ffffff,stroke-width:1.2px
  classDef server fill:#fb8c00,stroke:#e65100,color:#ffffff,stroke-width:1.2px
  classDef datastore fill:#43a047,stroke:#1b5e20,color:#ffffff,stroke-width:1.2px
  classDef service fill:#8e24aa,stroke:#4a148c,color:#ffffff,stroke-width:1.2px
  classDef rpc fill:#00897b,stroke:#004d40,color:#ffffff,stroke-width:1.2px
  classDef external fill:#546e7a,stroke:#263238,color:#ffffff,stroke-width:1.2px
```
