# testleaftrainings/pw-js-mar-25 architecture

> Architecture diagram of the GitHub repository testleaftrainings/pw-js-mar-25, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/testleaftrainings/pw-js-mar-25
- Repository: https://github.com/testleaftrainings/pw-js-mar-25

## Overview

This repository is a collection of JavaScript and TypeScript training examples, including browser-automation and Salesforce API exercises. The main user-to-result flows are browser navigation followed by a screenshot or title, page initialization followed by login, and API token generation followed by lead creation or retrieval. The remaining examples teach language fundamentals and TypeScript features as independent lessons. Relationships below follow the sampled code; unsampled lessons are represented only at their enclosing-directory level.

Main entry points: [`Day13/01-apiUtility.ts`](https://github.com/testleaftrainings/pw-js-mar-25/blob/main/Day13/01-apiUtility.ts) (Lead API utility), [`Day14/pages/BasePage.ts`](https://github.com/testleaftrainings/pw-js-mar-25/blob/main/Day14/pages/BasePage.ts) (Base page), [`Day6/07-union-type.js`](https://github.com/testleaftrainings/pw-js-mar-25/blob/main/Day6/07-union-type.js) (Union page actions), [`Day14/pages/LoginPage.ts`](https://github.com/testleaftrainings/pw-js-mar-25/blob/main/Day14/pages/LoginPage.ts) (Login page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_language["Language lessons"]
  node_js["JS fundamentals"]
  node_functions["Functions and control"]
  node_collections["Arrays and promises"]
end

subgraph group_typing["TypeScript lessons"]
  node_types["Types and inference"]
  node_enums["Enums and parameters"]
  node_modifiers["Access modifiers"]
end

subgraph group_automation["Browser automation"]
  node_unions["Union page actions<br/>[07-union-type.js]"]
  node_basepage["Base page<br/>[BasePage.ts]"]
  node_loginpage["Login page<br/>[LoginPage.ts]"]
end

subgraph group_api["API exercises"]
  node_apiutil["Lead API utility<br/>[01-apiUtility.ts]"]
  node_token["Token generation<br/>[01-apiUtility.ts]"]
  node_createlead["Create lead<br/>[01-apiUtility.ts]"]
  node_getlead["Retrieve lead<br/>[01-apiUtility.ts]"]
end

node_learner(("Learner"))
node_playwright["Playwright browser"]
node_salesforce["Salesforce API"]

node_learner -.->|"studies"| node_js
node_learner -.->|"studies"| node_functions
node_learner -.->|"studies"| node_collections
node_learner -.->|"studies"| node_types
node_learner -.->|"studies"| node_enums
node_learner -.->|"studies"| node_modifiers
node_learner -->|"runs"| node_unions
node_unions -->|"launches browser"| node_playwright
node_learner -.->|"uses"| node_basepage
node_basepage -->|"launches browser"| node_playwright
node_loginpage -->|"extends"| node_basepage
node_learner -.->|"uses"| node_apiutil
node_apiutil -->|"exposes"| node_createlead
node_apiutil -->|"exposes"| node_getlead
node_createlead -->|"requests token"| node_token
node_getlead -->|"requests token"| node_token
node_token -->|"requests token"| node_salesforce
node_createlead -->|"creates lead"| node_salesforce
node_getlead -->|"gets lead"| node_salesforce

click node_js "https://github.com/testleaftrainings/pw-js-mar-25/tree/main/Day1"
click node_functions "https://github.com/testleaftrainings/pw-js-mar-25/tree/main/Day2"
click node_collections "https://github.com/testleaftrainings/pw-js-mar-25/tree/main/Day5"
click node_types "https://github.com/testleaftrainings/pw-js-mar-25/tree/main/Day6"
click node_unions "https://github.com/testleaftrainings/pw-js-mar-25/blob/main/Day6/07-union-type.js"
click node_enums "https://github.com/testleaftrainings/pw-js-mar-25/tree/main/Day7"
click node_modifiers "https://github.com/testleaftrainings/pw-js-mar-25/blob/main/Day14/02-access-modifiers.ts"
click node_basepage "https://github.com/testleaftrainings/pw-js-mar-25/blob/main/Day14/pages/BasePage.ts"
click node_loginpage "https://github.com/testleaftrainings/pw-js-mar-25/blob/main/Day14/pages/LoginPage.ts"
click node_apiutil "https://github.com/testleaftrainings/pw-js-mar-25/blob/main/Day13/01-apiUtility.ts"
click node_token "https://github.com/testleaftrainings/pw-js-mar-25/blob/main/Day13/01-apiUtility.ts"
click node_createlead "https://github.com/testleaftrainings/pw-js-mar-25/blob/main/Day13/01-apiUtility.ts"
click node_getlead "https://github.com/testleaftrainings/pw-js-mar-25/blob/main/Day13/01-apiUtility.ts"

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_js,node_functions,node_collections,node_playwright toneBlue
class node_types,node_enums,node_modifiers toneAmber
class node_unions,node_basepage,node_loginpage,node_salesforce toneMint
class node_apiutil,node_token,node_createlead,node_getlead toneRose
class node_learner toneIndigo
```

## Components

### Language lessons

- [JS fundamentals](https://github.com/testleaftrainings/pw-js-mar-25/tree/main/Day1): `Day1`
- [Functions and control](https://github.com/testleaftrainings/pw-js-mar-25/tree/main/Day2): `Day2`
- [Arrays and promises](https://github.com/testleaftrainings/pw-js-mar-25/tree/main/Day5): `Day5`

### TypeScript lessons

- [Types and inference](https://github.com/testleaftrainings/pw-js-mar-25/tree/main/Day6): `Day6`
- [Enums and parameters](https://github.com/testleaftrainings/pw-js-mar-25/tree/main/Day7): `Day7`
- [Access modifiers](https://github.com/testleaftrainings/pw-js-mar-25/blob/main/Day14/02-access-modifiers.ts): `Day14/02-access-modifiers.ts`

### Browser automation

- [Union page actions](https://github.com/testleaftrainings/pw-js-mar-25/blob/main/Day6/07-union-type.js): `Day6/07-union-type.js`
- [Base page](https://github.com/testleaftrainings/pw-js-mar-25/blob/main/Day14/pages/BasePage.ts): `Day14/pages/BasePage.ts`
- [Login page](https://github.com/testleaftrainings/pw-js-mar-25/blob/main/Day14/pages/LoginPage.ts): `Day14/pages/LoginPage.ts`

### API exercises

- [Lead API utility](https://github.com/testleaftrainings/pw-js-mar-25/blob/main/Day13/01-apiUtility.ts): `Day13/01-apiUtility.ts`
- [Token generation](https://github.com/testleaftrainings/pw-js-mar-25/blob/main/Day13/01-apiUtility.ts): `Day13/01-apiUtility.ts`
- [Create lead](https://github.com/testleaftrainings/pw-js-mar-25/blob/main/Day13/01-apiUtility.ts): `Day13/01-apiUtility.ts`
- [Retrieve lead](https://github.com/testleaftrainings/pw-js-mar-25/blob/main/Day13/01-apiUtility.ts): `Day13/01-apiUtility.ts`

### Other components

- **Learner**
- **Playwright browser**
- **Salesforce API**

## Connections

- Learner → JS fundamentals: studies
- Learner → Functions and control: studies
- Learner → Arrays and promises: studies
- Learner → Types and inference: studies
- Learner → Enums and parameters: studies
- Learner → Access modifiers: studies
- Learner → Union page actions: runs (evidence: `Day6/07-union-type.js`)
- Union page actions → Playwright browser: launches browser (evidence: `Day6/07-union-type.js`)
- Learner → Base page: uses
- Base page → Playwright browser: launches browser (evidence: `Day14/pages/BasePage.ts`)
- Login page → Base page: extends (evidence: `Day14/pages/LoginPage.ts`)
- Learner → Lead API utility: uses
- Lead API utility → Create lead: exposes (evidence: `Day13/01-apiUtility.ts`)
- Lead API utility → Retrieve lead: exposes (evidence: `Day13/01-apiUtility.ts`)
- Create lead → Token generation: requests token (evidence: `Day13/01-apiUtility.ts`)
- Retrieve lead → Token generation: requests token (evidence: `Day13/01-apiUtility.ts`)
- Token generation → Salesforce API: requests token (evidence: `Day13/01-apiUtility.ts`)
- Create lead → Salesforce API: creates lead (evidence: `Day13/01-apiUtility.ts`)
- Retrieve lead → Salesforce API: gets lead (evidence: `Day13/01-apiUtility.ts`)
