# vivek-kanjariya/deepceramics architecture

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

- Interactive diagram: https://gitdiagram.com/vivek-kanjariya/deepceramics
- Repository: https://github.com/vivek-kanjariya/deepceramics

## Overview

#### Purpose and Runtime
Deepceramics is a Next.js App Router site for a ceramics/tile catalog, product content, inquiry/contact capture, blog publishing, and internal administration. It runs as a Node/Next application, with route handlers serving backend endpoints. Deployment is compatible with Vercel per the starter README. Primary application shell and root entry points are `src/app/layout.js`, `src/app/layout.tsx`, and `src/app/page.jsx`.

#### Public Site and Catalog
The public experience centers on homepage content, tile browsing/detail pages, product pages, blog, contact, and gallery. Catalog navigation flows from route pages into tile/product data endpoints and rendering components. Key routes are `src/app/tiles/[slug]/page.jsx`, `src/app/products/page.tsx`, and `src/app/products/[slug]/page.js`; gallery has a separate root-level route at `gallery/page.js`.

#### Content Management Boundary
Sanity is the CMS for blog-oriented content, including posts, authors, categories, and rich block content. The embedded Sanity Studio is exposed under the Next app, letting editors manage schemas without a separate frontend. CMS access and schema composition are defined by `src/sanity/lib/client.ts`, `src/sanity/schemaTypes/index.ts`, and `src/app/studio/[[...tool]]/page.tsx`.

#### Tile Data, Upload, and Administration
An authenticated admin area supports dashboarding, tile management, individual uploads, and bulk uploads. Tile persistence/access is abstracted behind API and library boundaries rather than embedded directly in pages. Primary control points are `src/app/admin/layout.jsx`, `src/app/admin/tiles/page.jsx`, `src/app/api/tiles/route.js`, and `src/lib/uploadTile.js`. Database integrations are present for MongoDB and Supabase in `src/lib/mongodb.js` and `src/lib/supabase.js`; the tree does not establish which is authoritative for each domain.

#### Leads and Contact Flow
Contact and inquiry UI submit to server-side route handlers, keeping external delivery or persistence concerns off the client. The contact page has its own content/client split, while shared inquiry capture is reusable in catalog contexts. Relevant boundaries are `src/app/contact/page.jsx`, `src/app/contact/api/route.js`, `src/app/api/contact/route.js`, and `src/components/inquiry/InquiryForm.jsx`.

#### Analytics Pipeline
Client analytics are collected through a tracker/hook and sent to route handlers for page views, search, filters, tile views, and quote events. There are duplicate-looking endpoint trees under `TEMP/analytics` and its nested `analytics` directory, suggesting generated, transitional, or alternate route placement rather than a clean canonical API surface. Core client components are `src/components/AnalyticsTracker.jsx` and `src/hooks/useAnalytics.js`; representative handlers are `TEMP/analytics/pageview/route.js` and `TEMP/analytics/analytics/search/route.js`.

#### Cross-Cutting Delivery and Access
The shared layout supplies global styling and common navigation/footer UI; context coordinates application-wide client state. Middleware likely enforces routing or admin access policies. SEO is generated through App Router metadata endpoints. Architectural paths include `src/app/globals.css`, `src/components/Navbar.jsx`, `src/context/MasterContext.jsx`, `middleware.js`, `src/app/sitemap.js`, and `src/app/robots.js`.

