# lolo1809-sudo/prototipo_gym architecture

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

- Interactive diagram: https://gitdiagram.com/lolo1809-sudo/prototipo_gym
- Repository: https://github.com/lolo1809-sudo/prototipo_gym

## Overview

This is a multi-gym website and management app: visitors browse gym information, plans, reviews, gallery and products; members can sign in and submit reviews, while gym staff administer content, members, inventory and attendance. App loads gym-scoped data from Supabase and routes users to public or protected pages. The excerpts show several admin data hooks and the attendance workflow; other admin areas are represented by their existing directories. Relationships for unsampled modules are omitted rather than inferred.

Main entry points: [`src/App.jsx`](https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/App.jsx) (App router), [`src/config.jsx`](https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/config.jsx) (Supabase), [`src/pages/Admin/adminUtils.js`](https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/pages/Admin/adminUtils.js) (Gym identity lookup), [`src/pages/Inicio.jsx`](https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/pages/Inicio.jsx) (Gym homepage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public experience"]
  node_app["App router<br/>[App.jsx]"]
  node_home["Gym homepage<br/>[Inicio.jsx]"]
  node_publicsections["Content sections"]
  node_catalog["Product catalog<br/>[CategoryPage.jsx]"]
  node_product["Product detail<br/>[ProductDetail.jsx]"]
end

subgraph group_member["Member features"]
end

subgraph group_admin["Gym administration"]
  node_login["Staff login<br/>[Login.jsx]"]
  node_guard["Protected routes<br/>[RutaProtegida.jsx]"]
  node_admin["Admin dashboard<br/>[Admin.jsx]"]
  node_gymadmin["Gym profile"]
  node_galleryadmin["Gallery admin"]
  node_plansadmin["Plans admin"]
  node_reviewsadmin["Review moderation"]
  node_trainersadmin["Trainer admin"]
  node_membersadmin["Member admin"]
  node_stockadmin["Stock admin"]
  node_checkin["Attendance check-in<br/>[useSesion.js]"]
end

subgraph group_data["Data and access"]
  node_authhelper["Gym identity lookup<br/>[adminUtils.js]"]
  node_supabase[("Supabase<br/>[config.jsx]")]
end

node_visitor(("Visitor"))
node_staff(("Gym staff"))

node_visitor -->|"opens"| node_app
node_staff -->|"opens"| node_app
node_app -->|"loads gym data"| node_supabase
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_product
node_app -->|"routes to"| node_login
node_app -->|"protects routes"| node_guard
node_guard -->|"allows access"| node_admin
node_home -->|"renders"| node_publicsections
node_home -->|"submits review"| node_supabase
node_staff -->|"signs in"| node_login
node_gymadmin -->|"reads and updates"| node_supabase
node_gymadmin -->|"resolves gym"| node_authhelper
node_galleryadmin -->|"manages gallery"| node_supabase
node_galleryadmin -->|"resolves gym"| node_authhelper
node_plansadmin -->|"manages plans"| node_supabase
node_plansadmin -->|"resolves gym"| node_authhelper
node_reviewsadmin -->|"moderates reviews"| node_supabase
node_reviewsadmin -->|"resolves gym"| node_authhelper
node_trainersadmin -->|"manages trainers"| node_supabase
node_trainersadmin -->|"resolves gym"| node_authhelper
node_membersadmin -->|"manages members"| node_supabase
node_membersadmin -->|"resolves gym"| node_authhelper
node_checkin -->|"checks membership"| node_supabase
node_checkin -->|"resolves gym"| node_authhelper

click node_app "https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/App.jsx"
click node_home "https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/pages/Inicio.jsx"
click node_publicsections "https://github.com/lolo1809-sudo/prototipo_gym/tree/main/src/components"
click node_catalog "https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/pages/CategoryPage.jsx"
click node_product "https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/pages/ProductDetail.jsx"
click node_login "https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/pages/Login.jsx"
click node_guard "https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/components/RutaProtegida.jsx"
click node_admin "https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/pages/Admin/Admin.jsx"
click node_gymadmin "https://github.com/lolo1809-sudo/prototipo_gym/tree/main/src/pages/Admin/InfoGym"
click node_galleryadmin "https://github.com/lolo1809-sudo/prototipo_gym/tree/main/src/pages/Admin/Galeria"
click node_plansadmin "https://github.com/lolo1809-sudo/prototipo_gym/tree/main/src/pages/Admin/Planes"
click node_reviewsadmin "https://github.com/lolo1809-sudo/prototipo_gym/tree/main/src/pages/Admin/Comentarios"
click node_trainersadmin "https://github.com/lolo1809-sudo/prototipo_gym/tree/main/src/pages/Admin/Trainers"
click node_membersadmin "https://github.com/lolo1809-sudo/prototipo_gym/tree/main/src/pages/Admin/Socios"
click node_stockadmin "https://github.com/lolo1809-sudo/prototipo_gym/tree/main/src/pages/Admin/Stock"
click node_checkin "https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/pages/Admin/Sesion/useSesion.js"
click node_authhelper "https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/pages/Admin/adminUtils.js"
click node_supabase "https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/config.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_home,node_publicsections,node_catalog,node_product toneBlue
class node_login,node_guard,node_admin,node_gymadmin,node_galleryadmin,node_plansadmin,node_reviewsadmin,node_trainersadmin,node_membersadmin,node_stockadmin,node_checkin toneMint
class node_authhelper,node_supabase toneRose
class node_visitor,node_staff toneIndigo
```

## Components

### Public experience

- [App router](https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/App.jsx): `src/App.jsx`
- [Gym homepage](https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/pages/Inicio.jsx): `src/pages/Inicio.jsx`
- [Content sections](https://github.com/lolo1809-sudo/prototipo_gym/tree/main/src/components): `src/components`
- [Product catalog](https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/pages/CategoryPage.jsx): `src/pages/CategoryPage.jsx`
- [Product detail](https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/pages/ProductDetail.jsx): `src/pages/ProductDetail.jsx`

### Gym administration

- [Staff login](https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/pages/Login.jsx): `src/pages/Login.jsx`
- [Protected routes](https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/components/RutaProtegida.jsx): `src/components/RutaProtegida.jsx`
- [Admin dashboard](https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/pages/Admin/Admin.jsx): `src/pages/Admin/Admin.jsx`
- [Gym profile](https://github.com/lolo1809-sudo/prototipo_gym/tree/main/src/pages/Admin/InfoGym): `src/pages/Admin/InfoGym`
- [Gallery admin](https://github.com/lolo1809-sudo/prototipo_gym/tree/main/src/pages/Admin/Galeria): `src/pages/Admin/Galeria`
- [Plans admin](https://github.com/lolo1809-sudo/prototipo_gym/tree/main/src/pages/Admin/Planes): `src/pages/Admin/Planes`
- [Review moderation](https://github.com/lolo1809-sudo/prototipo_gym/tree/main/src/pages/Admin/Comentarios): `src/pages/Admin/Comentarios`
- [Trainer admin](https://github.com/lolo1809-sudo/prototipo_gym/tree/main/src/pages/Admin/Trainers): `src/pages/Admin/Trainers`
- [Member admin](https://github.com/lolo1809-sudo/prototipo_gym/tree/main/src/pages/Admin/Socios): `src/pages/Admin/Socios`
- [Stock admin](https://github.com/lolo1809-sudo/prototipo_gym/tree/main/src/pages/Admin/Stock): `src/pages/Admin/Stock`
- [Attendance check-in](https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/pages/Admin/Sesion/useSesion.js): `src/pages/Admin/Sesion/useSesion.js`

### Data and access

- [Gym identity lookup](https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/pages/Admin/adminUtils.js): `src/pages/Admin/adminUtils.js`
- [Supabase](https://github.com/lolo1809-sudo/prototipo_gym/blob/main/src/config.jsx): `src/config.jsx`

### Other components

- **Visitor**
- **Gym staff**

## Connections

- Visitor → App router: opens (evidence: `src/App.jsx`)
- Gym staff → App router: opens (evidence: `src/App.jsx`)
- App router → Supabase: loads gym data (evidence: `src/App.jsx`)
- App router → Gym homepage: routes to (evidence: `src/App.jsx`)
- App router → Product catalog: routes to (evidence: `src/App.jsx`)
- App router → Product detail: routes to (evidence: `src/App.jsx`)
- App router → Staff login: routes to (evidence: `src/App.jsx`)
- App router → Protected routes: protects routes (evidence: `src/App.jsx`)
- Protected routes → Admin dashboard: allows access (evidence: `src/components/RutaProtegida.jsx`)
- Gym homepage → Content sections: renders (evidence: `src/pages/Inicio.jsx`)
- Gym homepage → Supabase: submits review (evidence: `src/pages/Inicio.jsx`)
- Gym staff → Staff login: signs in (evidence: `src/pages/Login.jsx`)
- Gym profile → Supabase: reads and updates (evidence: `src/pages/Admin/InfoGym/useGym.js`)
- Gym profile → Gym identity lookup: resolves gym (evidence: `src/pages/Admin/InfoGym/useGym.js`)
- Gallery admin → Supabase: manages gallery (evidence: `src/pages/Admin/Galeria/useGaleria.js`)
- Gallery admin → Gym identity lookup: resolves gym (evidence: `src/pages/Admin/Galeria/useGaleria.js`)
- Plans admin → Supabase: manages plans (evidence: `src/pages/Admin/Planes/usePlanes.js`)
- Plans admin → Gym identity lookup: resolves gym (evidence: `src/pages/Admin/Planes/usePlanes.js`)
- Review moderation → Supabase: moderates reviews (evidence: `src/pages/Admin/Comentarios/useComentarios.js`)
- Review moderation → Gym identity lookup: resolves gym (evidence: `src/pages/Admin/Comentarios/useComentarios.js`)
- Trainer admin → Supabase: manages trainers (evidence: `src/pages/Admin/Trainers/useTrainers.js`)
- Trainer admin → Gym identity lookup: resolves gym (evidence: `src/pages/Admin/Trainers/useTrainers.js`)
- Member admin → Supabase: manages members (evidence: `src/pages/Admin/Socios/useSocios.js`)
- Member admin → Gym identity lookup: resolves gym (evidence: `src/pages/Admin/Socios/useSocios.js`)
- Attendance check-in → Supabase: checks membership (evidence: `src/pages/Admin/Sesion/useSesion.js`)
- Attendance check-in → Gym identity lookup: resolves gym (evidence: `src/pages/Admin/Sesion/useSesion.js`)
