# code-inayat/rpsa_admin architecture

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

- Interactive diagram: https://gitdiagram.com/code-inayat/rpsa_admin
- Repository: https://github.com/code-inayat/rpsa_admin

## Overview

1. **Repository shape**
   - This is a small, single-purpose admin application built around a Google Apps Script project.
   - The core runtime files are `code.gs`, `index.html`, `script.js`, and `style.css`.
   - The `Backup/` directory and the `*.zip` / alternate file names suggest archived snapshots rather than active subsystems.

2. **Primary runtime boundary**
   - The app lives inside the **Google Apps Script** environment, which acts as both the server runtime and the web app host.
   - That means the main architectural boundary is between:
     - **server-side Apps Script logic** in `code.gs`
     - **browser-side UI logic** in `index.html`, `script.js`, and `style.css`

3. **Server-side layer**
   - `code.gs` is the main backend entrypoint for the Apps Script project.
   - In this kind of repo, it typically handles request routing for the web app, server-side operations, and any integration with Google services.
   - `RPSA_Admin (Code.gs)` appears to be a renamed or exported copy of the same backend file, likely kept for backup or migration purposes.

4. **Client-side UI layer**
   - `index.html` defines the page shell rendered to users.
   - `script.js` contains browser-side behavior: interaction handling, dynamic updates, and calls back into Apps Script backend functions.
   - `style.css` is the dedicated presentation layer for the admin interface.

5. **Likely request/data flow**
   - The browser loads `index.html` from the Apps Script deployment.
   - `script.js` runs in the page and drives user interactions.
   - When the UI needs data or performs an action, it calls server-side Apps Script functions in `code.gs`.
   - The server returns results back to the page, which updates the admin UI accordingly.

6. **Presentation and behavior separation**
   - The repo cleanly separates structure, behavior, and styling:
     - HTML for layout
     - JavaScript for interaction
     - CSS for visual design
   - This makes the front end self-contained inside the Apps Script web app rather than relying on a separate frontend framework.

7. **Operational/storage boundary**
   - No standalone database, API service, or package-managed runtime is visible in the tree.
   - Any persistent state or external integration is therefore likely handled through Google-native services from Apps Script rather than a separate infra component in this repository.
   - For an architecture diagram, the external boundary should be drawn as “Google Apps Script platform / Google workspace services” rather than as an internal microservice.

8. **Archived versions and backups**
   - `Backup/`, `Backup/index.html(Final)`, and `Backup_RPSA_Admin-main (29 July 2025).zip` indicate historical copies of the app.
   - These are not functional runtime modules; they are source preservation artifacts.
   - `index.html(Final)` and the alternate `Code.gs` copy suggest iterative development or finalization of the UI/backend pair.

9. **Important architectural takeaway**
   - This is a **monolithic, script-hosted admin app** rather than a multi-service system.
   - All user-facing behavior is concentrated in one deployable Google Apps Script project, with the browser UI and server logic tightly coupled through Apps Script’s HTML service model.

10. **What to show in a diagram**
   - A single deployment box for **Google Apps Script web app**
   - Inside it, two main parts:
     - **Server-side Apps Script (`code.gs`)**
     - **Client-side HTML/JS/CSS (`index.html`, `script.js`, `style.css`)**
   - A separate area for **backup/archive files** to indicate they are offline artifacts, not runtime components

