# pwnagerobotics/scoutingpass architecture

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

- Interactive diagram: https://gitdiagram.com/pwnagerobotics/scoutingpass
- Repository: https://github.com/pwnagerobotics/scoutingpass

## Overview

1. **Overall shape**
   - This repository is a static, browser-based FRC scouting application.
   - The deployed app is served from GitHub Pages and runs entirely client-side; there is no backend service in this repo.
   - The architecture is centered on two entry pages: `index.html` for match scouting and `pit.html` for pit scouting.

2. **Core runtime boundary**
   - The app is plain HTML/JavaScript/CSS, designed to run on phones, tablets, laptops, and other devices with a modern browser.
   - Because everything is local to the page after load, the app can operate offline during events once the page and configuration are loaded.
   - Persistent external connectivity is only needed for optional integrations, not for basic scouting input.

3. **Primary UI subsystem**
   - `resources/js/scoutingPASS.js` is the main application logic for the match scouting flow.
   - `resources/css/scoutingPASS.css` provides the visual styling for the touch-friendly interface.
   - The UI is organized around multiple swipeable screens for a match: pre-match, autonomous, teleop, end game, and post-match.
   - The pit scouting page uses the same general interaction model but is reduced to a single form-like screen plus a QR output screen.

4. **Configuration-driven game model**
   - Season-specific configuration files in folders like `2025/` and `2026/` define what fields the scouts see and what data gets captured.
   - Examples include `2026/rebuilt_config.js` and `2026/rebuilt_pit_scouting.js`, with older seasons preserved under `archive/`.
   - This is the main abstraction boundary in the repo: the app logic is generic, while the season file defines the scouting schema.
   - The README indicates that only one configuration file should be imported at a time from `index.html`.

5. **Input component model**
   - The configuration supports several data element types: text, number, counter, radio buttons, checkbox, timer, cycle timer, and field-image/heatmap selection.
   - These element types are rendered dynamically by the JavaScript rather than being hardcoded per game.
   - This is what makes the app reusable across years: new FRC seasons are handled by swapping configuration, not rewriting the UI.

6. **Match data flow**
   - The scout enters data across the pages, and the app keeps state locally in the browser.
   - On the final screen, the app generates a QR code representing the collected match record.
   - The QR output is the handoff point to downstream systems: it can be scanned live into Excel or captured later from a screenshot/photo.

7. **Pit scouting flow**
   - `pit.html` is a separate entry point for pit scouting, backed by pit-specific configuration and JS.
   - The pit flow is simpler: one input page followed by QR generation.
   - The pit configuration lives alongside match configs, reflecting a separate but related data model.

8. **The Blue Alliance integration**
   - `resources/js/TBAInterface.js` handles optional integration with The Blue Alliance API.
   - This subsystem pulls event teams and schedule data using an API token configured in the JS file.
   - The data feeds back into the pre-match screen to auto-populate team numbers and names from match/robot selection, reducing manual entry errors.
   - This is an enrichment path only; the scouting app still functions without it.

9. **Google Sheets integration**
   - `resources/js/googleSheets.js` is the integration layer for sending scouting data to Google Sheets.
   - The docs in `docs/GoogleSheets.md` indicate this is an alternate or complementary destination for collected data.
   - This appears to be another export boundary from the client-side app into external storage/analysis tooling.

10. **Excel as the downstream analysis system**
   - The repository includes Excel workbooks and VBA/support material for parsing the QR payload into rows.
   - The main operational pattern described in the README is: scouts generate QR codes, a lead scout scans them into Excel, and the spreadsheet becomes the local scouting database.
   - The `tools/generate_test_data.py` script supports this workflow by generating sample data based on the configuration, likely for testing Excel parsing and heatmap workflows.

