Ready-to-run storefront: catalog, cart, checkout, payments, orders and an admin panel.
Find a file Use this template
w4c-templates 228f2f01f2
Some checks failed
CI / quality (push) Has been cancelled
chore(template): publish Store.Nuxt
2026-10-11 23:24:30 +03:00
.github/workflows chore(template): publish Store.Nuxt 2026-10-11 23:24:30 +03:00
.w4c chore(template): publish Store.Nuxt 2026-10-11 23:24:30 +03:00
app chore(template): publish Store.Nuxt 2026-10-11 23:24:30 +03:00
docker chore(template): publish Store.Nuxt 2026-10-11 23:24:30 +03:00
prisma chore(template): publish Store.Nuxt 2026-10-11 23:24:30 +03:00
public chore(template): publish Store.Nuxt 2026-10-11 23:24:30 +03:00
server chore(template): publish Store.Nuxt 2026-10-11 23:24:30 +03:00
shared chore(template): publish Store.Nuxt 2026-10-11 23:24:30 +03:00
tests chore(template): publish Store.Nuxt 2026-10-11 23:24:30 +03:00
.dockerignore chore(template): publish Store.Nuxt 2026-10-11 23:24:30 +03:00
.env.example chore(template): publish Store.Nuxt 2026-10-11 23:24:30 +03:00
.gitignore chore(template): publish Store.Nuxt 2026-10-11 23:24:30 +03:00
eslint.config.mjs chore(template): publish Store.Nuxt 2026-10-11 23:24:30 +03:00
nuxt.config.ts chore(template): publish Store.Nuxt 2026-10-11 23:24:30 +03:00
package-lock.json chore(template): publish Store.Nuxt 2026-10-11 23:24:30 +03:00
package.json chore(template): publish Store.Nuxt 2026-10-11 23:24:30 +03:00
README.md chore(template): publish Store.Nuxt 2026-10-11 23:24:30 +03:00
tsconfig.json chore(template): publish Store.Nuxt 2026-10-11 23:24:30 +03:00
vitest.config.ts chore(template): publish Store.Nuxt 2026-10-11 23:24:30 +03:00

Online Store — Nuxt 3 (templates2)

A ready-to-run storefront forked from templates2.Base.Nuxt: catalog, cart, checkout with the built-in mock payment provider, customer orders and a product/order admin. Feature-parity with templates2.Store.Next.

Quickstart

npm ci
cp .env.example .env          # SQLite + mock providers by default — no keys needed
npm run db:setup              # prisma db push + seed (3 categories, 12 products, 2 orders)
npm run dev                   # http://localhost:3000

Demo accounts (seeded): admin@example.com (admin) and customer@example.com (customer) — password password.

Flow

/shop (search, category filters, sort, pagination) → /shop/[slug] (variants, stock, JSON-LD Product) → /cart (persists in localStorage via plugins/cart.client.ts) → /checkout (mock payment, no keys) → order confirmation → /orders. Admin: /admin/products (CRUD, stock, hide/show) and /admin/orders (status transitions).

What this case adds over the base

  • Data model — Category, Product (price in minor units, stock, JSON variants), Order, OrderItem.
  • Server-side validation — shared/cart.ts recomputes every line's price from the database, matches variants and rejects over-stock quantities; POST /api/checkout creates the order, decrements inventory and (on the mock provider) marks it paid.
  • Cart — useCart() state persisted by a client plugin, so it survives reloads.
  • Admin — product CRUD and order status transitions, all role-gated.
  • SEO — Product/Offer JSON-LD per product and a sitemap that includes every active product.
  • Artwork — a cohesive set of generated product/editorial photos in public/art/ (hero, collection tiles, lookbook, CTA/OG and one shot per seeded product), rendered by <ProductImage>, which falls back to the emoji placeholder when a product has no image. Prompts live in ../tools/art/store.json; regenerate the set with node ../tools/generate-images.mjs ../tools/art/store.json --out /tmp/store-art (needs OPENROUTER_API_KEY), then convert to WebP into public/art/.

Tests

  • Unit: tests/unit/cart.test.ts — totals, variant deltas, empty cart, unknown product/variant, over-stock rejection.
  • E2E smoke: tests/e2e/smoke.mjs — catalog, filters, checkout validation and a full mock checkout.

Quality

node templates2/qa.mjs Store.Nuxt

See ../CONTRACT.md for the Definition of Done.