# streetoh/player_stats architecture

> Architecture diagram of the GitHub repository streetoh/player_stats, 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/streetoh/player_stats
- Repository: https://github.com/streetoh/player_stats

## Overview

PlayerStats is a football team-management and player-statistics product, with coach and player portals plus an independent tracker. The apparent workflow is recording team activity and session statistics, then reviewing player performance and coordinating through features such as chat and convocations. The tree also shows local/cloud data modules, skill calculations, and Android packaging of the web app. The README is empty and most web entry points were not excerpted, so relationships among those subsystems are left unasserted; shown links are limited to explicit references in the available excerpts.

Main entry points: [`sw_tracker.js`](https://github.com/streetoh/player_stats/blob/main/sw_tracker.js) (Tracker offline cache), [`android-build/src/com/jknoova/playerstats/BackgroundNotificationService.java`](https://github.com/streetoh/player_stats/blob/main/android-build/src/com/jknoova/playerstats/BackgroundNotificationService.java) (Background notifications), [`js/cloud.js`](https://github.com/streetoh/player_stats/blob/main/js/cloud.js) (Cloud data), [`js/chat.js`](https://github.com/streetoh/player_stats/blob/main/js/chat.js) (Live chat)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web portals"]
  node_coach_ui["Coach portal<br/>[index.html]"]
  node_player_ui["Player portal<br/>[jugadores.html]"]
  node_tracker_ui["Independent tracker<br/>[tracker.html]"]
  node_convocations["Convocations<br/>[convocatoria.html]"]
  node_app_runtime["App runtime<br/>[app.js]"]
  node_player_runtime["Player runtime<br/>[player-app.js]"]
  node_service_worker["Tracker offline cache<br/>[sw_tracker.js]"]
end

subgraph group_data["Data and analytics"]
  node_local_store[("Local state<br/>[store.js]")]
  node_cloud_data["Cloud data<br/>[cloud.js]"]
  node_sync["Synchronization<br/>[sync.js]"]
  node_io["Data import/export<br/>[io.js]"]
  node_skills["Skill ratings<br/>[skills-engine.js]"]
  node_player_cards["Player cards<br/>[fut-card.js]"]
  node_firebase_app["Firebase compat"]
  node_firestore["Firestore compat"]
end

subgraph group_team["Team collaboration"]
  node_chat["Live chat<br/>[chat.js]"]
  node_localization["Localization<br/>[i18n.js]"]
  node_icons["Icon library<br/>[icons.js]"]
end

subgraph group_native["Android app"]
  node_android_activity["WebView host<br/>[MainActivity.java]"]
  node_notifications["Background notifications"]
  node_boot_receiver["Boot receiver<br/>[BootReceiver.java]"]
end

node_coach(("Coach"))
node_player(("Player"))

node_chat -->|"creates chats"| node_cloud_data
node_boot_receiver -->|"starts service"| node_notifications
node_notifications -->|"opens app"| node_android_activity
node_service_worker -->|"caches page"| node_tracker_ui
node_service_worker -->|"caches script"| node_firebase_app
node_service_worker -->|"caches script"| node_firestore
node_service_worker -->|"caches script"| node_cloud_data

click node_coach_ui "https://github.com/streetoh/player_stats/blob/main/index.html"
click node_player_ui "https://github.com/streetoh/player_stats/blob/main/jugadores.html"
click node_tracker_ui "https://github.com/streetoh/player_stats/blob/main/tracker.html"
click node_convocations "https://github.com/streetoh/player_stats/blob/main/convocatoria.html"
click node_app_runtime "https://github.com/streetoh/player_stats/blob/main/js/app.js"
click node_player_runtime "https://github.com/streetoh/player_stats/blob/main/js/player-app.js"
click node_local_store "https://github.com/streetoh/player_stats/blob/main/js/store.js"
click node_cloud_data "https://github.com/streetoh/player_stats/blob/main/js/cloud.js"
click node_sync "https://github.com/streetoh/player_stats/blob/main/js/sync.js"
click node_io "https://github.com/streetoh/player_stats/blob/main/js/io.js"
click node_skills "https://github.com/streetoh/player_stats/blob/main/js/skills-engine.js"
click node_player_cards "https://github.com/streetoh/player_stats/blob/main/js/fut-card.js"
click node_chat "https://github.com/streetoh/player_stats/blob/main/js/chat.js"
click node_localization "https://github.com/streetoh/player_stats/blob/main/js/i18n.js"
click node_icons "https://github.com/streetoh/player_stats/blob/main/js/icons.js"
click node_service_worker "https://github.com/streetoh/player_stats/blob/main/sw_tracker.js"
click node_firebase_app "https://github.com/streetoh/player_stats/blob/main/js/firebase-app-compat.js"
click node_firestore "https://github.com/streetoh/player_stats/blob/main/js/firebase-firestore-compat.js"
click node_android_activity "https://github.com/streetoh/player_stats/blob/main/android-build/src/com/jknoova/playerstats/MainActivity.java"
click node_notifications "https://github.com/streetoh/player_stats/blob/main/android-build/src/com/jknoova/playerstats/BackgroundNotificationService.java"
click node_boot_receiver "https://github.com/streetoh/player_stats/blob/main/android-build/src/com/jknoova/playerstats/BootReceiver.java"

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_coach_ui,node_player_ui,node_tracker_ui,node_convocations,node_app_runtime,node_player_runtime,node_service_worker toneBlue
class node_local_store,node_cloud_data,node_sync,node_io,node_skills,node_player_cards,node_firebase_app,node_firestore toneAmber
class node_chat,node_localization,node_icons toneMint
class node_android_activity,node_notifications,node_boot_receiver toneRose
class node_coach,node_player toneIndigo
```

## Components

### Web portals

- [Coach portal](https://github.com/streetoh/player_stats/blob/main/index.html): `index.html`
- [Player portal](https://github.com/streetoh/player_stats/blob/main/jugadores.html): `jugadores.html`
- [Independent tracker](https://github.com/streetoh/player_stats/blob/main/tracker.html): `tracker.html`
- [Convocations](https://github.com/streetoh/player_stats/blob/main/convocatoria.html): `convocatoria.html`
- [App runtime](https://github.com/streetoh/player_stats/blob/main/js/app.js): `js/app.js`
- [Player runtime](https://github.com/streetoh/player_stats/blob/main/js/player-app.js): `js/player-app.js`
- [Tracker offline cache](https://github.com/streetoh/player_stats/blob/main/sw_tracker.js): `sw_tracker.js`

### Data and analytics

- [Local state](https://github.com/streetoh/player_stats/blob/main/js/store.js): `js/store.js`
- [Cloud data](https://github.com/streetoh/player_stats/blob/main/js/cloud.js): `js/cloud.js`
- [Synchronization](https://github.com/streetoh/player_stats/blob/main/js/sync.js): `js/sync.js`
- [Data import/export](https://github.com/streetoh/player_stats/blob/main/js/io.js): `js/io.js`
- [Skill ratings](https://github.com/streetoh/player_stats/blob/main/js/skills-engine.js): `js/skills-engine.js`
- [Player cards](https://github.com/streetoh/player_stats/blob/main/js/fut-card.js): `js/fut-card.js`
- [Firebase compat](https://github.com/streetoh/player_stats/blob/main/js/firebase-app-compat.js): `js/firebase-app-compat.js`
- [Firestore compat](https://github.com/streetoh/player_stats/blob/main/js/firebase-firestore-compat.js): `js/firebase-firestore-compat.js`

### Team collaboration

- [Live chat](https://github.com/streetoh/player_stats/blob/main/js/chat.js): `js/chat.js`
- [Localization](https://github.com/streetoh/player_stats/blob/main/js/i18n.js): `js/i18n.js`
- [Icon library](https://github.com/streetoh/player_stats/blob/main/js/icons.js): `js/icons.js`

### Android app

- [WebView host](https://github.com/streetoh/player_stats/blob/main/android-build/src/com/jknoova/playerstats/MainActivity.java): `android-build/src/com/jknoova/playerstats/MainActivity.java`
- [Background notifications](https://github.com/streetoh/player_stats/blob/main/android-build/src/com/jknoova/playerstats/BackgroundNotificationService.java): `android-build/src/com/jknoova/playerstats/BackgroundNotificationService.java`
- [Boot receiver](https://github.com/streetoh/player_stats/blob/main/android-build/src/com/jknoova/playerstats/BootReceiver.java): `android-build/src/com/jknoova/playerstats/BootReceiver.java`

### Other components

- **Coach**
- **Player**

## Connections

- Live chat → Cloud data: creates chats (evidence: `js/chat.js`)
- Boot receiver → Background notifications: starts service (evidence: `android-build/src/com/jknoova/playerstats/BootReceiver.java`)
- Background notifications → WebView host: opens app (evidence: `android-build/src/com/jknoova/playerstats/BackgroundNotificationService.java`)
- Tracker offline cache → Independent tracker: caches page (evidence: `sw_tracker.js`)
- Tracker offline cache → Firebase compat: caches script (evidence: `sw_tracker.js`)
- Tracker offline cache → Firestore compat: caches script (evidence: `sw_tracker.js`)
- Tracker offline cache → Cloud data: caches script (evidence: `sw_tracker.js`)