11. **Season history and maintenance**
   - The `archive/` tree contains prior-year configurations and examples, preserving compatibility knowledge and seasonal evolution.
   - This suggests the repo is intended to be reused and adapted year over year, with older schemas kept for reference rather than deleted.
   - The docs folder contains configuration and integration instructions, reinforcing that the main maintenance task is adapting the config layer.

12. **Hosting and CI**
   - The repo is designed for GitHub Pages deployment, which fits the static-site architecture.
   - A GitHub Actions workflow exists for CodeQL analysis, giving the repo basic security/static analysis coverage.
   - There is no evidence of build tooling or bundling; the app appears to be served as directly editable static assets.

13. **Architecture summary for diagramming**
   - The cleanest diagram is: browser UI at the center, season config files feeding the UI, optional TBA and Google Sheets integrations as external services, and QR/Excel as the primary export path.
   - Separate the match-scouting page and pit-scouting page as two entry points sharing the same general client-side architecture but different configs and layouts.
   - The repo’s main boundary is not server vs client; it is generic app logic vs season-specific configuration and downstream data consumers.

Main entry points: [`resources/js/scoutingPASS.js`](https://github.com/pwnagerobotics/scoutingpass/blob/main/resources/js/scoutingPASS.js) (Scout app), [`2026/rebuilt_config.js`](https://github.com/pwnagerobotics/scoutingpass/blob/main/2026/rebuilt_config.js) (2026 config), [`resources/js/googleSheets.js`](https://github.com/pwnagerobotics/scoutingpass/blob/main/resources/js/googleSheets.js) (Sheets bridge), [`README.md`](https://github.com/pwnagerobotics/scoutingpass/blob/main/README.md) (README)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client app"]
  node_index["Match page<br/>entry HTML<br/>[index.html]"]
  node_pit["Pit page<br/>entry HTML<br/>[pit.html]"]
  node_scouting_js["Scout app<br/>client JS<br/>[scoutingPASS.js]"]
  node_scouting_css["App styles<br/>client CSS<br/>[scoutingPASS.css]"]
end

subgraph group_seasons["Season configs"]
  node_reefscape_cfg["2025 config<br/>season config"]
  node_reefscape_pit["2025 pit config<br/>season pit config"]
  node_rebuilt_cfg["2026 config<br/>season config<br/>[rebuilt_config.js]"]
  node_rebuilt_pit["2026 pit config<br/>season pit config"]
  node_archive["Archive<br/>season history"]
end

subgraph group_integrations["Integrations"]
  node_tba_js["TBA bridge<br/>integration JS<br/>[TBAInterface.js]"]
  node_sheets_js["Sheets bridge<br/>integration JS<br/>[googleSheets.js]"]
  node_excel_workbook["Excel workbook<br/>analysis workbook"]
end

subgraph group_ops["Ops and docs"]
  node_docs_config["Config guide<br/>docs<br/>[Configuration.md]"]
  node_docs_sheets["Sheets guide<br/>docs<br/>[GoogleSheets.md]"]
  node_tools_gen["Test data<br/>python tool"]
  node_readme["README<br/>docs<br/>[README.md]"]
  node_codeql["CodeQL<br/>ci workflow"]
end

node_index -->|"loads"| node_scouting_js
node_pit -->|"loads"| node_scouting_js
node_scouting_js -->|"styled by"| node_scouting_css
node_scouting_js -->|"driven by"| node_rebuilt_cfg
node_scouting_js -->|"driven by"| node_rebuilt_pit
node_scouting_js -->|"optional lookup"| node_tba_js
node_scouting_js -->|"optional export"| node_sheets_js
node_scouting_js -->|"QR handoff"| node_excel_workbook
node_tba_js -->|"fills pre-match"| node_scouting_js
node_sheets_js -->|"complements"| node_excel_workbook
node_rebuilt_cfg -->|"evolves from"| node_archive
node_rebuilt_pit -->|"evolves from"| node_archive
node_docs_config -->|"explains"| node_rebuilt_cfg
node_docs_sheets -->|"documents"| node_sheets_js
node_tools_gen -->|"generates from"| node_rebuilt_cfg
node_readme -->|"starts at"| node_index
node_readme -->|"includes"| node_pit
node_codeql -->|"analyzes"| node_scouting_js

click node_index "https://github.com/pwnagerobotics/scoutingpass/blob/main/index.html"
click node_pit "https://github.com/pwnagerobotics/scoutingpass/blob/main/pit.html"
click node_scouting_js "https://github.com/pwnagerobotics/scoutingpass/blob/main/resources/js/scoutingPASS.js"
click node_scouting_css "https://github.com/pwnagerobotics/scoutingpass/blob/main/resources/css/scoutingPASS.css"
click node_tba_js "https://github.com/pwnagerobotics/scoutingpass/blob/main/resources/js/TBAInterface.js"
click node_sheets_js "https://github.com/pwnagerobotics/scoutingpass/blob/main/resources/js/googleSheets.js"
click node_reefscape_cfg "https://github.com/pwnagerobotics/scoutingpass/blob/main/2025/reefscape_config.js"
click node_reefscape_pit "https://github.com/pwnagerobotics/scoutingpass/blob/main/2025/reefscape_pit_scouting.js"
click node_rebuilt_cfg "https://github.com/pwnagerobotics/scoutingpass/blob/main/2026/rebuilt_config.js"
click node_rebuilt_pit "https://github.com/pwnagerobotics/scoutingpass/blob/main/2026/rebuilt_pit_scouting.js"
click node_archive "https://github.com/pwnagerobotics/scoutingpass/tree/main/archive"
click node_excel_workbook "https://github.com/pwnagerobotics/scoutingpass/blob/main/2026/REBUIT_Test_Data_with_Heat_Map.xlsm"
click node_docs_config "https://github.com/pwnagerobotics/scoutingpass/blob/main/docs/Configuration.md"
click node_docs_sheets "https://github.com/pwnagerobotics/scoutingpass/blob/main/docs/GoogleSheets.md"
click node_tools_gen "https://github.com/pwnagerobotics/scoutingpass/blob/main/tools/generate_test_data.py"
click node_readme "https://github.com/pwnagerobotics/scoutingpass/blob/main/README.md"
click node_codeql "https://github.com/pwnagerobotics/scoutingpass/blob/main/.github/workflows/codeql-analysis.yml"

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,node_pit,node_scouting_js,node_scouting_css toneBlue
class node_reefscape_cfg,node_reefscape_pit,node_rebuilt_cfg,node_rebuilt_pit,node_archive toneAmber
class node_tba_js,node_sheets_js,node_excel_workbook toneMint
class node_docs_config,node_docs_sheets,node_tools_gen,node_readme,node_codeql toneRose
```

## Components

### Client app

Browser-based scouting UI and runtime

- [Match page](https://github.com/pwnagerobotics/scoutingpass/blob/main/index.html): entry HTML · Main match scouting entry point · `index.html`
- [Pit page](https://github.com/pwnagerobotics/scoutingpass/blob/main/pit.html): entry HTML · Pit scouting entry point · `pit.html`
- [Scout app](https://github.com/pwnagerobotics/scoutingpass/blob/main/resources/js/scoutingPASS.js): client JS · Primary scouting flow, state, and screen logic · `resources/js/scoutingPASS.js`
- [App styles](https://github.com/pwnagerobotics/scoutingpass/blob/main/resources/css/scoutingPASS.css): client CSS · Touch-friendly layout and visual styling · `resources/css/scoutingPASS.css`

### Season configs

Game-specific schema and pit/match definitions

- [2025 config](https://github.com/pwnagerobotics/scoutingpass/blob/main/2025/reefscape_config.js): season config · Season-specific match scouting schema · `2025/reefscape_config.js`
- [2025 pit config](https://github.com/pwnagerobotics/scoutingpass/blob/main/2025/reefscape_pit_scouting.js): season pit config · Season-specific pit scouting schema · `2025/reefscape_pit_scouting.js`
- [2026 config](https://github.com/pwnagerobotics/scoutingpass/blob/main/2026/rebuilt_config.js): season config · Current match scouting schema · `2026/rebuilt_config.js`
- [2026 pit config](https://github.com/pwnagerobotics/scoutingpass/blob/main/2026/rebuilt_pit_scouting.js): season pit config · Current pit scouting schema · `2026/rebuilt_pit_scouting.js`
- [Archive](https://github.com/pwnagerobotics/scoutingpass/tree/main/archive): season history · Prior-year configs and examples · `archive`

### Integrations

Optional external data and export paths

- [TBA bridge](https://github.com/pwnagerobotics/scoutingpass/blob/main/resources/js/TBAInterface.js): integration JS · Optional Blue Alliance event, team, and schedule lookup · `resources/js/TBAInterface.js`
- [Sheets bridge](https://github.com/pwnagerobotics/scoutingpass/blob/main/resources/js/googleSheets.js): integration JS · Optional Google Sheets export integration · `resources/js/googleSheets.js`
- [Excel workbook](https://github.com/pwnagerobotics/scoutingpass/blob/main/2026/REBUIT_Test_Data_with_Heat_Map.xlsm): analysis workbook · QR parsing and heatmap support in spreadsheet form · `2026/REBUIT_Test_Data_with_Heat_Map.xlsm`

### Ops and docs

Supporting docs, tooling, and repository maintenance

- [Config guide](https://github.com/pwnagerobotics/scoutingpass/blob/main/docs/Configuration.md): docs · Repository guidance for configuration and usage · `docs/Configuration.md`
- [Sheets guide](https://github.com/pwnagerobotics/scoutingpass/blob/main/docs/GoogleSheets.md): docs · Documentation for Google Sheets export · `docs/GoogleSheets.md`
- [Test data](https://github.com/pwnagerobotics/scoutingpass/blob/main/tools/generate_test_data.py): python tool · Generates sample data from season configuration · `tools/generate_test_data.py`
- [README](https://github.com/pwnagerobotics/scoutingpass/blob/main/README.md): docs · Top-level usage and workflow overview · `README.md`
- [CodeQL](https://github.com/pwnagerobotics/scoutingpass/blob/main/.github/workflows/codeql-analysis.yml): ci workflow · Repository static analysis workflow · `.github/workflows/codeql-analysis.yml`

## Connections

- Match page → Scout app: loads · Match entry bootstraps the main client logic
- Pit page → Scout app: loads · Pit entry reuses the shared client runtime
- Scout app → App styles: styled by · Main UI is rendered with the shared stylesheet
- Scout app → 2026 config: driven by · Active match UI schema comes from season config
- Scout app → 2026 pit config: driven by · Pit flow uses the pit-specific season schema
- Scout app → TBA bridge: optional lookup · Pre-match screen can enrich team and match data
- Scout app → Sheets bridge: optional export · Collected records can be sent to Google Sheets
- Scout app → Excel workbook: QR handoff · Final QR payload is consumed by spreadsheet workflows
- TBA bridge → Scout app: fills pre-match · Imported event data reduces manual entry
- Sheets bridge → Excel workbook: complements · Alternate downstream storage and analysis path
- 2026 config → Archive: evolves from · Current season config sits alongside prior-year examples
- 2026 pit config → Archive: evolves from · Current pit schema is informed by archived seasons
- Config guide → 2026 config: explains · Configuration docs describe the season schema boundary
- Sheets guide → Sheets bridge: documents · Docs explain the Sheets export integration
- Test data → 2026 config: generates from · Test data is produced from the current season schema
- README → Match page: starts at · Top-level usage points users to the match app
- README → Pit page: includes · Repository overview also covers the pit entry
- CodeQL → Scout app: analyzes · Workflow provides static analysis coverage for client code
