# ast4rt3/centralized_sas_repository architecture

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

- Interactive diagram: https://gitdiagram.com/ast4rt3/centralized_sas_repository
- Repository: https://github.com/ast4rt3/centralized_sas_repository

## Overview

1. The repository is a multi-app portal monorepo. The top-level “SAS Portal” is the central entry point, and `apps/` contains specialized modules that are either standalone static apps or Google Apps Script-backed web apps.

2. The main portal shell lives at the repo root (`index.html`, `app.js`, `styles.css`, `manifest.json`, `serviceWorker.js`, `version.json`) and is mirrored under `www/`. That strongly suggests a static front-end bundle with a deployable copy in `www/` for hosting targets that expect a web root.

3. A central configuration file, `systems.json`, likely drives the portal’s navigation and module registry. In architecture terms, this is the routing/launch boundary: the shell reads config, then opens systems or embeds them, rather than hardcoding every destination.

4. The portal is described as using integrated iFrames for module switching. So the main data flow is “portal shell → configuration → embedded module view,” which keeps the shell isolated from the internal implementation of each sub-app.

5. `Aurora.js` appears to be a shared client-side runtime/helper layer for the portal UI. It likely sits under the portal shell and supports common behaviors such as layout, module loading, or update/version handling.

6. The platform is built as a PWA. The root `serviceWorker.js`, `manifest.json`, and `version.json` indicate offline caching, installability, and a versioned update mechanism. The same pattern is repeated in `apps/attendance-scanner/` with its own `sw.js` and `manifest.json`, so the scanner is an independent PWA boundary.

7. `apps/attendance-viewer/` and `apps/mailer/` are Google Apps Script applications. Each has a `Code.gs` server-side script plus a client `app.js`, HTML, and CSS, which means the UI is served from Apps Script and the server logic runs inside Google’s ecosystem rather than in a separate Node backend.

8. Those GAS-backed apps are the clearest backend integration points in the repo. Their boundary is “browser UI ↔ Apps Script runtime ↔ Google services,” which is distinct from the static portal shell that mostly acts as a launcher and presentation layer.

9. The README calls out announcement media, weather integration, and a TV-optimized immersive mode. Architecturally, that means the portal has a presentation subsystem for dashboards/tickers and external content embeds, separate from the administrative and data-management modules.

10. Security and admin behavior are concentrated in the portal/modules rather than in a centralized backend service. The README mentions login and confirmation gates for administrative actions, so authorization appears to be enforced within the Apps Script or client flow depending on the module.

11. Deployment is static-host oriented: `.github/workflows/static.yml`, `vercel.json`, `env.example.js`, and `DEPLOYMENT_ENV.md` point to environment-specific build/deploy configuration rather than a long-running server process. The architecture is therefore mostly client-side, with selective server-side logic in Google Apps Script.

12. In diagram terms, the main boundaries are: static portal shell; config-driven module launcher; standalone PWA module for attendance scanning; and Apps Script-backed CRUD/reporting apps for attendance viewing and mailing. Those are the primary subsystems and data paths to represent.

