commerce README

The project's README from github.com/vercel/commerce. As one markdown file: README.md.

Deploy with Vercel

Next.js Commerce

A high-performance, server-rendered Next.js App Router ecommerce application.

This template uses React Server Components, Server Actions, Suspense, useOptimistic, and more.

Note: Looking for Next.js Commerce v1? View the code, demo, and release notes.

Providers

Vercel will only be actively maintaining a Shopify version as outlined in our vision and strategy for Next.js Commerce.

Vercel is happy to partner and work with any commerce provider to help them get a similar template up and running and listed below. Alternative providers should be able to fork this repository and swap out the lib/shopify file with their own implementation while leaving the rest of the template mostly unchanged.

Note: Providers, if you are looking to use similar products for your demo, you can download these assets.

Integrations

Integrations enable upgraded or additional functionality for Next.js Commerce

Running locally

You will need to use the environment variables defined in .env.example to run Next.js Commerce. It's recommended you use Vercel Environment Variables for this, but a .env file is all that is necessary.

Note: You should not commit your .env file or it will expose secrets that will allow others to control your Shopify store.

  1. Install Vercel CLI: npm i -g vercel
  2. Link local instance with Vercel and GitHub accounts (creates .vercel directory): vercel link
  3. Download your environment variables: vercel env pull
pnpm install
pnpm dev

Your app should now be running on localhost:3000.

Expand if you work at Vercel and want to run locally and / or contribute
  1. Run vc link.
  2. Select the Vercel Solutions scope.
  3. Connect to the existing commerce-shopify project.
  4. Run vc env pull to get environment variables.
  5. Run pnpm dev to ensure everything is working correctly.

Vercel, Next.js Commerce, and Shopify Integration Guide

You can use this comprehensive integration guide with step-by-step instructions on how to configure Shopify as a headless CMS using Next.js Commerce as your headless Shopify storefront on Vercel.

commerce (vercel/commerce)

Searching Database…

14.3K ·GitHub
这是什么?Next.js Commerce 是一个开源的、服务端渲染的电商店铺模板,基于 Next.js App Router 构建,使用 React Server Components、Server Actions、Suspense 和 useOptimistic,默认后端为 Shopify。
这是现成的网上商店,还是需要我自己基于它搭建的入门模板?它是一个入门模板/代码库,你需要 fork 后自行定制,而不是托管的 SaaS 店铺。你要把它连接到自己的 Shopify 店铺,并自行部署。
怎样在本地运行它?用 npm i -g vercel 安装 Vercel CLI,运行 vercel link 连接你的 Vercel/GitHub 账号,再运行 vercel env pull 下载 Shopify 环境变量;之后应用会运行在 localhost:3000。
使用它必须有自己的 Shopify 店铺吗?是的。默认情况下,模板通过 lib/shopify 模块与 Shopify 通信,运行时需要 .env.example 中的环境变量(即你的 Shopify 店铺密钥)。
我能轻松把 Shopify 换成其他电商后端吗?Vercel 只积极维护本仓库的 Shopify 版本。BigCommerce、Medusa、Saleor、Swell 和 Wix 等其他服务商各自有独立的演示 fork;如果要换用它们,需要 fork 本仓库,并自行重新实现 lib/shopify 层。
可以添加哪些可选集成?Orama 可以借助浏览器端或 CDN 的向量相似度搜索和输入预测来增强搜索;React Bricks 则提供可视化的无头 CMS,用于编辑页面、商品详情和页脚内容。
原来支持多服务商的 Next.js Commerce v1 怎么样了?旧版 v1(包括代码、演示和发布说明)作为独立的旧版本保留;本仓库是专注于 Shopify 的 App Router 重写版。
Creator
vercel
Size
10.9 MB
Stars
14.3K
Age
5y
Commits · 90 Days