# p7pami/insightp7 architecture

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

- Interactive diagram: https://gitdiagram.com/p7pami/insightp7
- Repository: https://github.com/p7pami/insightp7

## Overview

INSIGHT is a browser-based workforce and performance dashboard, with modules for daily sales tracking, staffing, employee profiles, training, and recognition. The visible workflow is module-specific: users work with a dashboard, which computes or displays results and, in sampled modules, reads or writes Supabase data. The tree and source index identify additional substantial product areas, but their internal behavior and connections are not shown. The README is empty, so those areas are represented without inferred call chains.

Main entry points: [`insight/shared/smeny.js`](https://github.com/p7pami/insightp7/blob/main/insight/shared/smeny.js) (Shift-cycle logic), [`insight/brigo/brigadnici.js`](https://github.com/p7pami/insightp7/blob/main/insight/brigo/brigadnici.js) (Brigádníci dashboard), [`insight/denni-report/denni-report.js`](https://github.com/p7pami/insightp7/blob/main/insight/denni-report/denni-report.js) (Daily sales report), [`insight/denni-tgt/denni-tgt.js`](https://github.com/p7pami/insightp7/blob/main/insight/denni-tgt/denni-tgt.js) (Daily TGT)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workforce["Staffing and people"]
  node_brigo["Brigádníci dashboard<br/>[brigadnici.js]"]
  node_brigo_logic["Worker utilities<br/>[logic.mjs]"]
  node_dochazka["Attendance rows<br/>[rows.js]"]
  node_obedy["Lunch planner<br/>[obedy.js]"]
  node_hr["HR dashboard<br/>[hr.js]"]
end

subgraph group_performance["Performance tracking"]
  node_denni_report["Daily sales report<br/>[denni-report.js]"]
  node_denni_tgt["Daily TGT<br/>[denni-tgt.js]"]
  node_tgt_report["Individual TGT report<br/>[report.js]"]
  node_vyvoj["Performance development<br/>[vyvoj.js]"]
end

subgraph group_employee["Employee experience"]
  node_achievement_engine["Achievement engine<br/>[achievementy.js]"]
  node_achievement_defs["Achievement definitions<br/>[definice.js]"]
  node_profil["Employee profile<br/>[profil.js]"]
  node_trenink["Individual training<br/>[trenink.js]"]
  node_aktivita["Activity dashboard<br/>[aktivita.js]"]
  node_souteze["Competitions<br/>[souteze.js]"]
end

subgraph group_shared["Shared logic"]
  node_smeny["Shift-cycle logic<br/>[smeny.js]"]
end

node_supabase[("Supabase data store")]
node_google_sheets["Google Sheets"]

node_brigo -->|"uses helpers"| node_brigo_logic
node_brigo -->|"imports spreadsheet"| node_google_sheets
node_denni_report -->|"uses shift cycle"| node_smeny
node_profil -->|"uses shift labels"| node_smeny
node_trenink -->|"groups shift days"| node_smeny
node_denni_tgt -->|"loads report"| node_tgt_report
node_achievement_engine -->|"evaluates definitions"| node_achievement_defs
node_denni_report -->|"writes sales rows"| node_supabase
node_denni_tgt -->|"reads profiles"| node_supabase
node_tgt_report -->|"stores training"| node_supabase
node_vyvoj -->|"stores snapshots"| node_supabase
node_obedy -->|"saves color settings"| node_supabase
node_profil -->|"reads activity"| node_supabase

click node_brigo "https://github.com/p7pami/insightp7/blob/main/insight/brigo/brigadnici.js"
click node_brigo_logic "https://github.com/p7pami/insightp7/blob/main/insight/brigo/logic.mjs"
click node_dochazka "https://github.com/p7pami/insightp7/blob/main/insight/dochazka/rows.js"
click node_obedy "https://github.com/p7pami/insightp7/blob/main/insight/obedy/obedy.js"
click node_hr "https://github.com/p7pami/insightp7/blob/main/insight/hr/hr.js"
click node_denni_report "https://github.com/p7pami/insightp7/blob/main/insight/denni-report/denni-report.js"
click node_denni_tgt "https://github.com/p7pami/insightp7/blob/main/insight/denni-tgt/denni-tgt.js"
click node_tgt_report "https://github.com/p7pami/insightp7/blob/main/insight/denni-tgt/report.js"
click node_vyvoj "https://github.com/p7pami/insightp7/blob/main/insight/vyvoj-plneni/vyvoj.js"
click node_achievement_engine "https://github.com/p7pami/insightp7/blob/main/insight/achievementy/achievementy.js"
click node_achievement_defs "https://github.com/p7pami/insightp7/blob/main/insight/achievementy/definice.js"
click node_profil "https://github.com/p7pami/insightp7/blob/main/insight/profil/profil.js"
click node_trenink "https://github.com/p7pami/insightp7/blob/main/insight/trenink/trenink.js"
click node_aktivita "https://github.com/p7pami/insightp7/blob/main/insight/aktivita/aktivita.js"
click node_souteze "https://github.com/p7pami/insightp7/blob/main/insight/souteze/souteze.js"
click node_smeny "https://github.com/p7pami/insightp7/blob/main/insight/shared/smeny.js"

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_brigo,node_brigo_logic,node_dochazka,node_obedy,node_hr toneBlue
class node_denni_report,node_denni_tgt,node_tgt_report,node_vyvoj,node_supabase toneAmber
class node_achievement_engine,node_achievement_defs,node_profil,node_trenink,node_aktivita,node_souteze toneMint
class node_smeny toneRose
class node_google_sheets toneIndigo
```

## Components

### Staffing and people

- [Brigádníci dashboard](https://github.com/p7pami/insightp7/blob/main/insight/brigo/brigadnici.js): `insight/brigo/brigadnici.js`
- [Worker utilities](https://github.com/p7pami/insightp7/blob/main/insight/brigo/logic.mjs): `insight/brigo/logic.mjs`
- [Attendance rows](https://github.com/p7pami/insightp7/blob/main/insight/dochazka/rows.js): `insight/dochazka/rows.js`
- [Lunch planner](https://github.com/p7pami/insightp7/blob/main/insight/obedy/obedy.js): `insight/obedy/obedy.js`
- [HR dashboard](https://github.com/p7pami/insightp7/blob/main/insight/hr/hr.js): `insight/hr/hr.js`

### Performance tracking

- [Daily sales report](https://github.com/p7pami/insightp7/blob/main/insight/denni-report/denni-report.js): `insight/denni-report/denni-report.js`
- [Daily TGT](https://github.com/p7pami/insightp7/blob/main/insight/denni-tgt/denni-tgt.js): `insight/denni-tgt/denni-tgt.js`
- [Individual TGT report](https://github.com/p7pami/insightp7/blob/main/insight/denni-tgt/report.js): `insight/denni-tgt/report.js`
- [Performance development](https://github.com/p7pami/insightp7/blob/main/insight/vyvoj-plneni/vyvoj.js): `insight/vyvoj-plneni/vyvoj.js`

### Employee experience

- [Achievement engine](https://github.com/p7pami/insightp7/blob/main/insight/achievementy/achievementy.js): `insight/achievementy/achievementy.js`
- [Achievement definitions](https://github.com/p7pami/insightp7/blob/main/insight/achievementy/definice.js): `insight/achievementy/definice.js`
- [Employee profile](https://github.com/p7pami/insightp7/blob/main/insight/profil/profil.js): `insight/profil/profil.js`
- [Individual training](https://github.com/p7pami/insightp7/blob/main/insight/trenink/trenink.js): `insight/trenink/trenink.js`
- [Activity dashboard](https://github.com/p7pami/insightp7/blob/main/insight/aktivita/aktivita.js): `insight/aktivita/aktivita.js`
- [Competitions](https://github.com/p7pami/insightp7/blob/main/insight/souteze/souteze.js): `insight/souteze/souteze.js`

### Shared logic

- [Shift-cycle logic](https://github.com/p7pami/insightp7/blob/main/insight/shared/smeny.js): `insight/shared/smeny.js`

### Other components

- **Supabase data store**
- **Google Sheets**

## Connections

- Brigádníci dashboard → Worker utilities: uses helpers (evidence: `insight/brigo/brigadnici.js`)
- Brigádníci dashboard → Google Sheets: imports spreadsheet (evidence: `insight/brigo/brigadnici.js`)
- Daily sales report → Shift-cycle logic: uses shift cycle (evidence: `insight/shared/smeny.js`)
- Employee profile → Shift-cycle logic: uses shift labels (evidence: `insight/profil/profil.js`)
- Individual training → Shift-cycle logic: groups shift days (evidence: `insight/trenink/trenink.js`)
- Daily TGT → Individual TGT report: loads report (evidence: `insight/denni-tgt/denni-tgt.js`)
- Achievement engine → Achievement definitions: evaluates definitions (evidence: `insight/achievementy/achievementy.js`)
- Daily sales report → Supabase data store: writes sales rows (evidence: `insight/denni-report/denni-report.js`)
- Daily TGT → Supabase data store: reads profiles (evidence: `insight/denni-tgt/denni-tgt.js`)
- Individual TGT report → Supabase data store: stores training (evidence: `insight/denni-tgt/report.js`)
- Performance development → Supabase data store: stores snapshots (evidence: `insight/vyvoj-plneni/vyvoj.js`)
- Lunch planner → Supabase data store: saves color settings (evidence: `insight/obedy/obedy.js`)
- Employee profile → Supabase data store: reads activity (evidence: `insight/profil/profil.js`)
