# vitalets/playwright-bdd-example architecture

> Architecture diagram of the GitHub repository vitalets/playwright-bdd-example, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vitalets/playwright-bdd-example
- Repository: https://github.com/vitalets/playwright-bdd-example

## Overview

This repository is a small React users-directory app presented as a Playwright BDD example. The user-facing flow loads users from JSONPlaceholder, displays the list, and shows selected-user details. Its BDD example configures Playwright and provides shared fixtures and step definitions. The graph follows relationships visible in the sampled source and README; feature-file contents were not sampled, so scenario-to-step mappings are omitted.

Main entry points: [`src/App.tsx`](https://github.com/vitalets/playwright-bdd-example/blob/main/src/App.tsx) (App coordinator), [`playwright.config.ts`](https://github.com/vitalets/playwright-bdd-example/blob/main/playwright.config.ts) (Playwright config), [`src/main.tsx`](https://github.com/vitalets/playwright-bdd-example/blob/main/src/main.tsx) (React entry), [`src/UsersList.tsx`](https://github.com/vitalets/playwright-bdd-example/blob/main/src/UsersList.tsx) (Users list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Users app"]
  node_entry["React entry<br/>[main.tsx]"]
  node_app["App coordinator<br/>[App.tsx]"]
  node_user["User model<br/>[User.ts]"]
  node_list["Users list<br/>[UsersList.tsx]"]
  node_detail["User details<br/>[UserInfo.tsx]"]
end

subgraph group_bdd["BDD example"]
  node_bddconfig["Playwright config"]
  node_feature["BDD scenarios<br/>[users.feature]"]
  node_fixtures["BDD fixtures<br/>[fixtures.ts]"]
  node_steps["Step definitions<br/>[index.ts]"]
end

node_browser(("Browser user"))
node_api["JSONPlaceholder API"]

node_browser -.->|"opens app"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"fetches users"| node_api
node_app -->|"renders list"| node_list
node_app -->|"renders details"| node_detail
node_list -->|"uses type"| node_user
node_detail -->|"uses type"| node_user
node_bddconfig -->|"loads scenarios"| node_feature
node_bddconfig -->|"loads steps"| node_steps
node_steps -->|"imports bindings"| node_fixtures

click node_entry "https://github.com/vitalets/playwright-bdd-example/blob/main/src/main.tsx"
click node_app "https://github.com/vitalets/playwright-bdd-example/blob/main/src/App.tsx"
click node_user "https://github.com/vitalets/playwright-bdd-example/blob/main/src/User.ts"
click node_list "https://github.com/vitalets/playwright-bdd-example/blob/main/src/UsersList.tsx"
click node_detail "https://github.com/vitalets/playwright-bdd-example/blob/main/src/UserInfo.tsx"
click node_bddconfig "https://github.com/vitalets/playwright-bdd-example/blob/main/playwright.config.ts"
click node_feature "https://github.com/vitalets/playwright-bdd-example/blob/main/features/users.feature"
click node_fixtures "https://github.com/vitalets/playwright-bdd-example/blob/main/features/steps/fixtures.ts"
click node_steps "https://github.com/vitalets/playwright-bdd-example/blob/main/features/steps/index.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_entry,node_app,node_user,node_list,node_detail,node_browser toneBlue
class node_bddconfig,node_feature,node_fixtures,node_steps toneAmber
class node_api toneMint
```

## Components

### Users app

- [React entry](https://github.com/vitalets/playwright-bdd-example/blob/main/src/main.tsx): `src/main.tsx`
- [App coordinator](https://github.com/vitalets/playwright-bdd-example/blob/main/src/App.tsx): `src/App.tsx`
- [User model](https://github.com/vitalets/playwright-bdd-example/blob/main/src/User.ts): `src/User.ts`
- [Users list](https://github.com/vitalets/playwright-bdd-example/blob/main/src/UsersList.tsx): `src/UsersList.tsx`
- [User details](https://github.com/vitalets/playwright-bdd-example/blob/main/src/UserInfo.tsx): `src/UserInfo.tsx`

### BDD example

- [Playwright config](https://github.com/vitalets/playwright-bdd-example/blob/main/playwright.config.ts): `playwright.config.ts`
- [BDD scenarios](https://github.com/vitalets/playwright-bdd-example/blob/main/features/users.feature): `features/users.feature`
- [BDD fixtures](https://github.com/vitalets/playwright-bdd-example/blob/main/features/steps/fixtures.ts): `features/steps/fixtures.ts`
- [Step definitions](https://github.com/vitalets/playwright-bdd-example/blob/main/features/steps/index.ts): `features/steps/index.ts`

### Other components

- **Browser user**
- **JSONPlaceholder API**

## Connections

- Browser user → React entry: opens app
- React entry → App coordinator: renders (evidence: `src/main.tsx`)
- App coordinator → JSONPlaceholder API: fetches users (evidence: `src/App.tsx`)
- App coordinator → Users list: renders list (evidence: `src/App.tsx`)
- App coordinator → User details: renders details (evidence: `src/App.tsx`)
- Users list → User model: uses type (evidence: `src/UsersList.tsx`)
- User details → User model: uses type (evidence: `src/UserInfo.tsx`)
- Playwright config → BDD scenarios: loads scenarios (evidence: `playwright.config.ts`)
- Playwright config → Step definitions: loads steps (evidence: `playwright.config.ts`)
- Step definitions → BDD fixtures: imports bindings (evidence: `features/steps/index.ts`)
