# syailendra123-byte/labsyadidera-beta architecture

> Architecture diagram of the GitHub repository syailendra123-byte/labsyadidera-beta, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/syailendra123-byte/labsyadidera-beta
- Repository: https://github.com/syailendra123-byte/labsyadidera-beta

## Overview

Labsyadidera is a personal-project showcase: visitors browse experiments and tools, with server-side session checks protecting the home and project pages and APIs. Google OAuth creates the session; authenticated API routes expose the user profile and a catalog scanned from static project folders. Individual projects run as separate browser apps, including WebScanner’s in-memory document workflow. The README also describes tiered Google/GitHub access as a planned capability; the supplied source does not show that feature implemented. WebScanner’s views and helpers are grouped by directory where their individual call relationships were not sampled.

Main entry points: [`public/projects/webscanner/src/main.js`](https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/public/projects/webscanner/src/main.js) (WebScanner flow), [`middleware.js`](https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/middleware.js) (Page guard), [`api/auth/callback.js`](https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/api/auth/callback.js) (OAuth callback), [`api/projects.js`](https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/api/projects.js) (Project catalog API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_showcase["Showcase"]
  node_landing["Landing page<br/>[index.html]"]
  node_home_page["Home page<br/>[home.html]"]
end

subgraph group_identity["Identity and access"]
  node_login["Google login<br/>[login.js]"]
  node_callback["OAuth callback<br/>[callback.js]"]
  node_logout["Logout<br/>[logout.js]"]
  node_session_check["Session verifier<br/>[verifySession.js]"]
  node_page_guard["Page guard<br/>[middleware.js]"]
  node_profile_api["Profile endpoint<br/>[me.js]"]
end

subgraph group_catalog["Project catalog"]
  node_catalog_api["Project catalog API<br/>[projects.js]"]
  node_project_files["Static project gallery"]
  node_rupiah_api["Rupiah simulation API<br/>[index.js]"]
  node_other_projects["Project experiments"]
end

subgraph group_webscanner["WebScanner app"]
  node_webscanner_entry["WebScanner flow<br/>[main.js]"]
  node_webscanner_state["In-memory state<br/>[store.js]"]
  node_webscanner_features["Import and editing"]
  node_webscanner_views["Workflow views"]
  node_webscanner_helpers["Canvas and utilities"]
  node_webscanner_drag["Drag-and-drop input<br/>[dragAndDrop.js]"]
end

node_visitor(("Visitor"))
node_browser(("Browser"))
node_google{{"Google OAuth"}}
node_apps_script{{"Google Apps Script"}}

node_visitor -->|"opens"| node_landing
node_browser -->|"starts login"| node_login
node_login -->|"redirects to"| node_google
node_google -->|"returns code"| node_callback
node_callback -->|"exchanges code"| node_google
node_callback -->|"sets session cookie"| node_browser
node_browser -.->|"requests logout"| node_logout
node_profile_api -->|"verifies session"| node_session_check
node_catalog_api -->|"verifies session"| node_session_check
node_page_guard -->|"redirects unauthenticated"| node_browser
node_page_guard -->|"guards access"| node_home_page
node_page_guard -->|"guards access"| node_project_files
node_catalog_api -->|"scans folders"| node_project_files
node_browser -.->|"requests data"| node_rupiah_api
node_rupiah_api -->|"fetches JSON"| node_apps_script
node_visitor -.->|"explores projects"| node_other_projects
node_browser -.->|"opens app"| node_webscanner_entry
node_webscanner_entry -->|"reads and updates"| node_webscanner_state
node_webscanner_entry -->|"mounts views"| node_webscanner_views
node_webscanner_entry -->|"imports files"| node_webscanner_features
node_webscanner_entry -->|"initializes"| node_webscanner_drag
node_webscanner_drag -->|"imports dropped files"| node_webscanner_features

click node_landing "https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/public/index.html"
click node_home_page "https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/public/home.html"
click node_login "https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/api/auth/login.js"
click node_callback "https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/api/auth/callback.js"
click node_logout "https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/api/auth/logout.js"
click node_session_check "https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/lib/verifySession.js"
click node_page_guard "https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/middleware.js"
click node_profile_api "https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/api/me.js"
click node_catalog_api "https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/api/projects.js"
click node_project_files "https://github.com/syailendra123-byte/labsyadidera-beta/tree/main/public/projects"
click node_rupiah_api "https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/api/projects/Simulasi-perkuat-Rupiah/index.js"
click node_other_projects "https://github.com/syailendra123-byte/labsyadidera-beta/tree/main/public/projects"
click node_webscanner_entry "https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/public/projects/webscanner/src/main.js"
click node_webscanner_state "https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/public/projects/webscanner/src/state/store.js"
click node_webscanner_features "https://github.com/syailendra123-byte/labsyadidera-beta/tree/main/public/projects/webscanner/src/features"
click node_webscanner_views "https://github.com/syailendra123-byte/labsyadidera-beta/tree/main/public/projects/webscanner/src/views"
click node_webscanner_helpers "https://github.com/syailendra123-byte/labsyadidera-beta/tree/main/public/projects/webscanner/src/utils"
click node_webscanner_drag "https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/public/projects/webscanner/src/features/dragAndDrop.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_landing,node_home_page,node_browser toneBlue
class node_login,node_callback,node_logout,node_session_check,node_page_guard,node_profile_api toneAmber
class node_catalog_api,node_project_files,node_rupiah_api,node_other_projects toneMint
class node_webscanner_entry,node_webscanner_state,node_webscanner_features,node_webscanner_views,node_webscanner_helpers,node_webscanner_drag toneRose
class node_visitor,node_google,node_apps_script toneIndigo
```

## Components

### Showcase

- [Landing page](https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/public/index.html): `public/index.html`
- [Home page](https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/public/home.html): `public/home.html`

### Identity and access

- [Google login](https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/api/auth/login.js): `api/auth/login.js`
- [OAuth callback](https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/api/auth/callback.js): `api/auth/callback.js`
- [Logout](https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/api/auth/logout.js): `api/auth/logout.js`
- [Session verifier](https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/lib/verifySession.js): `lib/verifySession.js`
- [Page guard](https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/middleware.js): `middleware.js`
- [Profile endpoint](https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/api/me.js): `api/me.js`

### Project catalog

- [Project catalog API](https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/api/projects.js): `api/projects.js`
- [Static project gallery](https://github.com/syailendra123-byte/labsyadidera-beta/tree/main/public/projects): `public/projects`
- [Rupiah simulation API](https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/api/projects/Simulasi-perkuat-Rupiah/index.js): `api/projects/Simulasi-perkuat-Rupiah/index.js`
- [Project experiments](https://github.com/syailendra123-byte/labsyadidera-beta/tree/main/public/projects): `public/projects`

### WebScanner app

- [WebScanner flow](https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/public/projects/webscanner/src/main.js): `public/projects/webscanner/src/main.js`
- [In-memory state](https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/public/projects/webscanner/src/state/store.js): `public/projects/webscanner/src/state/store.js`
- [Import and editing](https://github.com/syailendra123-byte/labsyadidera-beta/tree/main/public/projects/webscanner/src/features): `public/projects/webscanner/src/features`
- [Workflow views](https://github.com/syailendra123-byte/labsyadidera-beta/tree/main/public/projects/webscanner/src/views): `public/projects/webscanner/src/views`
- [Canvas and utilities](https://github.com/syailendra123-byte/labsyadidera-beta/tree/main/public/projects/webscanner/src/utils): `public/projects/webscanner/src/utils`
- [Drag-and-drop input](https://github.com/syailendra123-byte/labsyadidera-beta/blob/main/public/projects/webscanner/src/features/dragAndDrop.js): `public/projects/webscanner/src/features/dragAndDrop.js`

### Other components

- **Visitor**
- **Browser**
- **Google OAuth**
- **Google Apps Script**

## Connections

- Visitor → Landing page: opens (evidence: `README.md`)
- Browser → Google login: starts login (evidence: `api/auth/login.js`)
- Google login → Google OAuth: redirects to (evidence: `api/auth/login.js`)
- Google OAuth → OAuth callback: returns code (evidence: `api/auth/callback.js`)
- OAuth callback → Google OAuth: exchanges code (evidence: `api/auth/callback.js`)
- OAuth callback → Browser: sets session cookie (evidence: `api/auth/callback.js`)
- Browser → Logout: requests logout
- Profile endpoint → Session verifier: verifies session (evidence: `api/me.js`)
- Project catalog API → Session verifier: verifies session (evidence: `api/projects.js`)
- Page guard → Browser: redirects unauthenticated (evidence: `middleware.js`)
- Page guard → Home page: guards access (evidence: `middleware.js`)
- Page guard → Static project gallery: guards access (evidence: `middleware.js`)
- Project catalog API → Static project gallery: scans folders (evidence: `api/projects.js`)
- Browser → Rupiah simulation API: requests data
- Rupiah simulation API → Google Apps Script: fetches JSON (evidence: `api/projects/Simulasi-perkuat-Rupiah/index.js`)
- Visitor → Project experiments: explores projects
- Browser → WebScanner flow: opens app
- WebScanner flow → In-memory state: reads and updates (evidence: `public/projects/webscanner/src/main.js`)
- WebScanner flow → Workflow views: mounts views (evidence: `public/projects/webscanner/src/main.js`)
- WebScanner flow → Import and editing: imports files (evidence: `public/projects/webscanner/src/main.js`)
- WebScanner flow → Drag-and-drop input: initializes (evidence: `public/projects/webscanner/src/main.js`)
- Drag-and-drop input → Import and editing: imports dropped files (evidence: `public/projects/webscanner/src/features/dragAndDrop.js`)
