# atomsveasna/atoms-store architecture

> Architecture diagram of the GitHub repository atomsveasna/atoms-store, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/atomsveasna/atoms-store
- Repository: https://github.com/atomsveasna/atoms-store

## Overview

atoms.store is a Next.js storefront for Atoms smart devices, with product browsing and detail pages, product documentation, and an admin product-entry area. The visible shopping path runs from storefront pages through product-data access to product presentation; the detail view delegates gallery, tabs, and cart interaction to client components. The README also describes checkout, orders, and webhooks, but those routes are absent from the supplied tree, so those capabilities are shown only at the documented subsystem level. Source excerpts do not establish database or payment-provider runtime wiring.

Main entry points: [`lib/data/products.ts`](https://github.com/atomsveasna/atoms-store/blob/dev/lib/data/products.ts) (Product data access), [`components/product/ProductDetailClient.tsx`](https://github.com/atomsveasna/atoms-store/blob/dev/components/product/ProductDetailClient.tsx) (Product detail), [`app/(shop)/products/[slug]/page.tsx`](https://github.com/atomsveasna/atoms-store/blob/dev/app/(shop)/products/%5Bslug%5D/page.tsx) (Product route), [`app/admin/page.tsx`](https://github.com/atomsveasna/atoms-store/blob/dev/app/admin/page.tsx) (Product admin page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_home["Home page<br/>[page.tsx]"]
  node_shop["Product listing<br/>[page.tsx]"]
  node_product_route["Product route<br/>[page.tsx]"]
  node_product_detail["Product detail"]
  node_gallery["Product gallery<br/>[ProductGallery.tsx]"]
  node_cart_action["Add to cart<br/>[AddToCart.tsx]"]
  node_product_tabs["Product tabs<br/>[ProductTabs.tsx]"]
  node_shop_layout["Shop layout<br/>[layout.tsx]"]
  node_header["Header<br/>[Header.tsx]"]
  node_footer["Footer<br/>[Footer.tsx]"]
end

subgraph group_catalog["Catalog"]
  node_product_data["Product data access<br/>[products.ts]"]
  node_seed_products["Seed catalog<br/>[products.ts]"]
  node_product_models["Product models<br/>[index.ts]"]
end

subgraph group_docs["Product docs"]
  node_docs_content["Product documentation"]
  node_docs_loader["MDX docs loader<br/>[docs.ts]"]
  node_docs_index["Docs index data<br/>[docs.ts]"]
end

subgraph group_admin["Product admin"]
  node_admin_page["Product admin page<br/>[page.tsx]"]
  node_add_form["Add product form<br/>[AddProductForm.tsx]"]
  node_admin_api["Product admin API<br/>[route.ts]"]
end

subgraph group_orders["Orders"]
  node_orders["Order handling<br/>[orders.ts]"]
  node_checkout["Checkout and order routes"]
  node_order_service["Order creation and webhooks"]
end

node_shopper(("Shopper"))
node_admin_user(("Admin user"))

node_shopper -->|"opens"| node_home
node_shopper -->|"browses"| node_shop
node_shopper -->|"views"| node_product_route
node_home -->|"loads featured"| node_product_data
node_shop -->|"loads products"| node_product_data
node_product_route -->|"loads product"| node_product_data
node_product_route -->|"renders"| node_product_detail
node_product_detail -->|"renders"| node_gallery
node_product_detail -->|"renders"| node_cart_action
node_product_detail -->|"renders"| node_product_tabs
node_product_data -->|"reads"| node_seed_products
node_product_data -->|"uses types"| node_product_models
node_shop_layout -->|"renders"| node_header
node_shop_layout -->|"renders"| node_footer
node_product_detail -->|"links to docs"| node_docs_content
node_docs_index -->|"uses loader"| node_docs_loader
node_admin_user -->|"manages catalog"| node_admin_page
node_admin_page -->|"loads products"| node_product_data
node_admin_page -->|"renders"| node_add_form
node_add_form -->|"POSTs product"| node_admin_api
node_shopper -.->|"checks out"| node_checkout
node_checkout -.->|"creates orders"| node_order_service
node_order_service -.->|"handles order data"| node_orders

click node_home "https://github.com/atomsveasna/atoms-store/blob/dev/app/(shop)/page.tsx"
click node_shop "https://github.com/atomsveasna/atoms-store/blob/dev/app/(shop)/shop/page.tsx"
click node_product_route "https://github.com/atomsveasna/atoms-store/blob/dev/app/(shop)/products/%5Bslug%5D/page.tsx"
click node_product_detail "https://github.com/atomsveasna/atoms-store/blob/dev/components/product/ProductDetailClient.tsx"
click node_gallery "https://github.com/atomsveasna/atoms-store/blob/dev/components/product/ProductGallery.tsx"
click node_cart_action "https://github.com/atomsveasna/atoms-store/blob/dev/components/product/AddToCart.tsx"
click node_product_tabs "https://github.com/atomsveasna/atoms-store/blob/dev/components/product/ProductTabs.tsx"
click node_shop_layout "https://github.com/atomsveasna/atoms-store/blob/dev/app/(shop)/layout.tsx"
click node_header "https://github.com/atomsveasna/atoms-store/blob/dev/components/layout/Header.tsx"
click node_footer "https://github.com/atomsveasna/atoms-store/blob/dev/components/layout/Footer.tsx"
click node_product_data "https://github.com/atomsveasna/atoms-store/blob/dev/lib/data/products.ts"
click node_seed_products "https://github.com/atomsveasna/atoms-store/blob/dev/lib/seed/products.ts"
click node_product_models "https://github.com/atomsveasna/atoms-store/blob/dev/types/index.ts"
click node_docs_content "https://github.com/atomsveasna/atoms-store/tree/dev/content/docs"
click node_docs_loader "https://github.com/atomsveasna/atoms-store/blob/dev/lib/docs.ts"
click node_docs_index "https://github.com/atomsveasna/atoms-store/blob/dev/lib/data/docs.ts"
click node_admin_page "https://github.com/atomsveasna/atoms-store/blob/dev/app/admin/page.tsx"
click node_add_form "https://github.com/atomsveasna/atoms-store/blob/dev/components/admin/AddProductForm.tsx"
click node_admin_api "https://github.com/atomsveasna/atoms-store/blob/dev/app/api/admin/products/route.ts"
click node_orders "https://github.com/atomsveasna/atoms-store/blob/dev/lib/data/orders.ts"
click node_checkout "https://github.com/atomsveasna/atoms-store/tree/dev/app/(shop)"
click node_order_service "https://github.com/atomsveasna/atoms-store/tree/dev/app/api"

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_shop,node_product_route,node_product_detail,node_gallery,node_cart_action,node_product_tabs,node_shop_layout,node_header,node_footer,node_admin_user toneBlue
class node_product_data,node_seed_products,node_product_models toneAmber
class node_docs_content,node_docs_loader,node_docs_index toneMint
class node_admin_page,node_add_form,node_admin_api toneRose
class node_orders,node_checkout,node_order_service,node_shopper toneIndigo
```

## Components

### Storefront

- [Home page](https://github.com/atomsveasna/atoms-store/blob/dev/app/(shop)/page.tsx): `app/(shop)/page.tsx`
- [Product listing](https://github.com/atomsveasna/atoms-store/blob/dev/app/(shop)/shop/page.tsx): `app/(shop)/shop/page.tsx`
- [Product route](https://github.com/atomsveasna/atoms-store/blob/dev/app/(shop)/products/%5Bslug%5D/page.tsx): `app/(shop)/products/[slug]/page.tsx`
- [Product detail](https://github.com/atomsveasna/atoms-store/blob/dev/components/product/ProductDetailClient.tsx): `components/product/ProductDetailClient.tsx`
- [Product gallery](https://github.com/atomsveasna/atoms-store/blob/dev/components/product/ProductGallery.tsx): `components/product/ProductGallery.tsx`
- [Add to cart](https://github.com/atomsveasna/atoms-store/blob/dev/components/product/AddToCart.tsx): `components/product/AddToCart.tsx`
- [Product tabs](https://github.com/atomsveasna/atoms-store/blob/dev/components/product/ProductTabs.tsx): `components/product/ProductTabs.tsx`
- [Shop layout](https://github.com/atomsveasna/atoms-store/blob/dev/app/(shop)/layout.tsx): `app/(shop)/layout.tsx`
- [Header](https://github.com/atomsveasna/atoms-store/blob/dev/components/layout/Header.tsx): `components/layout/Header.tsx`
- [Footer](https://github.com/atomsveasna/atoms-store/blob/dev/components/layout/Footer.tsx): `components/layout/Footer.tsx`

### Catalog

- [Product data access](https://github.com/atomsveasna/atoms-store/blob/dev/lib/data/products.ts): `lib/data/products.ts`
- [Seed catalog](https://github.com/atomsveasna/atoms-store/blob/dev/lib/seed/products.ts): `lib/seed/products.ts`
- [Product models](https://github.com/atomsveasna/atoms-store/blob/dev/types/index.ts): `types/index.ts`

### Product docs

- [Product documentation](https://github.com/atomsveasna/atoms-store/tree/dev/content/docs): `content/docs`
- [MDX docs loader](https://github.com/atomsveasna/atoms-store/blob/dev/lib/docs.ts): `lib/docs.ts`
- [Docs index data](https://github.com/atomsveasna/atoms-store/blob/dev/lib/data/docs.ts): `lib/data/docs.ts`

### Product admin

- [Product admin page](https://github.com/atomsveasna/atoms-store/blob/dev/app/admin/page.tsx): `app/admin/page.tsx`
- [Add product form](https://github.com/atomsveasna/atoms-store/blob/dev/components/admin/AddProductForm.tsx): `components/admin/AddProductForm.tsx`
- [Product admin API](https://github.com/atomsveasna/atoms-store/blob/dev/app/api/admin/products/route.ts): `app/api/admin/products/route.ts`

### Orders

- [Order handling](https://github.com/atomsveasna/atoms-store/blob/dev/lib/data/orders.ts): `lib/data/orders.ts`
- [Checkout and order routes](https://github.com/atomsveasna/atoms-store/tree/dev/app/(shop)): `app/(shop)`
- [Order creation and webhooks](https://github.com/atomsveasna/atoms-store/tree/dev/app/api): `app/api`

### Other components

- **Shopper**
- **Admin user**

## Connections

- Shopper → Home page: opens
- Shopper → Product listing: browses
- Shopper → Product route: views
- Home page → Product data access: loads featured (evidence: `app/(shop)/page.tsx`)
- Product listing → Product data access: loads products (evidence: `app/(shop)/shop/page.tsx`)
- Product route → Product data access: loads product (evidence: `app/(shop)/products/[slug]/page.tsx`)
- Product route → Product detail: renders (evidence: `app/(shop)/products/[slug]/page.tsx`)
- Product detail → Product gallery: renders (evidence: `components/product/ProductDetailClient.tsx`)
- Product detail → Add to cart: renders (evidence: `components/product/ProductDetailClient.tsx`)
- Product detail → Product tabs: renders (evidence: `components/product/ProductDetailClient.tsx`)
- Product data access → Seed catalog: reads (evidence: `lib/data/products.ts`)
- Product data access → Product models: uses types (evidence: `lib/data/products.ts`)
- Shop layout → Header: renders (evidence: `app/(shop)/layout.tsx`)
- Shop layout → Footer: renders (evidence: `app/(shop)/layout.tsx`)
- Product detail → Product documentation: links to docs (evidence: `components/product/ProductDetailClient.tsx`)
- Docs index data → MDX docs loader: uses loader (evidence: `lib/data/docs.ts`)
- Admin user → Product admin page: manages catalog
- Product admin page → Product data access: loads products (evidence: `app/admin/page.tsx`)
- Product admin page → Add product form: renders (evidence: `app/admin/page.tsx`)
- Add product form → Product admin API: POSTs product (evidence: `components/admin/AddProductForm.tsx`)
- Shopper → Checkout and order routes: checks out (evidence: `README.md`)
- Checkout and order routes → Order creation and webhooks: creates orders (evidence: `README.md`)
- Order creation and webhooks → Order handling: handles order data