Main entry points: [`app.js`](https://github.com/ast4rt3/centralized_sas_repository/blob/main/app.js) (Portal logic), [`index.html`](https://github.com/ast4rt3/centralized_sas_repository/blob/main/index.html) (Portal UI), [`www/index.html`](https://github.com/ast4rt3/centralized_sas_repository/blob/main/www/index.html) (Web root), [`apps/attendance-scanner/index.html`](https://github.com/ast4rt3/centralized_sas_repository/blob/main/apps/attendance-scanner/index.html) (Scanner UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal_shell["Portal shell"]
  node_index_html["Portal UI<br/>static entry<br/>[index.html]"]
  node_app_js["Portal logic<br/>client app<br/>[app.js]"]
  node_styles_css["Portal styles<br/>stylesheet<br/>[styles.css]"]
  node_aurora_js["Aurora<br/>shared runtime<br/>[Aurora.js]"]
  node_systems_json["Systems map<br/>registry config<br/>[systems.json]"]
  node_manifest_json["Portal manifest<br/>pwa manifest<br/>[manifest.json]"]
  node_service_worker_js["Portal SW<br/>service worker<br/>[serviceWorker.js]"]
  node_version_json["Version<br/>[version.json]"]
end

subgraph group_portal_mirror["Deploy mirror"]
  node_www_index_html["Web root<br/>static entry<br/>[index.html]"]
  node_www_app_js["Mirror logic<br/>client app<br/>[app.js]"]
  node_www_styles_css["Mirror styles<br/>stylesheet<br/>[styles.css]"]
  node_www_sw_js["Mirror SW<br/>service worker<br/>[serviceWorker.js]"]
end

subgraph group_attendance_scanner["Attendance scanner"]
  node_attendance_scanner_index["Scanner UI<br/>static app<br/>[index.html]"]
  node_attendance_scanner_sw["Scanner SW<br/>service worker<br/>[sw.js]"]
  node_attendance_scanner_manifest["Scanner manifest<br/>pwa manifest<br/>[manifest.json]"]
end

subgraph group_attendance_viewer["Attendance viewer"]
  node_attendance_viewer_code["Viewer backend<br/>apps script<br/>[Code.gs]"]
  node_attendance_viewer_app["Viewer UI<br/>web client<br/>[app.js]"]
end

subgraph group_mailer_app["Mailer"]
  node_mailer_code["Mailer backend<br/>apps script<br/>[Code.gs]"]
  node_mailer_app_js["Mailer UI<br/>web client<br/>[app.js]"]
end

subgraph group_ops["Ops"]
  node_static_workflow["Static deploy<br/>ci workflow<br/>[static.yml]"]
  node_vercel_json["Vercel config<br/>deploy config<br/>[vercel.json]"]
  node_env_example_js["Env template<br/>env config<br/>[env.example.js]"]
end

node_app_js -->|"loads registry"| node_systems_json
node_app_js -->|"uses runtime"| node_aurora_js
node_index_html -->|"boots"| node_app_js
node_index_html -->|"styles"| node_styles_css
node_app_js -->|"registers"| node_service_worker_js
node_manifest_json -.->|"describes"| node_index_html
node_service_worker_js -->|"checks version"| node_version_json
node_app_js -.->|"mirrors"| node_www_index_html
node_www_index_html -->|"boots"| node_www_app_js
node_www_index_html -->|"styles"| node_www_styles_css
node_www_app_js -->|"registers"| node_www_sw_js
node_app_js -.->|"launches"| node_attendance_scanner_index
node_app_js -.->|"launches"| node_attendance_viewer_app
node_app_js -.->|"launches"| node_mailer_app_js
node_attendance_scanner_index -->|"registers"| node_attendance_scanner_sw
node_attendance_scanner_index -->|"describes"| node_attendance_scanner_manifest
node_attendance_viewer_app -->|"calls"| node_attendance_viewer_code
node_mailer_app_js -->|"calls"| node_mailer_code
node_static_workflow -->|"deploys"| node_www_index_html
node_vercel_json -->|"hosts"| node_index_html
node_env_example_js -.->|"configures"| node_app_js

click node_index_html "https://github.com/ast4rt3/centralized_sas_repository/blob/main/index.html"
click node_app_js "https://github.com/ast4rt3/centralized_sas_repository/blob/main/app.js"
click node_styles_css "https://github.com/ast4rt3/centralized_sas_repository/blob/main/styles.css"
click node_aurora_js "https://github.com/ast4rt3/centralized_sas_repository/blob/main/Aurora.js"
click node_systems_json "https://github.com/ast4rt3/centralized_sas_repository/blob/main/systems.json"
click node_manifest_json "https://github.com/ast4rt3/centralized_sas_repository/blob/main/manifest.json"
click node_service_worker_js "https://github.com/ast4rt3/centralized_sas_repository/blob/main/serviceWorker.js"
click node_version_json "https://github.com/ast4rt3/centralized_sas_repository/blob/main/version.json"
click node_www_index_html "https://github.com/ast4rt3/centralized_sas_repository/blob/main/www/index.html"
click node_www_app_js "https://github.com/ast4rt3/centralized_sas_repository/blob/main/www/app.js"
click node_www_styles_css "https://github.com/ast4rt3/centralized_sas_repository/blob/main/www/styles.css"
click node_www_sw_js "https://github.com/ast4rt3/centralized_sas_repository/blob/main/www/serviceWorker.js"
click node_attendance_scanner_index "https://github.com/ast4rt3/centralized_sas_repository/blob/main/apps/attendance-scanner/index.html"
click node_attendance_scanner_sw "https://github.com/ast4rt3/centralized_sas_repository/blob/main/apps/attendance-scanner/sw.js"
click node_attendance_scanner_manifest "https://github.com/ast4rt3/centralized_sas_repository/blob/main/apps/attendance-scanner/manifest.json"
click node_attendance_viewer_code "https://github.com/ast4rt3/centralized_sas_repository/blob/main/apps/attendance-viewer/Code.gs"
click node_attendance_viewer_app "https://github.com/ast4rt3/centralized_sas_repository/blob/main/apps/attendance-viewer/app.js"
click node_mailer_code "https://github.com/ast4rt3/centralized_sas_repository/blob/main/apps/mailer/Code.gs"
click node_mailer_app_js "https://github.com/ast4rt3/centralized_sas_repository/blob/main/apps/mailer/app.js"
click node_static_workflow "https://github.com/ast4rt3/centralized_sas_repository/blob/main/.github/workflows/static.yml"
click node_vercel_json "https://github.com/ast4rt3/centralized_sas_repository/blob/main/vercel.json"
click node_env_example_js "https://github.com/ast4rt3/centralized_sas_repository/blob/main/env.example.js"

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_index_html,node_app_js,node_styles_css,node_aurora_js,node_systems_json,node_manifest_json,node_service_worker_js,node_version_json toneBlue
class node_www_index_html,node_www_app_js,node_www_styles_css,node_www_sw_js toneAmber
class node_attendance_scanner_index,node_attendance_scanner_sw,node_attendance_scanner_manifest toneMint
class node_attendance_viewer_code,node_attendance_viewer_app toneRose
class node_mailer_code,node_mailer_app_js toneIndigo
class node_static_workflow,node_vercel_json,node_env_example_js toneTeal
```

## Components

### Portal shell

Static SAS Portal entry point and shared runtime

- [Portal UI](https://github.com/ast4rt3/centralized_sas_repository/blob/main/index.html): static entry · Main portal landing page · `index.html`
- [Portal logic](https://github.com/ast4rt3/centralized_sas_repository/blob/main/app.js): client app · Portal shell behavior and module launching · `app.js`
- [Portal styles](https://github.com/ast4rt3/centralized_sas_repository/blob/main/styles.css): stylesheet · Shared portal presentation · `styles.css`
- [Aurora](https://github.com/ast4rt3/centralized_sas_repository/blob/main/Aurora.js): shared runtime · Common UI/runtime helpers for the portal · `Aurora.js`
- [Systems map](https://github.com/ast4rt3/centralized_sas_repository/blob/main/systems.json): registry config · Config-driven module registry and navigation · `systems.json`
- [Portal manifest](https://github.com/ast4rt3/centralized_sas_repository/blob/main/manifest.json): pwa manifest · Installable app metadata · `manifest.json`
- [Portal SW](https://github.com/ast4rt3/centralized_sas_repository/blob/main/serviceWorker.js): service worker · Offline caching and update support · `serviceWorker.js`
- [Version](https://github.com/ast4rt3/centralized_sas_repository/blob/main/version.json): version metadata · Portal version marker used for update handling · `version.json`

### Deploy mirror

Web-root copy of the portal for static hosting targets

- [Web root](https://github.com/ast4rt3/centralized_sas_repository/blob/main/www/index.html): static entry · Mirrored portal entry for hosting · `www/index.html`
- [Mirror logic](https://github.com/ast4rt3/centralized_sas_repository/blob/main/www/app.js): client app · Mirrored portal script bundle · `www/app.js`
- [Mirror styles](https://github.com/ast4rt3/centralized_sas_repository/blob/main/www/styles.css): stylesheet · Mirrored portal styles · `www/styles.css`
- [Mirror SW](https://github.com/ast4rt3/centralized_sas_repository/blob/main/www/serviceWorker.js): service worker · Mirrored offline/update worker · `www/serviceWorker.js`

### Attendance scanner

Standalone PWA module for scanning

- [Scanner UI](https://github.com/ast4rt3/centralized_sas_repository/blob/main/apps/attendance-scanner/index.html): static app · Standalone attendance-scanner entry page · `apps/attendance-scanner/index.html`
- [Scanner SW](https://github.com/ast4rt3/centralized_sas_repository/blob/main/apps/attendance-scanner/sw.js): service worker · Scanner offline cache boundary · `apps/attendance-scanner/sw.js`
- [Scanner manifest](https://github.com/ast4rt3/centralized_sas_repository/blob/main/apps/attendance-scanner/manifest.json): pwa manifest · Scanner installability metadata · `apps/attendance-scanner/manifest.json`

### Attendance viewer

Google Apps Script web app for attendance viewing

- [Viewer backend](https://github.com/ast4rt3/centralized_sas_repository/blob/main/apps/attendance-viewer/Code.gs): apps script · Server-side viewer logic in Google Apps Script · `apps/attendance-viewer/Code.gs`
- [Viewer UI](https://github.com/ast4rt3/centralized_sas_repository/blob/main/apps/attendance-viewer/app.js): web client · Browser client for attendance viewing · `apps/attendance-viewer/app.js`

### Mailer

Google Apps Script web app for messaging

- [Mailer backend](https://github.com/ast4rt3/centralized_sas_repository/blob/main/apps/mailer/Code.gs): apps script · Server-side mailer logic in Google Apps Script · `apps/mailer/Code.gs`
- [Mailer UI](https://github.com/ast4rt3/centralized_sas_repository/blob/main/apps/mailer/app.js): web client · Browser client for the mailer app · `apps/mailer/app.js`

### Ops

Deployment and environment wiring

- [Static deploy](https://github.com/ast4rt3/centralized_sas_repository/blob/main/.github/workflows/static.yml): ci workflow · GitHub Actions static hosting pipeline · `.github/workflows/static.yml`
- [Vercel config](https://github.com/ast4rt3/centralized_sas_repository/blob/main/vercel.json): deploy config · Hosting and deployment settings · `vercel.json`
- [Env template](https://github.com/ast4rt3/centralized_sas_repository/blob/main/env.example.js): env config · Example environment wiring for deployments · `env.example.js`

## Connections

- Portal logic → Systems map: loads registry · Portal shell reads module configuration
- Portal logic → Aurora: uses runtime · Shared helper/runtime layer
- Portal UI → Portal logic: boots · Portal page starts shell logic
- Portal UI → Portal styles: styles · Portal presentation bundle
- Portal logic → Portal SW: registers · Portal shell enables offline/update behavior
- Portal manifest → Portal UI: describes · Installable portal shell metadata
- Portal SW → Version: checks version · Update coordination boundary
- Portal logic → Web root: mirrors · Deployable copy of the portal shell
- Web root → Mirror logic: boots · Mirrored portal entry starts mirrored script
- Web root → Mirror styles: styles · Mirrored portal presentation
- Mirror logic → Mirror SW: registers · Mirrored offline/update behavior
- Portal logic → Scanner UI: launches · Portal opens scanner as an embedded or standalone module
- Portal logic → Viewer UI: launches · Portal opens viewer module
- Portal logic → Mailer UI: launches · Portal opens mailer module
- Scanner UI → Scanner SW: registers · Scanner PWA boundary
- Scanner UI → Scanner manifest: describes · Scanner install metadata
- Viewer UI → Viewer backend: calls · Browser client talks to Apps Script backend
- Mailer UI → Mailer backend: calls · Browser client talks to Apps Script backend
- Static deploy → Web root: deploys · Static pipeline publishes hosted portal copy
- Vercel config → Portal UI: hosts · Hosting target for static portal
- Env template → Portal logic: configures · Environment-specific portal wiring
