# enrico-favale/pagellometro architecture

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

- Interactive diagram: https://gitdiagram.com/enrico-favale/pagellometro
- Repository: https://github.com/enrico-favale/pagellometro

## Overview

Pagellometro is a React sports-competition app. Its visible workflow routes users through authentication and protected pages to create or manage competitions, add participants and matches, and view or edit match details; profile management is a separate branch. The supplied README is the default Vite template, so product capabilities are inferred from the source tree and sampled code. Several pages and hooks are unsampled; their existence is clear, but uncertain internal calls are omitted.

Main entry points: [`src/components/auth/ProtectedRoute.jsx`](https://github.com/enrico-favale/pagellometro/blob/main/src/components/auth/ProtectedRoute.jsx) (Route Guard), [`src/hooks/useAuth.js`](https://github.com/enrico-favale/pagellometro/blob/main/src/hooks/useAuth.js) (Auth Hook), [`src/services/supabaseClient.js`](https://github.com/enrico-favale/pagellometro/blob/main/src/services/supabaseClient.js) (Supabase Client), [`src/App.jsx`](https://github.com/enrico-favale/pagellometro/blob/main/src/App.jsx) (Route Table)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["App Routing"]
  node_app["Route Table<br/>[App.jsx]"]
  node_protected["Route Guard<br/>[ProtectedRoute.jsx]"]
  node_home["Home Page<br/>[HomePage.jsx]"]
  node_button["App Button<br/>[AppButton.jsx]"]
  node_logo["App Logo<br/>[AppLogo.jsx]"]
end

subgraph group_identity["Identity &amp; Profile"]
  node_authpages["Login &amp; Register<br/>[LoginPage.jsx]"]
  node_register["Registration<br/>[RegisterPage.jsx]"]
  node_authcallback["Auth Callback"]
  node_authcontext["Auth Provider<br/>[AuthContext.jsx]"]
  node_authhook["Auth Hook<br/>[useAuth.js]"]
  node_authui["Auth UI"]
  node_authshell["Auth Shell<br/>[AuthShell.jsx]"]
  node_profile["Profile Page<br/>[ProfilePage.jsx]"]
  node_avatar["Avatar Button"]
  node_client["Supabase Client<br/>[supabaseClient.js]"]
  node_divider["Auth Divider<br/>[AuthDivider.jsx]"]
end

subgraph group_competition["Competition Management"]
  node_dashboard["Dashboard<br/>[DashboardPage.jsx]"]
  node_createcompetition["Create Competition"]
  node_creationhook["Creation Logic"]
  node_managecompetition["Manage Competition"]
  node_managementhook["Management Logic"]
end

subgraph group_matches["Match Records"]
  node_matchdetails["Match Details"]
  node_editmatch["Edit Match<br/>[EditMatchPage.jsx]"]
  node_matchhooks["Match Data Hooks<br/>[useMatchDetails.js]"]
  node_edithook["Match Edit Hook<br/>[useMatchEdit.js]"]
end

node_visitor(("Visitor"))
node_supabase[("Supabase")]

node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_authpages
node_app -->|"routes to"| node_register
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_authcallback
node_app -->|"guards routes"| node_protected
node_protected -->|"renders"| node_dashboard
node_protected -->|"renders"| node_createcompetition
node_protected -->|"renders"| node_managecompetition
node_protected -->|"renders"| node_matchdetails
node_protected -->|"renders"| node_editmatch
node_protected -->|"checks auth"| node_authhook
node_authpages -->|"uses auth"| node_authhook
node_register -->|"uses auth"| node_authhook
node_authpages -->|"renders"| node_authui
node_register -->|"renders"| node_authui
node_authpages -->|"renders"| node_authshell
node_register -->|"renders"| node_authshell
node_authpages -->|"renders"| node_divider
node_register -->|"renders"| node_divider
node_authshell -->|"renders"| node_logo
node_authhook -->|"reads context"| node_authcontext
node_authcontext -->|"calls auth and data APIs"| node_client
node_authcallback -->|"checks session"| node_client
node_profile -->|"uses auth"| node_authhook
node_profile -->|"renders"| node_avatar
node_dashboard -->|"uses auth"| node_authhook
node_dashboard -->|"renders"| node_button
node_dashboard -->|"renders"| node_logo
node_dashboard -->|"loads competitions via hook"| node_client
node_createcompetition -->|"uses auth"| node_authhook
node_createcompetition -->|"uses creation logic"| node_creationhook
node_managecompetition -->|"uses auth"| node_authhook
node_managecompetition -->|"calls management logic"| node_managementhook
node_managementhook -->|"queries and writes"| node_client
node_creationhook -->|"uses data API"| node_client
node_matchdetails -->|"uses match data"| node_matchhooks
node_editmatch -->|"uses edit logic"| node_edithook
node_matchhooks -->|"uses data API"| node_client
node_edithook -->|"uses data API"| node_client
node_client -->|"creates client"| node_supabase

click node_app "https://github.com/enrico-favale/pagellometro/blob/main/src/App.jsx"
click node_protected "https://github.com/enrico-favale/pagellometro/blob/main/src/components/auth/ProtectedRoute.jsx"
click node_home "https://github.com/enrico-favale/pagellometro/blob/main/src/pages/HomePage.jsx"
click node_authpages "https://github.com/enrico-favale/pagellometro/blob/main/src/pages/LoginPage.jsx"
click node_register "https://github.com/enrico-favale/pagellometro/blob/main/src/pages/RegisterPage.jsx"
click node_authcallback "https://github.com/enrico-favale/pagellometro/blob/main/src/pages/AuthCallbackPage.jsx"
click node_authcontext "https://github.com/enrico-favale/pagellometro/blob/main/src/context/AuthContext.jsx"
click node_authhook "https://github.com/enrico-favale/pagellometro/blob/main/src/hooks/useAuth.js"
click node_authui "https://github.com/enrico-favale/pagellometro/blob/main/src/components/auth/GoogleAuthButton.jsx"
click node_authshell "https://github.com/enrico-favale/pagellometro/blob/main/src/components/layout/AuthShell.jsx"
click node_profile "https://github.com/enrico-favale/pagellometro/blob/main/src/pages/ProfilePage.jsx"
click node_avatar "https://github.com/enrico-favale/pagellometro/blob/main/src/components/profile/ProfileAvatarButton.jsx"
click node_dashboard "https://github.com/enrico-favale/pagellometro/blob/main/src/pages/DashboardPage.jsx"
click node_createcompetition "https://github.com/enrico-favale/pagellometro/blob/main/src/pages/NewCompetitionPage.jsx"
click node_creationhook "https://github.com/enrico-favale/pagellometro/blob/main/src/hooks/useCompetitionCreation.js"
click node_managecompetition "https://github.com/enrico-favale/pagellometro/blob/main/src/pages/ManageCompetitionPage.jsx"
click node_managementhook "https://github.com/enrico-favale/pagellometro/blob/main/src/hooks/useCompetitionManagement.js"
click node_matchdetails "https://github.com/enrico-favale/pagellometro/blob/main/src/pages/MatchDetailsPage.jsx"
click node_editmatch "https://github.com/enrico-favale/pagellometro/blob/main/src/pages/EditMatchPage.jsx"
click node_matchhooks "https://github.com/enrico-favale/pagellometro/blob/main/src/hooks/useMatchDetails.js"
click node_edithook "https://github.com/enrico-favale/pagellometro/blob/main/src/hooks/useMatchEdit.js"
click node_client "https://github.com/enrico-favale/pagellometro/blob/main/src/services/supabaseClient.js"
click node_button "https://github.com/enrico-favale/pagellometro/blob/main/src/components/ui/AppButton.jsx"
click node_logo "https://github.com/enrico-favale/pagellometro/blob/main/src/components/ui/AppLogo.jsx"
click node_divider "https://github.com/enrico-favale/pagellometro/blob/main/src/components/auth/AuthDivider.jsx"

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_protected,node_home,node_button,node_logo toneBlue
class node_authpages,node_register,node_authcallback,node_authcontext,node_authhook,node_authui,node_authshell,node_profile,node_avatar,node_client,node_divider,node_supabase toneAmber
class node_dashboard,node_createcompetition,node_creationhook,node_managecompetition,node_managementhook toneMint
class node_matchdetails,node_editmatch,node_matchhooks,node_edithook toneRose
class node_visitor toneIndigo
```

## Components

### App Routing

- [Route Table](https://github.com/enrico-favale/pagellometro/blob/main/src/App.jsx): `src/App.jsx`
- [Route Guard](https://github.com/enrico-favale/pagellometro/blob/main/src/components/auth/ProtectedRoute.jsx): `src/components/auth/ProtectedRoute.jsx`
- [Home Page](https://github.com/enrico-favale/pagellometro/blob/main/src/pages/HomePage.jsx): `src/pages/HomePage.jsx`
- [App Button](https://github.com/enrico-favale/pagellometro/blob/main/src/components/ui/AppButton.jsx): `src/components/ui/AppButton.jsx`
- [App Logo](https://github.com/enrico-favale/pagellometro/blob/main/src/components/ui/AppLogo.jsx): `src/components/ui/AppLogo.jsx`

### Identity & Profile

- [Login & Register](https://github.com/enrico-favale/pagellometro/blob/main/src/pages/LoginPage.jsx): `src/pages/LoginPage.jsx`
- [Registration](https://github.com/enrico-favale/pagellometro/blob/main/src/pages/RegisterPage.jsx): `src/pages/RegisterPage.jsx`
- [Auth Callback](https://github.com/enrico-favale/pagellometro/blob/main/src/pages/AuthCallbackPage.jsx): `src/pages/AuthCallbackPage.jsx`
- [Auth Provider](https://github.com/enrico-favale/pagellometro/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Auth Hook](https://github.com/enrico-favale/pagellometro/blob/main/src/hooks/useAuth.js): `src/hooks/useAuth.js`
- [Auth UI](https://github.com/enrico-favale/pagellometro/blob/main/src/components/auth/GoogleAuthButton.jsx): `src/components/auth/GoogleAuthButton.jsx`
- [Auth Shell](https://github.com/enrico-favale/pagellometro/blob/main/src/components/layout/AuthShell.jsx): `src/components/layout/AuthShell.jsx`
- [Profile Page](https://github.com/enrico-favale/pagellometro/blob/main/src/pages/ProfilePage.jsx): `src/pages/ProfilePage.jsx`
- [Avatar Button](https://github.com/enrico-favale/pagellometro/blob/main/src/components/profile/ProfileAvatarButton.jsx): `src/components/profile/ProfileAvatarButton.jsx`
- [Supabase Client](https://github.com/enrico-favale/pagellometro/blob/main/src/services/supabaseClient.js): `src/services/supabaseClient.js`
- [Auth Divider](https://github.com/enrico-favale/pagellometro/blob/main/src/components/auth/AuthDivider.jsx): `src/components/auth/AuthDivider.jsx`

### Competition Management

- [Dashboard](https://github.com/enrico-favale/pagellometro/blob/main/src/pages/DashboardPage.jsx): `src/pages/DashboardPage.jsx`
- [Create Competition](https://github.com/enrico-favale/pagellometro/blob/main/src/pages/NewCompetitionPage.jsx): `src/pages/NewCompetitionPage.jsx`
- [Creation Logic](https://github.com/enrico-favale/pagellometro/blob/main/src/hooks/useCompetitionCreation.js): `src/hooks/useCompetitionCreation.js`
- [Manage Competition](https://github.com/enrico-favale/pagellometro/blob/main/src/pages/ManageCompetitionPage.jsx): `src/pages/ManageCompetitionPage.jsx`
- [Management Logic](https://github.com/enrico-favale/pagellometro/blob/main/src/hooks/useCompetitionManagement.js): `src/hooks/useCompetitionManagement.js`

### Match Records

- [Match Details](https://github.com/enrico-favale/pagellometro/blob/main/src/pages/MatchDetailsPage.jsx): `src/pages/MatchDetailsPage.jsx`
- [Edit Match](https://github.com/enrico-favale/pagellometro/blob/main/src/pages/EditMatchPage.jsx): `src/pages/EditMatchPage.jsx`
- [Match Data Hooks](https://github.com/enrico-favale/pagellometro/blob/main/src/hooks/useMatchDetails.js): `src/hooks/useMatchDetails.js`
- [Match Edit Hook](https://github.com/enrico-favale/pagellometro/blob/main/src/hooks/useMatchEdit.js): `src/hooks/useMatchEdit.js`

### Other components

- **Visitor**
- **Supabase**

## Connections

- Route Table → Home Page: routes to (evidence: `src/App.jsx`)
- Route Table → Login & Register: routes to (evidence: `src/App.jsx`)
- Route Table → Registration: routes to (evidence: `src/App.jsx`)
- Route Table → Profile Page: routes to (evidence: `src/App.jsx`)
- Route Table → Auth Callback: routes to (evidence: `src/App.jsx`)
- Route Table → Route Guard: guards routes (evidence: `src/App.jsx`)
- Route Guard → Dashboard: renders (evidence: `src/App.jsx`)
- Route Guard → Create Competition: renders (evidence: `src/App.jsx`)
- Route Guard → Manage Competition: renders (evidence: `src/App.jsx`)
- Route Guard → Match Details: renders (evidence: `src/App.jsx`)
- Route Guard → Edit Match: renders (evidence: `src/App.jsx`)
- Route Guard → Auth Hook: checks auth (evidence: `src/components/auth/ProtectedRoute.jsx`)
- Login & Register → Auth Hook: uses auth (evidence: `src/pages/LoginPage.jsx`)
- Registration → Auth Hook: uses auth (evidence: `src/pages/RegisterPage.jsx`)
- Login & Register → Auth UI: renders (evidence: `src/pages/LoginPage.jsx`)
- Registration → Auth UI: renders (evidence: `src/pages/RegisterPage.jsx`)
- Login & Register → Auth Shell: renders (evidence: `src/pages/LoginPage.jsx`)
- Registration → Auth Shell: renders (evidence: `src/pages/RegisterPage.jsx`)
- Login & Register → Auth Divider: renders (evidence: `src/pages/LoginPage.jsx`)
- Registration → Auth Divider: renders (evidence: `src/pages/RegisterPage.jsx`)
- Auth Shell → App Logo: renders (evidence: `src/components/layout/AuthShell.jsx`)
- Auth Hook → Auth Provider: reads context (evidence: `src/hooks/useAuth.js`)
- Auth Provider → Supabase Client: calls auth and data APIs (evidence: `src/context/AuthContext.jsx`)
- Auth Callback → Supabase Client: checks session (evidence: `src/pages/AuthCallbackPage.jsx`)
- Profile Page → Auth Hook: uses auth (evidence: `src/pages/ProfilePage.jsx`)
- Profile Page → Avatar Button: renders (evidence: `src/pages/ProfilePage.jsx`)
- Dashboard → Auth Hook: uses auth (evidence: `src/pages/DashboardPage.jsx`)
- Dashboard → App Button: renders (evidence: `src/pages/DashboardPage.jsx`)
- Dashboard → App Logo: renders (evidence: `src/pages/DashboardPage.jsx`)
- Dashboard → Supabase Client: loads competitions via hook (evidence: `src/pages/DashboardPage.jsx`)
- Create Competition → Auth Hook: uses auth (evidence: `src/pages/NewCompetitionPage.jsx`)
- Create Competition → Creation Logic: uses creation logic (evidence: `src/pages/NewCompetitionPage.jsx`)
- Manage Competition → Auth Hook: uses auth (evidence: `src/pages/ManageCompetitionPage.jsx`)
- Manage Competition → Management Logic: calls management logic (evidence: `src/pages/ManageCompetitionPage.jsx`)
- Management Logic → Supabase Client: queries and writes (evidence: `src/hooks/useCompetitionManagement.js`)
- Creation Logic → Supabase Client: uses data API (evidence: `src/hooks/useCompetitionCreation.js`)
- Match Details → Match Data Hooks: uses match data (evidence: `src/pages/MatchDetailsPage.jsx`)
- Edit Match → Match Edit Hook: uses edit logic (evidence: `src/pages/EditMatchPage.jsx`)
- Match Data Hooks → Supabase Client: uses data API (evidence: `src/hooks/useMatchDetails.js`)
- Match Edit Hook → Supabase Client: uses data API (evidence: `src/hooks/useMatchEdit.js`)
- Supabase Client → Supabase: creates client (evidence: `src/services/supabaseClient.js`)
