# davirsreis/marmoraria-lapidarte-next architecture

> Architecture diagram of the GitHub repository davirsreis/marmoraria-lapidarte-next, 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/davirsreis/marmoraria-lapidarte-next
- Repository: https://github.com/davirsreis/marmoraria-lapidarte-next

## Overview

Lapidarte is a customer-facing stone catalog and quotation site with a protected product-management area. Customers browse product pages and can submit project details for a quote; administrators manage catalog records and refresh the JSON catalog used by the public site. The graph also captures Firebase-backed storage, browser caching, and authentication. Several routes and UI components are represented from the tree and SOURCE INDEX; their internal behavior was not sampled, so uncertain connections are omitted or marked unverified.

Main entry points: [`src/firebase/db/ColecaoProduto.ts`](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/firebase/db/ColecaoProduto.ts) (Product collection), [`src/pages/gerenciamento.tsx`](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/pages/gerenciamento.tsx) (Admin page), [`src/Auxiliares/functions.tsx`](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/Auxiliares/functions.tsx) (Catalog and messaging helpers), [`src/components/Header.tsx`](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/components/Header.tsx) (Site navigation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public experience"]
  node_home["Home page<br/>[index.tsx]"]
  node_home_sections["Home sections"]
  node_catalog_pages["Catalog pages"]
  node_product_list["Product listing<br/>[produtos.tsx]"]
  node_product_display["Product display"]
  node_product_context["Catalog context<br/>[ProdutoContext.jsx]"]
end

subgraph group_quote["Quote requests"]
  node_quote_page["Quote page"]
  node_quote_form["Quote fields<br/>[EntradaForm.tsx]"]
end

subgraph group_admin["Product management"]
  node_admin_page["Admin page<br/>[gerenciamento.tsx]"]
  node_product_hook["Product operations<br/>[useProdutos.ts]"]
  node_product_form["Product form<br/>[Formulario.tsx]"]
  node_product_table["Product table<br/>[Tabela.tsx]"]
  node_auth["Authentication<br/>[autentication.js]"]
  node_route_guard["Route protection"]
end

subgraph group_data["Catalog and services"]
  node_product_model["Product model<br/>[Produto.ts]"]
  node_repository["Repository contract"]
  node_product_collection["Product collection<br/>[ColecaoProduto.ts]"]
  node_firebase[("Firebase services<br/>[config.ts]")]
  node_json_api["Catalog API"]
  node_file_api["File download API<br/>[&#91;nomeArquivo&#93;.ts]"]
end

subgraph group_shared["Shared application"]
  node_app_shell["Application shell<br/>[_app.tsx]"]
  node_header["Site navigation<br/>[Header.tsx]"]
  node_helpers["Catalog and messaging helpers<br/>[functions.tsx]"]
  node_catalog_values["Featured products<br/>[Valores.tsx]"]
  node_responsive["Responsive sizing<br/>[useWindowSize.ts]"]
end

node_visitor(("Customer"))
node_whatsapp["WhatsApp"]
node_storage[("Firebase Storage")]

node_visitor -->|"opens"| node_home
node_home -->|"renders"| node_home_sections
node_visitor -->|"browses"| node_product_list
node_product_list -->|"renders"| node_product_display
node_product_list -->|"reads catalog"| node_product_context
node_product_context -->|"fetches catalog"| node_helpers
node_helpers -->|"requests JSON"| node_json_api
node_json_api -->|"reads catalog"| node_product_collection
node_visitor -->|"requests quote"| node_quote_page
node_quote_page -->|"renders"| node_quote_form
node_quote_page -->|"uses helpers"| node_helpers
node_helpers -->|"opens message"| node_whatsapp
node_visitor -->|"manages catalog"| node_admin_page
node_app_shell -->|"uses guard"| node_route_guard
node_admin_page -->|"loads operations"| node_product_hook
node_admin_page -->|"renders"| node_product_form
node_admin_page -->|"renders"| node_product_table
node_product_hook -->|"uses contract"| node_repository
node_product_hook -->|"creates repository"| node_product_collection
node_product_form -->|"uses model"| node_product_model
node_product_table -->|"uses model"| node_product_model
node_product_collection -->|"implements"| node_repository
node_product_collection -->|"converts records"| node_product_model
node_product_collection -->|"reads and writes"| node_firebase
node_product_collection -->|"uploads catalog JSON"| node_storage
node_product_collection -->|"caches in browser"| node_visitor
node_admin_page -->|"refreshes JSON"| node_product_collection
node_product_form -->|"uses Firebase"| node_firebase
node_header -->|"opens contact message"| node_helpers
node_header -->|"logs out"| node_auth
node_header -->|"tracks size"| node_responsive
node_header -->|"links categories"| node_catalog_pages
node_home_sections -->|"uses featured items"| node_catalog_values
node_file_api -->|"uses Firebase"| node_firebase

click node_home "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/pages/index.tsx"
click node_home_sections "https://github.com/davirsreis/marmoraria-lapidarte-next/tree/main/src/components/homePage"
click node_catalog_pages "https://github.com/davirsreis/marmoraria-lapidarte-next/tree/main/src/pages"
click node_product_list "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/pages/produtos.tsx"
click node_product_display "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/components/produtos/RolagemProdutos.tsx"
click node_product_context "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/components/context/ProdutoContext.jsx"
click node_quote_page "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/pages/solicitar-orcamento.tsx"
click node_quote_form "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/components/orcamento/EntradaForm.tsx"
click node_admin_page "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/pages/gerenciamento.tsx"
click node_product_hook "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/hooks/useProdutos.ts"
click node_product_form "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/components/gerenciamento/Formulario.tsx"
click node_product_table "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/components/gerenciamento/Tabela.tsx"
click node_auth "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/firebase/autentication.js"
click node_route_guard "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/components/ProtectedRouteGuard.tsx"
click node_product_model "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/core/Produto.ts"
click node_repository "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/core/ProdutoRepositorio.ts"
click node_product_collection "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/firebase/db/ColecaoProduto.ts"
click node_firebase "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/firebase/config.ts"
click node_json_api "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/pages/api/consultarProdutos.ts"
click node_file_api "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/pages/api/baixar-arquivo/%5BnomeArquivo%5D.ts"
click node_app_shell "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/pages/_app.tsx"
click node_header "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/components/Header.tsx"
click node_helpers "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/Auxiliares/functions.tsx"
click node_catalog_values "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/Auxiliares/Valores.tsx"
click node_responsive "https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/hooks/useWindowSize.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_home,node_home_sections,node_catalog_pages,node_product_list,node_product_display,node_product_context toneBlue
class node_quote_page,node_quote_form,node_storage toneAmber
class node_admin_page,node_product_hook,node_product_form,node_product_table,node_auth,node_route_guard toneMint
class node_product_model,node_repository,node_product_collection,node_firebase,node_json_api,node_file_api toneRose
class node_app_shell,node_header,node_helpers,node_catalog_values,node_responsive,node_visitor,node_whatsapp toneIndigo
```

## Components

### Public experience

- [Home page](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/pages/index.tsx): `src/pages/index.tsx`
- [Home sections](https://github.com/davirsreis/marmoraria-lapidarte-next/tree/main/src/components/homePage): `src/components/homePage`
- [Catalog pages](https://github.com/davirsreis/marmoraria-lapidarte-next/tree/main/src/pages): `src/pages`
- [Product listing](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/pages/produtos.tsx): `src/pages/produtos.tsx`
- [Product display](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/components/produtos/RolagemProdutos.tsx): `src/components/produtos/RolagemProdutos.tsx`
- [Catalog context](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/components/context/ProdutoContext.jsx): `src/components/context/ProdutoContext.jsx`

### Quote requests

- [Quote page](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/pages/solicitar-orcamento.tsx): `src/pages/solicitar-orcamento.tsx`
- [Quote fields](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/components/orcamento/EntradaForm.tsx): `src/components/orcamento/EntradaForm.tsx`

### Product management

- [Admin page](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/pages/gerenciamento.tsx): `src/pages/gerenciamento.tsx`
- [Product operations](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/hooks/useProdutos.ts): `src/hooks/useProdutos.ts`
- [Product form](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/components/gerenciamento/Formulario.tsx): `src/components/gerenciamento/Formulario.tsx`
- [Product table](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/components/gerenciamento/Tabela.tsx): `src/components/gerenciamento/Tabela.tsx`
- [Authentication](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/firebase/autentication.js): `src/firebase/autentication.js`
- [Route protection](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/components/ProtectedRouteGuard.tsx): `src/components/ProtectedRouteGuard.tsx`

### Catalog and services

- [Product model](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/core/Produto.ts): `src/core/Produto.ts`
- [Repository contract](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/core/ProdutoRepositorio.ts): `src/core/ProdutoRepositorio.ts`
- [Product collection](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/firebase/db/ColecaoProduto.ts): `src/firebase/db/ColecaoProduto.ts`
- [Firebase services](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/firebase/config.ts): `src/firebase/config.ts`
- [Catalog API](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/pages/api/consultarProdutos.ts): `src/pages/api/consultarProdutos.ts`
- [File download API](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/pages/api/baixar-arquivo/%5BnomeArquivo%5D.ts): `src/pages/api/baixar-arquivo/[nomeArquivo].ts`

### Shared application

- [Application shell](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/pages/_app.tsx): `src/pages/_app.tsx`
- [Site navigation](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/components/Header.tsx): `src/components/Header.tsx`
- [Catalog and messaging helpers](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/Auxiliares/functions.tsx): `src/Auxiliares/functions.tsx`
- [Featured products](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/Auxiliares/Valores.tsx): `src/Auxiliares/Valores.tsx`
- [Responsive sizing](https://github.com/davirsreis/marmoraria-lapidarte-next/blob/main/src/hooks/useWindowSize.ts): `src/hooks/useWindowSize.ts`

### Other components

- **Customer**
- **WhatsApp**
- **Firebase Storage**

## Connections

- Customer → Home page: opens
- Home page → Home sections: renders (evidence: `src/pages/index.tsx`)
- Customer → Product listing: browses
- Product listing → Product display: renders (evidence: `src/pages/produtos.tsx`)
- Product listing → Catalog context: reads catalog (evidence: `src/pages/produtos.tsx`)
- Catalog context → Catalog and messaging helpers: fetches catalog (evidence: `src/components/context/ProdutoContext.jsx`)
- Catalog and messaging helpers → Catalog API: requests JSON (evidence: `src/Auxiliares/functions.tsx`)
- Catalog API → Product collection: reads catalog (evidence: `src/pages/api/consultarProdutos.ts`)
- Customer → Quote page: requests quote
- Quote page → Quote fields: renders (evidence: `src/pages/solicitar-orcamento.tsx`)
- Quote page → Catalog and messaging helpers: uses helpers (evidence: `src/pages/solicitar-orcamento.tsx`)
- Catalog and messaging helpers → WhatsApp: opens message (evidence: `src/Auxiliares/functions.tsx`)
- Customer → Admin page: manages catalog
- Application shell → Route protection: uses guard (evidence: `src/pages/_app.tsx`)
- Admin page → Product operations: loads operations (evidence: `src/pages/gerenciamento.tsx`)
- Admin page → Product form: renders (evidence: `src/pages/gerenciamento.tsx`)
- Admin page → Product table: renders (evidence: `src/pages/gerenciamento.tsx`)
- Product operations → Repository contract: uses contract (evidence: `src/hooks/useProdutos.ts`)
- Product operations → Product collection: creates repository (evidence: `src/hooks/useProdutos.ts`)
- Product form → Product model: uses model (evidence: `src/components/gerenciamento/Formulario.tsx`)
- Product table → Product model: uses model (evidence: `src/components/gerenciamento/Tabela.tsx`)
- Product collection → Repository contract: implements (evidence: `src/firebase/db/ColecaoProduto.ts`)
- Product collection → Product model: converts records (evidence: `src/firebase/db/ColecaoProduto.ts`)
- Product collection → Firebase services: reads and writes (evidence: `src/firebase/db/ColecaoProduto.ts`)
- Product collection → Firebase Storage: uploads catalog JSON (evidence: `src/firebase/db/ColecaoProduto.ts`)
- Product collection → Customer: caches in browser (evidence: `src/firebase/db/ColecaoProduto.ts`)
- Admin page → Product collection: refreshes JSON (evidence: `src/pages/gerenciamento.tsx`)
- Product form → Firebase services: uses Firebase (evidence: `src/components/gerenciamento/Formulario.tsx`)
- Site navigation → Catalog and messaging helpers: opens contact message (evidence: `src/components/Header.tsx`)
- Site navigation → Authentication: logs out (evidence: `src/components/Header.tsx`)
- Site navigation → Responsive sizing: tracks size (evidence: `src/components/Header.tsx`)
- Site navigation → Catalog pages: links categories (evidence: `src/components/Header.tsx`)
- Home sections → Featured products: uses featured items (evidence: `src/components/homePage/SectionProdutos.tsx`)
- File download API → Firebase services: uses Firebase (evidence: `src/pages/api/baixar-arquivo/[nomeArquivo].ts`)
