# fossamagna/gas-vue-boilerplate architecture

> Architecture diagram of the GitHub repository fossamagna/gas-vue-boilerplate, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fossamagna/gas-vue-boilerplate
- Repository: https://github.com/fossamagna/gas-vue-boilerplate

## Overview

##### Project type and purpose
- This is a full-stack boilerplate for building and deploying a single-page web application on Google Apps Script (GAS).
- Frontend: Vue.js + Vuetify + TypeScript, bundled by Webpack.
- Backend: TypeScript code for GAS, bundled by Webpack, deployed via clasp.
- Testing: frontend unit/e2e tests (Jest, Cypress), backend tests via gas-test CLI.
- CI/CD: GitHub Actions with encrypted credentials to push to GAS and run tests.

##### File structure
- Top level: monorepo managed by Lerna (`lerna.json`), root `package.json` (scripts, tool versions), scripts folder (`init-repo.js`).
- `/frontend`: Vue CLI project
- `src/` Vue components, views, router, store, plugins
- `tests/` unit (Jest) and e2e (Cypress)
- config files: Babel, ESLint, TypeScript, Vue, Jest, Cypress
- `/backend`: GAS project
- `src/` server-side TS (e.g., `echo.ts`, `index.ts`)
- `test/` gas-test tests
- `webpack.config.js`, `tsconfig.json`
- clasp config files (`.clasp.json`, encrypted credentials)
- CI: `.github/workflows/nodejs.yml` to install deps, decrypt credentials, build, test, deploy.

##### README for additional insights
- The boilerplate supports local development: `yarn` scripts to build, test, deploy.
- Deployment flow: Webpack → compile frontend & backend → clasp push to GAS → webapp served.
- gas-test: remote execution of GAS functions for automated testing.
- GitHub Actions: decrypt `.clasprc.json.enc` and `gas-test-credentials.json.enc`, then run tests and `clasp push`.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Dev & CI Layer
    subgraph "Dev & CI Environment"
        direction TB
        DS["Developer Workstation"]:::repo
        LM["lerna.json"]:::config
        RP["package.json (root)"]:::config
        IS["scripts/init-repo.js"]:::tool
        subgraph "CI/CD Pipeline" 
            direction TB
            CI_YML[".github/workflows/nodejs.yml"]:::ci
            CHECKOUT["Checkout Code"]:::ci
            DECRYPT["Decrypt Secrets"]:::ci
            INSTALL["Install Dependencies"]:::ci
            FTEST["Run Frontend Tests (Jest, Cypress)"]:::ci
            BTEST["Run Backend Tests (gas-test)"]:::ci
            BUILD["Build & Bundle"]:::ci
            DEPLOY["Deploy via clasp"]:::ci
        end
    end

    %% Server Layer (GAS)
    subgraph "GAS Runtime (Server)"
        direction TB
        CLASP_CFG[".clasp.json/.clasp.test.json/.clasprc.json.enc"]:::config
        APPSS["appsscript.json"]:::config
        BB["Backend Bundle (dist/)"]:::bundle
        GAS_RUNTIME["GAS Webapp Endpoint"]:::runtime
        TEST_GAS["Test GAS Runtime"]:::runtime
    end

    %% Client Layer (Browser)
    subgraph "Browser (Client SPA)"
        direction TB
        SPA["Vue.js SPA"]:::client
    end

    %% External Services
    EXT["External Google Services"]:::external

    %% Connections Dev & CI
    DS -->|uses| LM
    DS -->|uses| RP
    DS -->|runs| IS
    DS -->|push code| CI_YML
    CI_YML --> CHECKOUT
    CI_YML --> DECRYPT
    CI_YML --> INSTALL
    CI_YML --> FTEST
    CI_YML --> BTEST
    CI_YML --> BUILD
    CI_YML --> DEPLOY

    %% Deployment & Build Flow
    DS -->|yarn build| BB
    DS -->|clasp push| GAS_RUNTIME
    CI_YML -->|clasp push| GAS_RUNTIME

    %% Serving & Runtime
    GAS_RUNTIME -->|serves SPA HTML/JS| SPA
    SPA -->|google.script.run| GAS_RUNTIME
    GAS_RUNTIME -->|calls| EXT

    %% Testing Runtime
    CI_YML -->|run tests on| TEST_GAS

    %% Click Events
    click LM "https://github.com/fossamagna/gas-vue-boilerplate/blob/master/lerna.json"
    click RP "https://github.com/fossamagna/gas-vue-boilerplate/blob/master/package.json"
    click IS "https://github.com/fossamagna/gas-vue-boilerplate/blob/master/scripts/init-repo.js"
    click CI_YML "https://github.com/fossamagna/gas-vue-boilerplate/blob/master/.github/workflows/nodejs.yml"
    click CLASP_CFG "https://github.com/fossamagna/gas-vue-boilerplate/blob/master/.clasp.json"
    click CLASP_CFG "https://github.com/fossamagna/gas-vue-boilerplate/blob/master/.clasp.test.json"
    click CLASP_CFG "https://github.com/fossamagna/gas-vue-boilerplate/blob/master/.clasprc.json.enc"
    click APPSS "https://github.com/fossamagna/gas-vue-boilerplate/blob/master/appsscript.json"

    classDef config fill:#f2f2f2,stroke:#333,stroke-width:1px
    classDef tool fill:#bbdefb,stroke:#333,stroke-width:1px
    classDef ci fill:#90caf9,stroke:#333,stroke-width:1px
    classDef runtime fill:#c8e6c9,stroke:#333,stroke-width:1px
    classDef bundle fill:#ffe082,stroke:#333,stroke-width:1px
    classDef client fill:#ffe0b2,stroke:#333,stroke-width:1px
    classDef external fill:#fff59d,stroke:#333,stroke-width:1px
    classDef repo fill:#e0e0e0,stroke:#333,stroke-width:1px
```
