Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ These endpoints are publicly accessible and require no authentication.
| `/api/collections/:id` | `GET` | Get single collection | None |
| `/api/collections/:id/products` | `GET` | Get products in collection | None |
| `/api/store-settings` | `GET` | Get store configuration | None |
| `/api/storefront/pages/:slug` | `GET` | Get Puck page-builder content for `home` or `about` | None |

## Checkout Endpoints

Expand All @@ -35,6 +36,7 @@ These endpoints require admin authentication via the `X-Admin-Token` header.
| `/api/admin/products` | `POST` | Create product | Admin Token |
| `/api/admin/products/:id` | `PUT, DELETE` | Update/delete product | Admin Token |
| `/api/admin/store-settings` | `PUT` | Update store settings | Admin Token |
| `/api/admin/storefront/pages/:slug` | `GET, PUT` | Load or publish Puck page-builder content for `home` or `about` | Admin Token |
| `/api/analytics` | `GET` | Revenue and order analytics | Admin Token |
| `/api/admin/ai/generate-image` | `POST` | Generate image via Gemini | Admin Token |
| `/api/admin/drive/status` | `GET` | Google Drive connection status | Admin Token |
Expand Down
2 changes: 2 additions & 0 deletions docs/FRONTEND.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ React 19 + Vite + Tailwind CSS 4 + ShadCN-style components under `src/components
src/pages/storefront/ # Public shop pages
src/pages/admin/ # Admin shell (AdminDashboard, AdminLayout) + feature pages
src/components/storefront/
src/components/storefront/page-builder/ # Puck config + render-only storefront blocks
src/components/admin/store-settings/ # Shared store settings / theme form helpers
src/components/admin/
src/components/ui/ # Shared primitives (button, card, input, …)
Expand All @@ -29,6 +30,7 @@ src/api/ # Fetch wrappers for public/admin APIs
- **Images:** Use `normalizeImageUrl` from `src/lib/utils.js` for consistent CDN/proxy URLs.
- **Admin auth:** `adminApiRequest` attaches `X-Admin-Token` from session storage.
- **Cart:** `CartContext` persists to `localStorage`.
- **Page builder:** Home/About content is stored as Puck JSON from `/api/storefront/pages/:slug`; `Navbar`, `Footer`, product pages, collection pages, cart, and checkout remain outside Puck.

## Routing

Expand Down
25 changes: 25 additions & 0 deletions docs/generated/kv-data-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
| `collection:{id}` | Collection document |
| `collection:products:{collectionId}` | JSON array of product IDs in collection |
| `media:{id}` | Media metadata record |
| `storefront:page:{slug}` | Puck page-builder document for `home` or `about` |

## Product shape (typical)

Expand Down Expand Up @@ -60,6 +61,30 @@
}
```

## Storefront page shape

```json
{
"slug": "home",
"version": 1,
"updatedAt": "2026-05-28T00:00:00.000Z",
"data": {
"content": [
{
"type": "HeroSection",
"props": {
"id": "home-hero",
"title": "Welcome to OpenShop"
}
}
],
"root": {
"props": {}
}
}
}
```

## Settings and auth

Store settings and admin tokens may use additional keys via `src/services/StoreSettingsService.js` and auth middleware—grep `namespace.put` in `src/` when extending this doc.
Expand Down
1 change: 1 addition & 0 deletions docs/product-specs/core-ecommerce.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Storefront browse, cart, Stripe checkout, and admin CRUD for products and collec
- Login at `/admin` with password → token.
- CRUD products (images, variants, archive) and collections (hero image).
- Store settings: branding, theme-related fields.
- Website editor: Home and About page content use Puck JSON stored in KV; products, collections, cart, checkout, navigation, and footer remain code-owned storefront behavior.
- Analytics: revenue/orders from Stripe (admin-only).

## Out of scope
Expand Down
Loading
Loading