# zahid0162/pitchlab-psl-analytics architecture

> Architecture diagram of the GitHub repository zahid0162/pitchlab-psl-analytics, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zahid0162/pitchlab-psl-analytics
- Repository: https://github.com/zahid0162/pitchlab-psl-analytics

## Overview

PitchLab PSL is a browser-based cricket data workbench. Users start with a generated PSL sample or upload a CSV; the app profiles the dataset, then presents schema and memory diagnostics, statistical summaries, and configurable Python analysis scripts for download. The graph includes the app’s stateful orchestration and the shared profile/schema contract. Source excerpts establish the sample and profiling flow; several component connections are supported by the source index, while unsampled implementation details are not inferred.

Main entry points: [`src/App.tsx`](https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/App.tsx) (Workspace app), [`src/components/PythonScriptLabView.tsx`](https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/components/PythonScriptLabView.tsx) (Script lab), [`src/components/TopHeader.tsx`](https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/components/TopHeader.tsx) (Upload header), [`src/components/CsvProfilerView.tsx`](https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/components/CsvProfilerView.tsx) (Profile view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace orchestration"]
  node_app["Workspace app<br/>[App.tsx]"]
  node_header["Upload header<br/>[TopHeader.tsx]"]
  node_sidebar["Workspace navigation<br/>[Sidebar.tsx]"]
  node_entry["React entry<br/>[main.tsx]"]
end

subgraph group_dataset["Dataset profiling"]
  node_profile["CSV profiler<br/>[csvProfiler.ts]"]
  node_sample["Sample generator<br/>[samplePslData.ts]"]
  node_profiler_view["Profile view"]
  node_contract["Profile data types<br/>[psl.ts]"]
end

subgraph group_analysis["Statistical analysis"]
  node_stats_view["Statistics view"]
end

subgraph group_scripts["Python script lab"]
  node_script_view["Script lab"]
  node_script_data["Script catalog<br/>[pythonScripts.ts]"]
  node_code_block["Code display"]
end

node_user(("Analyst"))

node_user -->|"uploads CSV"| node_header
node_entry -->|"renders"| node_app
node_app -->|"builds sample"| node_sample
node_app -->|"profiles CSV"| node_profile
node_app -->|"renders"| node_header
node_app -->|"renders"| node_sidebar
node_app -->|"renders"| node_profiler_view
node_app -->|"renders"| node_stats_view
node_app -.->|"renders"| node_script_view
node_app -->|"loads scripts"| node_script_data
node_script_view -->|"renders"| node_code_block
node_app -.->|"passes profile"| node_profiler_view
node_app -.->|"passes profile"| node_stats_view

click node_app "https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/App.tsx"
click node_header "https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/components/TopHeader.tsx"
click node_sidebar "https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/components/Sidebar.tsx"
click node_profile "https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/utils/csvProfiler.ts"
click node_sample "https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/data/samplePslData.ts"
click node_profiler_view "https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/components/CsvProfilerView.tsx"
click node_contract "https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/types/psl.ts"
click node_stats_view "https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/components/StatisticalLabView.tsx"
click node_script_view "https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/components/PythonScriptLabView.tsx"
click node_script_data "https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/data/pythonScripts.ts"
click node_code_block "https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/components/PythonCodeBlock.tsx"
click node_entry "https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/main.tsx"

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_app,node_header,node_sidebar,node_entry toneBlue
class node_profile,node_sample,node_profiler_view,node_contract toneAmber
class node_stats_view toneMint
class node_script_view,node_script_data,node_code_block toneRose
class node_user toneIndigo
```

## Components

### Workspace orchestration

- [Workspace app](https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/App.tsx): `src/App.tsx`
- [Upload header](https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/components/TopHeader.tsx): `src/components/TopHeader.tsx`
- [Workspace navigation](https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/components/Sidebar.tsx): `src/components/Sidebar.tsx`
- [React entry](https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/main.tsx): `src/main.tsx`

### Dataset profiling

- [CSV profiler](https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/utils/csvProfiler.ts): `src/utils/csvProfiler.ts`
- [Sample generator](https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/data/samplePslData.ts): `src/data/samplePslData.ts`
- [Profile view](https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/components/CsvProfilerView.tsx): `src/components/CsvProfilerView.tsx`
- [Profile data types](https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/types/psl.ts): `src/types/psl.ts`

### Statistical analysis

- [Statistics view](https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/components/StatisticalLabView.tsx): `src/components/StatisticalLabView.tsx`

### Python script lab

- [Script lab](https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/components/PythonScriptLabView.tsx): `src/components/PythonScriptLabView.tsx`
- [Script catalog](https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/data/pythonScripts.ts): `src/data/pythonScripts.ts`
- [Code display](https://github.com/zahid0162/pitchlab-psl-analytics/blob/main/src/components/PythonCodeBlock.tsx): `src/components/PythonCodeBlock.tsx`

### Other components

- **Analyst**

## Connections

- Analyst → Upload header: uploads CSV (evidence: `src/components/TopHeader.tsx`)
- React entry → Workspace app: renders (evidence: `src/main.tsx`)
- Workspace app → Sample generator: builds sample (evidence: `src/App.tsx`)
- Workspace app → CSV profiler: profiles CSV (evidence: `src/App.tsx`)
- Workspace app → Upload header: renders (evidence: `src/App.tsx`)
- Workspace app → Workspace navigation: renders (evidence: `src/App.tsx`)
- Workspace app → Profile view: renders (evidence: `src/App.tsx`)
- Workspace app → Statistics view: renders (evidence: `src/App.tsx`)
- Workspace app → Script lab: renders (evidence: `src/App.tsx`)
- Workspace app → Script catalog: loads scripts (evidence: `src/App.tsx`)
- Script lab → Code display: renders (evidence: `src/components/PythonScriptLabView.tsx`)
- Workspace app → Profile view: passes profile (evidence: `src/App.tsx`)
- Workspace app → Statistics view: passes profile (evidence: `src/App.tsx`)