Main entry points: [`index.html`](https://github.com/code-inayat/rpsa_admin/blob/main/index.html) (index.html), [`Backup`](https://github.com/code-inayat/rpsa_admin/tree/main/Backup) (Backup), [`code.gs`](https://github.com/code-inayat/rpsa_admin/blob/main/code.gs) (code.gs), [`script.js`](https://github.com/code-inayat/rpsa_admin/blob/main/script.js) (script.js)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Apps Script runtime"]
  node_code_gs["code.gs<br/>server script<br/>[code.gs]"]
  node_index_html["index.html<br/>page shell<br/>[index.html]"]
  node_script_js["script.js<br/>client logic<br/>[script.js]"]
  node_style_css["style.css<br/>styles<br/>[style.css]"]
end

subgraph group_archive["Archive copies"]
  node_backup_folder["Backup<br/>snapshot folder"]
  node_backup_html["index.html(Final)<br/>archived page<br/>[index.html(Final)]"]
  node_backup_code["Code.gs copy<br/>archived script"]
  node_backup_zip["project zip<br/>archive bundle"]
end

node_platform[("Apps Script<br/>platform")]

node_platform -->|"runs"| node_code_gs
node_platform -->|"serves"| node_index_html
node_index_html -->|"loads"| node_script_js
node_index_html -->|"styles"| node_style_css
node_script_js -->|"calls"| node_code_gs
node_backup_folder -->|"contains"| node_backup_html
node_backup_folder -->|"contains"| node_backup_code
node_backup_folder -->|"contains"| node_backup_zip
node_backup_code -.->|"copies"| node_code_gs
node_backup_html -.->|"copies"| node_index_html

click node_code_gs "https://github.com/code-inayat/rpsa_admin/blob/main/code.gs"
click node_index_html "https://github.com/code-inayat/rpsa_admin/blob/main/index.html"
click node_script_js "https://github.com/code-inayat/rpsa_admin/blob/main/script.js"
click node_style_css "https://github.com/code-inayat/rpsa_admin/blob/main/style.css"
click node_backup_folder "https://github.com/code-inayat/rpsa_admin/tree/main/Backup"
click node_backup_html "https://github.com/code-inayat/rpsa_admin/blob/main/Backup/index.html(Final)"
click node_backup_code "https://github.com/code-inayat/rpsa_admin/blob/main/RPSA_Admin (Code.gs)"
click node_backup_zip "https://github.com/code-inayat/rpsa_admin/blob/main/Backup_RPSA_Admin-main (29 July 2025).zip"

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_code_gs,node_index_html,node_script_js,node_style_css toneBlue
class node_backup_folder,node_backup_html,node_backup_code,node_backup_zip toneAmber
class node_platform toneNeutral
```

## Components

### Apps Script runtime

Live Google Apps Script web app boundary for server logic and browser UI.

- [code.gs](https://github.com/code-inayat/rpsa_admin/blob/main/code.gs): server script · Main server-side entrypoint for web app logic and Google services access. · `code.gs`
- [index.html](https://github.com/code-inayat/rpsa_admin/blob/main/index.html): page shell · HTML page served to the browser for the admin UI. · `index.html`
- [script.js](https://github.com/code-inayat/rpsa_admin/blob/main/script.js): client logic · Browser-side interaction and Apps Script call handling. · `script.js`
- [style.css](https://github.com/code-inayat/rpsa_admin/blob/main/style.css): styles · Presentation layer for the admin interface. · `style.css`

### Archive copies

Historical snapshots and backups kept outside the active runtime.

- [Backup](https://github.com/code-inayat/rpsa_admin/tree/main/Backup): snapshot folder · Container for preserved historical copies of the app. · `Backup`
- [index.html(Final)](https://github.com/code-inayat/rpsa_admin/blob/main/Backup/index.html(Final)): archived page · Archived HTML snapshot of the UI. · `Backup/index.html(Final)`
- [Code.gs copy](https://github.com/code-inayat/rpsa_admin/blob/HEAD/RPSA_Admin%20(Code.gs)): archived script · Archived renamed copy of the backend script. · `RPSA_Admin (Code.gs)`
- [project zip](https://github.com/code-inayat/rpsa_admin/blob/HEAD/Backup_RPSA_Admin-main%20(29%20July%202025).zip): archive bundle · Compressed backup of the repository snapshot. · `Backup_RPSA_Admin-main (29 July 2025).zip`

### Other components

- **Apps Script**: platform · Google Apps Script web app host and execution environment.

## Connections

- Apps Script → code.gs: runs · Apps Script executes the server-side entrypoint.
- Apps Script → index.html: serves · The host serves the HTML page to the browser.
- index.html → script.js: loads · The page includes the client-side behavior script.
- index.html → style.css: styles · The page includes the stylesheet.
- script.js → code.gs: calls · Client actions invoke server-side Apps Script functions.
- Backup → index.html(Final): contains · Historical HTML snapshot stored in the backup folder.
- Backup → Code.gs copy: contains · Archived backend copy stored as a separate file.
- Backup → project zip: contains · Compressed repository backup artifact.
- Code.gs copy → code.gs: copies · Preserved copy of the active backend script.
- index.html(Final) → index.html: copies · Preserved copy of the active HTML shell.