Main entry points: [`src/app/api/tiles/route.js`](https://github.com/vivek-kanjariya/deepceramics/blob/main/src/app/api/tiles/route.js) (Tile API), [`src/app/layout.js`](https://github.com/vivek-kanjariya/deepceramics/blob/main/src/app/layout.js) (App shell), [`src/app/tiles/[slug]/page.jsx`](https://github.com/vivek-kanjariya/deepceramics/blob/main/src/app/tiles/%5Bslug%5D/page.jsx) (Catalog routes), [`src/components/AnalyticsTracker.jsx`](https://github.com/vivek-kanjariya/deepceramics/blob/main/src/components/AnalyticsTracker.jsx) (Analytics client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public experience"]
  node_shell["App shell<br/>Next App Router<br/>[layout.js]"]
  node_navigation["Navigation &amp; state<br/>shared UI<br/>[Navbar.jsx]"]
  node_catalog_routes["Catalog routes<br/>route pages<br/>[page.jsx]"]
  node_product_detail["Product detail<br/>route page<br/>[page.js]"]
  node_gallery["Gallery<br/>route page<br/>[page.js]"]
  node_inquiry_form["Inquiry form<br/>client component<br/>[InquiryForm.jsx]"]
  node_contact_page["Contact page<br/>route page<br/>[page.jsx]"]
  node_seo["SEO metadata<br/>App Router metadata<br/>[sitemap.js]"]
end

subgraph group_management["Content &amp; administration"]
  node_admin["Admin area<br/>authenticated routes<br/>[layout.jsx]"]
  node_tile_upload["Tile upload service<br/>data library<br/>[uploadTile.js]"]
  node_sanity_studio["Sanity Studio<br/>embedded CMS<br/>[page.tsx]"]
  node_sanity_schema["Sanity schemas<br/>CMS schema<br/>[index.ts]"]
end

subgraph group_services["Server boundaries"]
  node_tile_api["Tile API<br/>route handler<br/>[route.js]"]
  node_contact_api["Contact endpoints<br/>route handlers<br/>[route.js]"]
  node_mongodb[("MongoDB integration<br/>database adapter<br/>[mongodb.js]")]
  node_supabase[("Supabase integration<br/>database adapter<br/>[supabase.js]")]
  node_middleware{{"Middleware<br/>access policy<br/>[middleware.js]"}}
end

subgraph group_analytics["Analytics"]
  node_analytics_client["Analytics client<br/>tracker and hook"]
  node_analytics_pageview["Pageview handler<br/>route handler<br/>[route.js]"]
  node_analytics_search["Search handler<br/>route handler<br/>[route.js]"]
end

node_shell -->|"renders"| node_navigation
node_shell -->|"hosts"| node_catalog_routes
node_shell -->|"initializes"| node_analytics_client
node_shell -->|"publishes"| node_seo
node_catalog_routes -->|"navigates to"| node_product_detail
node_catalog_routes -->|"embeds"| node_inquiry_form
node_catalog_routes -->|"loads tiles"| node_tile_api
node_gallery -.->|"uses catalog data"| node_tile_api
node_contact_page -->|"uses"| node_inquiry_form
node_inquiry_form -->|"submits"| node_contact_api
node_admin -->|"manages uploads"| node_tile_upload
node_admin -->|"manages tiles"| node_tile_api
node_middleware -->|"guards"| node_admin
node_tile_upload -->|"persists through"| node_tile_api
node_tile_api -.->|"may use"| node_mongodb
node_tile_api -.->|"may use"| node_supabase
node_sanity_studio -->|"loads schemas"| node_sanity_schema
node_analytics_client -->|"sends page views"| node_analytics_pageview
node_analytics_client -.->|"sends search events"| node_analytics_search

click node_shell "https://github.com/vivek-kanjariya/deepceramics/blob/main/src/app/layout.js"
click node_navigation "https://github.com/vivek-kanjariya/deepceramics/blob/main/src/components/Navbar.jsx"
click node_catalog_routes "https://github.com/vivek-kanjariya/deepceramics/blob/main/src/app/tiles/%5Bslug%5D/page.jsx"
click node_product_detail "https://github.com/vivek-kanjariya/deepceramics/blob/main/src/app/products/%5Bslug%5D/page.js"
click node_gallery "https://github.com/vivek-kanjariya/deepceramics/blob/main/gallery/page.js"
click node_inquiry_form "https://github.com/vivek-kanjariya/deepceramics/blob/main/src/components/inquiry/InquiryForm.jsx"
click node_contact_page "https://github.com/vivek-kanjariya/deepceramics/blob/main/src/app/contact/page.jsx"
click node_admin "https://github.com/vivek-kanjariya/deepceramics/blob/main/src/app/admin/layout.jsx"
click node_tile_upload "https://github.com/vivek-kanjariya/deepceramics/blob/main/src/lib/uploadTile.js"
click node_sanity_studio "https://github.com/vivek-kanjariya/deepceramics/blob/main/src/app/studio/%5B%5B...tool%5D%5D/page.tsx"
click node_sanity_schema "https://github.com/vivek-kanjariya/deepceramics/blob/main/src/sanity/schemaTypes/index.ts"
click node_tile_api "https://github.com/vivek-kanjariya/deepceramics/blob/main/src/app/api/tiles/route.js"
click node_contact_api "https://github.com/vivek-kanjariya/deepceramics/blob/main/src/app/api/contact/route.js"
click node_mongodb "https://github.com/vivek-kanjariya/deepceramics/blob/main/src/lib/mongodb.js"
click node_supabase "https://github.com/vivek-kanjariya/deepceramics/blob/main/src/lib/supabase.js"
click node_middleware "https://github.com/vivek-kanjariya/deepceramics/blob/main/middleware.js"
click node_analytics_client "https://github.com/vivek-kanjariya/deepceramics/blob/main/src/components/AnalyticsTracker.jsx"
click node_analytics_pageview "https://github.com/vivek-kanjariya/deepceramics/blob/main/TEMP/analytics/pageview/route.js"
click node_analytics_search "https://github.com/vivek-kanjariya/deepceramics/blob/main/TEMP/analytics/analytics/search/route.js"
click node_seo "https://github.com/vivek-kanjariya/deepceramics/blob/main/src/app/sitemap.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_shell,node_navigation,node_catalog_routes,node_product_detail,node_gallery,node_inquiry_form,node_contact_page,node_seo toneBlue
class node_admin,node_tile_upload,node_sanity_studio,node_sanity_schema toneAmber
class node_tile_api,node_contact_api,node_mongodb,node_supabase,node_middleware toneMint
class node_analytics_client,node_analytics_pageview,node_analytics_search toneRose
```

## Components

### Public experience

- [App shell](https://github.com/vivek-kanjariya/deepceramics/blob/main/src/app/layout.js): Next App Router · Provides shared styling and global UI. · `src/app/layout.js`
- [Navigation & state](https://github.com/vivek-kanjariya/deepceramics/blob/main/src/components/Navbar.jsx): shared UI · `src/components/Navbar.jsx`
- [Catalog routes](https://github.com/vivek-kanjariya/deepceramics/blob/main/src/app/tiles/%5Bslug%5D/page.jsx): route pages · Tile listing/detail and product browsing pages. · `src/app/tiles/[slug]/page.jsx`
- [Product detail](https://github.com/vivek-kanjariya/deepceramics/blob/main/src/app/products/%5Bslug%5D/page.js): route page · `src/app/products/[slug]/page.js`
- [Gallery](https://github.com/vivek-kanjariya/deepceramics/blob/main/gallery/page.js): route page · `gallery/page.js`
- [Inquiry form](https://github.com/vivek-kanjariya/deepceramics/blob/main/src/components/inquiry/InquiryForm.jsx): client component · Reusable quote and inquiry capture. · `src/components/inquiry/InquiryForm.jsx`
- [Contact page](https://github.com/vivek-kanjariya/deepceramics/blob/main/src/app/contact/page.jsx): route page · `src/app/contact/page.jsx`
- [SEO metadata](https://github.com/vivek-kanjariya/deepceramics/blob/main/src/app/sitemap.js): App Router metadata · Generates sitemap and crawler directives. · `src/app/sitemap.js`

### Content & administration

- [Admin area](https://github.com/vivek-kanjariya/deepceramics/blob/main/src/app/admin/layout.jsx): authenticated routes · Dashboard, tile management, and uploads. · `src/app/admin/layout.jsx`
- [Tile upload service](https://github.com/vivek-kanjariya/deepceramics/blob/main/src/lib/uploadTile.js): data library · Handles individual and bulk tile uploads. · `src/lib/uploadTile.js`
- [Sanity Studio](https://github.com/vivek-kanjariya/deepceramics/blob/main/src/app/studio/%5B%5B...tool%5D%5D/page.tsx): embedded CMS · Editor interface for blog content. · `src/app/studio/[[...tool]]/page.tsx`
- [Sanity schemas](https://github.com/vivek-kanjariya/deepceramics/blob/main/src/sanity/schemaTypes/index.ts): CMS schema · Posts, authors, categories, and rich content. · `src/sanity/schemaTypes/index.ts`

### Server boundaries

- [Tile API](https://github.com/vivek-kanjariya/deepceramics/blob/main/src/app/api/tiles/route.js): route handler · Abstracts tile persistence and retrieval. · `src/app/api/tiles/route.js`
- [Contact endpoints](https://github.com/vivek-kanjariya/deepceramics/blob/main/src/app/api/contact/route.js): route handlers · Server-side delivery or persistence boundary for contact submissions. · `src/app/api/contact/route.js`
- [MongoDB integration](https://github.com/vivek-kanjariya/deepceramics/blob/main/src/lib/mongodb.js): database adapter · Domain authority is not established. · `src/lib/mongodb.js`
- [Supabase integration](https://github.com/vivek-kanjariya/deepceramics/blob/main/src/lib/supabase.js): database adapter · Domain authority is not established. · `src/lib/supabase.js`
- [Middleware](https://github.com/vivek-kanjariya/deepceramics/blob/main/middleware.js): access policy · Likely applies routing or admin access controls. · `middleware.js`

### Analytics

- [Analytics client](https://github.com/vivek-kanjariya/deepceramics/blob/main/src/components/AnalyticsTracker.jsx): tracker and hook · Captures page, search, filter, tile-view, and quote events. · `src/components/AnalyticsTracker.jsx`
- [Pageview handler](https://github.com/vivek-kanjariya/deepceramics/blob/main/TEMP/analytics/pageview/route.js): route handler · Alternate or transitional analytics endpoint tree. · `TEMP/analytics/pageview/route.js`
- [Search handler](https://github.com/vivek-kanjariya/deepceramics/blob/main/TEMP/analytics/analytics/search/route.js): route handler · Nested duplicate-looking analytics endpoint. · `TEMP/analytics/analytics/search/route.js`

## Connections

- App shell → Navigation & state: renders
- App shell → Catalog routes: hosts
- App shell → Analytics client: initializes
- App shell → SEO metadata: publishes
- Catalog routes → Product detail: navigates to
- Catalog routes → Inquiry form: embeds
- Catalog routes → Tile API: loads tiles
- Gallery → Tile API: uses catalog data
- Contact page → Inquiry form: uses
- Inquiry form → Contact endpoints: submits
- Admin area → Tile upload service: manages uploads
- Admin area → Tile API: manages tiles
- Middleware → Admin area: guards
- Tile upload service → Tile API: persists through
- Tile API → MongoDB integration: may use
- Tile API → Supabase integration: may use
- Sanity Studio → Sanity schemas: loads schemas
- Analytics client → Pageview handler: sends page views
- Analytics client → Search handler: sends search events
