# paulobrandao26/site-lojafit architecture

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

## Overview

This is a React storefront for fitness products. Shoppers browse and filter products, view details, add items to a cart, submit delivery information, and are redirected to payment; a confirmation page and affiliate page are also routed. The graph covers documented route and capability branches plus shared cart, authentication, and theme state. Some page implementations are only partially excerpted, so uncertain integrations are omitted.

Main entry points: [`src/routes/AppRoutes.tsx`](https://github.com/paulobrandao26/site-lojafit/blob/main/src/routes/AppRoutes.tsx) (Page Routes), [`src/context/CarrinhoContext.tsx`](https://github.com/paulobrandao26/site-lojafit/blob/main/src/context/CarrinhoContext.tsx) (Cart State), [`src/data/api.ts`](https://github.com/paulobrandao26/site-lojafit/blob/main/src/data/api.ts) (API Client), [`src/App.tsx`](https://github.com/paulobrandao26/site-lojafit/blob/main/src/App.tsx) (App Shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["App Shell<br/>[App.tsx]"]
  node_routes["Page Routes<br/>[AppRoutes.tsx]"]
  node_home["Home Page<br/>[Home.tsx]"]
  node_products["Product Listing<br/>[Produtos.tsx]"]
  node_detail["Product Detail<br/>[ProdutoDetalhe.tsx]"]
  node_productcard["Product Card"]
  node_category["Category Labels<br/>[categoria.ts]"]
  node_header["Site Header<br/>[Header.tsx]"]
  node_footer["Site Footer<br/>[Footer.tsx]"]
  node_affiliates["Affiliate Page<br/>[Afiliados.tsx]"]
end

subgraph group_purchase["Purchase Flow"]
  node_cartpage["Cart Page<br/>[Carrinho.tsx]"]
  node_checkout["Checkout<br/>[Checkout.tsx]"]
  node_steps["Checkout Steps<br/>[Etapas.tsx]"]
  node_confirmed["Order Confirmation"]
end

subgraph group_shared["Shared State"]
  node_cartstate["Cart State"]
  node_auth["Authentication State<br/>[AuthContext.tsx]"]
  node_theme["Theme State<br/>[TemaContext.tsx]"]
end

subgraph group_services["Data Services"]
  node_api["API Client<br/>[api.ts]"]
  node_backend["Store Backend"]
  node_payment["Stripe Payment"]
end

node_shopper(("Shopper"))

node_shopper -->|"navigates"| node_routes
node_app -->|"renders"| node_routes
node_app -->|"renders"| node_header
node_app -->|"renders"| node_footer
node_app -->|"provides"| node_auth
node_app -->|"provides"| node_cartstate
node_app -->|"provides"| node_theme
node_routes -->|"routes to"| node_home
node_routes -->|"routes to"| node_products
node_routes -->|"routes to"| node_detail
node_routes -->|"routes to"| node_cartpage
node_routes -->|"routes to"| node_checkout
node_routes -->|"routes to"| node_affiliates
node_routes -->|"routes to"| node_confirmed
node_home -->|"loads products"| node_api
node_products -->|"loads products"| node_api
node_detail -->|"loads product"| node_api
node_home -->|"renders"| node_productcard
node_products -->|"renders"| node_productcard
node_productcard -->|"formats category"| node_category
node_home -->|"formats category"| node_category
node_products -->|"formats category"| node_category
node_home -->|"adds products"| node_cartstate
node_products -->|"adds products"| node_cartstate
node_detail -->|"uses cart"| node_cartstate
node_header -->|"reads cart"| node_cartstate
node_header -->|"uses theme"| node_theme
node_cartpage -->|"reads and updates"| node_cartstate
node_cartpage -->|"renders"| node_steps
node_checkout -->|"reads cart"| node_cartstate
node_checkout -->|"renders"| node_steps
node_checkout -->|"creates order and session"| node_api
node_confirmed -->|"uses cart"| node_cartstate
node_auth -->|"logs in or registers"| node_api
node_api -->|"sends requests"| node_backend
node_api -.->|"creates payment session"| node_payment

click node_app "https://github.com/paulobrandao26/site-lojafit/blob/main/src/App.tsx"
click node_routes "https://github.com/paulobrandao26/site-lojafit/blob/main/src/routes/AppRoutes.tsx"
click node_home "https://github.com/paulobrandao26/site-lojafit/blob/main/src/pages/Home.tsx"
click node_products "https://github.com/paulobrandao26/site-lojafit/blob/main/src/pages/Produtos.tsx"
click node_detail "https://github.com/paulobrandao26/site-lojafit/blob/main/src/pages/ProdutoDetalhe.tsx"
click node_productcard "https://github.com/paulobrandao26/site-lojafit/blob/main/src/components/ui/ProductRevealCard.tsx"
click node_category "https://github.com/paulobrandao26/site-lojafit/blob/main/src/lib/categoria.ts"
click node_header "https://github.com/paulobrandao26/site-lojafit/blob/main/src/components/Header.tsx"
click node_footer "https://github.com/paulobrandao26/site-lojafit/blob/main/src/components/Footer.tsx"
click node_affiliates "https://github.com/paulobrandao26/site-lojafit/blob/main/src/pages/Afiliados.tsx"
click node_cartpage "https://github.com/paulobrandao26/site-lojafit/blob/main/src/pages/Carrinho.tsx"
click node_checkout "https://github.com/paulobrandao26/site-lojafit/blob/main/src/pages/Checkout.tsx"
click node_steps "https://github.com/paulobrandao26/site-lojafit/blob/main/src/components/Etapas.tsx"
click node_confirmed "https://github.com/paulobrandao26/site-lojafit/blob/main/src/pages/PedidoConfirmado.tsx"
click node_cartstate "https://github.com/paulobrandao26/site-lojafit/blob/main/src/context/CarrinhoContext.tsx"
click node_auth "https://github.com/paulobrandao26/site-lojafit/blob/main/src/context/AuthContext.tsx"
click node_theme "https://github.com/paulobrandao26/site-lojafit/blob/main/src/context/TemaContext.tsx"
click node_api "https://github.com/paulobrandao26/site-lojafit/blob/main/src/data/api.ts"

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_routes,node_home,node_products,node_detail,node_productcard,node_category,node_header,node_footer,node_affiliates toneBlue
class node_cartpage,node_checkout,node_steps,node_confirmed toneAmber
class node_cartstate,node_auth,node_theme toneMint
class node_api,node_backend,node_payment toneRose
class node_shopper toneIndigo
```

## Components

### Storefront

- [App Shell](https://github.com/paulobrandao26/site-lojafit/blob/main/src/App.tsx): `src/App.tsx`
- [Page Routes](https://github.com/paulobrandao26/site-lojafit/blob/main/src/routes/AppRoutes.tsx): `src/routes/AppRoutes.tsx`
- [Home Page](https://github.com/paulobrandao26/site-lojafit/blob/main/src/pages/Home.tsx): `src/pages/Home.tsx`
- [Product Listing](https://github.com/paulobrandao26/site-lojafit/blob/main/src/pages/Produtos.tsx): `src/pages/Produtos.tsx`
- [Product Detail](https://github.com/paulobrandao26/site-lojafit/blob/main/src/pages/ProdutoDetalhe.tsx): `src/pages/ProdutoDetalhe.tsx`
- [Product Card](https://github.com/paulobrandao26/site-lojafit/blob/main/src/components/ui/ProductRevealCard.tsx): `src/components/ui/ProductRevealCard.tsx`
- [Category Labels](https://github.com/paulobrandao26/site-lojafit/blob/main/src/lib/categoria.ts): `src/lib/categoria.ts`
- [Site Header](https://github.com/paulobrandao26/site-lojafit/blob/main/src/components/Header.tsx): `src/components/Header.tsx`
- [Site Footer](https://github.com/paulobrandao26/site-lojafit/blob/main/src/components/Footer.tsx): `src/components/Footer.tsx`
- [Affiliate Page](https://github.com/paulobrandao26/site-lojafit/blob/main/src/pages/Afiliados.tsx): `src/pages/Afiliados.tsx`

### Purchase Flow

- [Cart Page](https://github.com/paulobrandao26/site-lojafit/blob/main/src/pages/Carrinho.tsx): `src/pages/Carrinho.tsx`
- [Checkout](https://github.com/paulobrandao26/site-lojafit/blob/main/src/pages/Checkout.tsx): `src/pages/Checkout.tsx`
- [Checkout Steps](https://github.com/paulobrandao26/site-lojafit/blob/main/src/components/Etapas.tsx): `src/components/Etapas.tsx`
- [Order Confirmation](https://github.com/paulobrandao26/site-lojafit/blob/main/src/pages/PedidoConfirmado.tsx): `src/pages/PedidoConfirmado.tsx`

### Shared State

- [Cart State](https://github.com/paulobrandao26/site-lojafit/blob/main/src/context/CarrinhoContext.tsx): `src/context/CarrinhoContext.tsx`
- [Authentication State](https://github.com/paulobrandao26/site-lojafit/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Theme State](https://github.com/paulobrandao26/site-lojafit/blob/main/src/context/TemaContext.tsx): `src/context/TemaContext.tsx`

### Data Services

- [API Client](https://github.com/paulobrandao26/site-lojafit/blob/main/src/data/api.ts): `src/data/api.ts`
- **Store Backend**
- **Stripe Payment**

### Other components

- **Shopper**

## Connections

- Shopper → Page Routes: navigates (evidence: `src/routes/AppRoutes.tsx`)
- App Shell → Page Routes: renders (evidence: `src/App.tsx`)
- App Shell → Site Header: renders (evidence: `src/App.tsx`)
- App Shell → Site Footer: renders (evidence: `src/App.tsx`)
- App Shell → Authentication State: provides (evidence: `src/App.tsx`)
- App Shell → Cart State: provides (evidence: `src/App.tsx`)
- App Shell → Theme State: provides (evidence: `src/App.tsx`)
- Page Routes → Home Page: routes to (evidence: `src/routes/AppRoutes.tsx`)
- Page Routes → Product Listing: routes to (evidence: `src/routes/AppRoutes.tsx`)
- Page Routes → Product Detail: routes to (evidence: `src/routes/AppRoutes.tsx`)
- Page Routes → Cart Page: routes to (evidence: `src/routes/AppRoutes.tsx`)
- Page Routes → Checkout: routes to (evidence: `src/routes/AppRoutes.tsx`)
- Page Routes → Affiliate Page: routes to (evidence: `src/routes/AppRoutes.tsx`)
- Page Routes → Order Confirmation: routes to (evidence: `src/routes/AppRoutes.tsx`)
- Home Page → API Client: loads products (evidence: `src/pages/Home.tsx`)
- Product Listing → API Client: loads products (evidence: `src/pages/Produtos.tsx`)
- Product Detail → API Client: loads product (evidence: `src/pages/ProdutoDetalhe.tsx`)
- Home Page → Product Card: renders (evidence: `src/pages/Home.tsx`)
- Product Listing → Product Card: renders (evidence: `src/pages/Produtos.tsx`)
- Product Card → Category Labels: formats category (evidence: `src/components/ui/ProductRevealCard.tsx`)
- Home Page → Category Labels: formats category (evidence: `src/pages/Home.tsx`)
- Product Listing → Category Labels: formats category (evidence: `src/pages/Produtos.tsx`)
- Home Page → Cart State: adds products (evidence: `src/pages/Home.tsx`)
- Product Listing → Cart State: adds products (evidence: `src/pages/Produtos.tsx`)
- Product Detail → Cart State: uses cart (evidence: `src/pages/ProdutoDetalhe.tsx`)
- Site Header → Cart State: reads cart (evidence: `src/components/Header.tsx`)
- Site Header → Theme State: uses theme (evidence: `src/components/Header.tsx`)
- Cart Page → Cart State: reads and updates (evidence: `src/pages/Carrinho.tsx`)
- Cart Page → Checkout Steps: renders (evidence: `src/pages/Carrinho.tsx`)
- Checkout → Cart State: reads cart (evidence: `src/pages/Checkout.tsx`)
- Checkout → Checkout Steps: renders (evidence: `src/pages/Checkout.tsx`)
- Checkout → API Client: creates order and session (evidence: `src/pages/Checkout.tsx`)
- Order Confirmation → Cart State: uses cart (evidence: `src/pages/PedidoConfirmado.tsx`)
- Authentication State → API Client: logs in or registers (evidence: `src/context/AuthContext.tsx`)
- API Client → Store Backend: sends requests (evidence: `src/data/api.ts`)
- API Client → Stripe Payment: creates payment session
