Next.jsReact电商企业官网

cravejs-web-template — Next.js 电商模板

作者 craveup-oss

基于 Next.js 与 React 的餐厅点餐店面模板,包含菜单浏览、购物车、结账交接与多套主题预设,附带烘焙店视觉示例。

看看你的网站会是什么样

浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。

2 个预览视图
桌面端首页1 / 2
桌面端截图首屏预览

由服务器浏览器实际访问页面后截取。

全部页面与视图 2

截图用于了解视觉与布局,交互效果请以实际项目为准。

采集于 2026-10-01查看来源

值得关注的模板亮点

从已有项目资料中,快速了解它的特点。

01

提供烘焙店视觉预设与桌面、移动端截图,可本地以 fixture 模式浏览响应式店面

02

内置菜单浏览、嵌套修饰符、购物车、自取/配送与结账交接等示例流程

03

六套生成式主题与四个视觉预设,共用同一套店面路由与商务逻辑

04

服务端计算金额,UI 仅渲染返回的展示字段,不自行计算总价

05

区分 hosted-multitenant 与 standalone-cli 两种部署配置方式

06

MIT 许可,允许免费使用、修改、商用与分发该版本代码

模板详细介绍

这是一个面向餐厅点餐场景的响应式 Next.js 店面模板,代码采用 MIT 许可。仓库提供烘焙店视觉预设(Leclerc Bakery,内容与菜品为虚构,食物摄影由 AI 生成),并配有桌面端与移动端截图,可通过本地 fixture 模式在无需 Crave 凭据的情况下浏览菜单、修饰符、购物车、自取、配送与结账交接等示例流程。

模板包含菜单与商品契约、嵌套修饰符规则、服务端计算的金额、购物车冲突恢复、结账前检查与跳转到 Crave 托管结账等能力;同时提供六套生成式主题(base、ember、hearth、meadow、noir、signal)与四个视觉预设(bakery-editorial、noodle-house、sushi-atelier、counter-service)。

需要注意的限制:仓库说明中的 API 后端烘焙店尚未完成部署,示例站点 cravejs-web-template.vercel.app 只是视觉示例,不能作为 API 后端已上线的证据;独立 CLI 生成器尚未发布,standalone-cli 配置生成契约仍待实现;堂食与客房服务 UI 仅为 fixture 预览,已完成订单的详情持久化、终端订单与收据处理仍受外部条件限制。演示图片、字体、图标等第三方素材需单独核对许可。

Next.jsReact电商企业官网

适合你的项目吗?

适用场景

  • 为餐厅或烘焙店搭建可自定义菜单、主题与内容的点餐店面
  • 在本地无凭据环境下体验菜单、购物车、自取、配送与结账交接的示例流程
  • 以现有主题和预设为起点,替换摄影、字体与商户内容形成品牌视觉
  • 作为评估 Crave.js 店面 API 契约与 SDK 集成方式的参考实现

适合人群

  • 需要 Next.js 餐厅点餐店面起点的开发者或代理机构
  • 希望复用菜单、购物车与结账交接逻辑、只专注视觉与内容定制的团队
  • 需要多主题、多视觉预设且不想为每个概念复制商务代码的项目

上手与定制指南

结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。

  1. 1

    本地运行需 Node.js 24 与 pnpm 10.33.2,执行 corepack enable 与 pnpm install --frozen-lockfile

  2. 2

    使用 pnpm dev:fixtures --profile standalone-cli --tenant fixture-base 启动 fixture 模式,无需 Crave 凭据

  3. 3

    烘焙店预览地址为 /design-system-preview?preset=bakery-editorial&controls=0,fixture 模式标注 NO LIVE ORDERS 且不发起真实 API 请求

  4. 4

    API 后端模式需复制 .env.example 为 .env.local 并替换四个 NEXT_PUBLIC_CRAVEUP_* 公共值,且不得在前端或仓库中加入 Crave 管理 API 密钥、Stripe 密钥、数据库地址或 OAuth 令牌

  5. 5

    示例指向的 Crave External Sandbox 租户需完成入驻与目录发布后菜单才能加载,应用不会在失败时用预览数据替代

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。

使用时需要遵守

  • 允许免费使用、修改、商用和分发该版本代码。
  • 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
  • 代码按现状提供;担保与责任限制以原许可证及适用法律为准。

额外费用与待核对事项

  • API 后端模式依赖 Crave External Sandbox 租户完成入驻与目录发布后菜单才能加载;加载失败时应用不会用预览数据替代,因此该模式在租户就绪前不可用。
  • standalone-cli 配置生成所依赖的独立 crave CLI 生成器尚未发布,因此该部署配置路径目前无法按文档所述方式使用。
  • 堂食与客房服务界面仅为 fixture 预览,已完成订单的详情持久化受外部条件限制,不能用于真实业务。
  • 终端订单与收据处理受外部条件限制,当前版本不提供该能力。
  • 公开的视觉示例站点并不代表 API 后端烘焙店已部署,不能据此认为后端集成已可用。
  • 禁止在前端或仓库中加入 Crave 管理 API 密钥、Stripe 密钥、数据库地址或 OAuth 令牌。
  • 模板自身的设计流水线与内部门禁测试套件不在公开快照中,公开版本只能运行文档列出的命令。
  • 代码与文档变更需以 PR 形式提交,由维护者应用到工程源仓库后再同步回本仓库,不能直接在本仓库合并生效。
  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

That tenant must finish onboarding and catalog publication before the API-backed menu can load; the app does not substitute preview data on failure.

README 原文

The approved contract requires the separate `crave` CLI to consume an immutable release of this repository and emit validated public configuration plus exact `.crave/storefront-template.json` provenance. That generator has not shipped yet.

README 原文

Tableside and room-service UI is a fixture-backed preview; completed-order detail persistence remains externally gated.

README 原文

Terminal order/receipt handling remains externally gated.

README 原文

The earlier visual sample at `cravejs-web-template.vercel.app` is not evidence that the API-backed bakery has been deployed.

README 原文

Never add a Crave administrative API key, Stripe secret, database URL or OAuth token to the frontend or repository.

README 原文

The template's own design pipeline and internal gate suites are not part of the public snapshot, so the commands above are the complete set it can run.

README 原文

Send code and documentation changes here as pull requests; maintainers apply accepted changes to the engineering source, and the next sync brings them back into this repository.

README 原文
https://github.com/craveup-oss/cravejs-web-template/blob/main/LICENSEhttps://github.com/craveup-oss/cravejs-web-template/blob/main/README.md

DeepSeek 根据仓库许可证和 README 整理 ·2026-10-01。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。

项目核对记录与介绍依据

模板资料

来源平台
GitHub
资料与维护参考分
资料较完整 · 88 / 100
技术栈
Next.js · React
网站类型
电商 · 企业官网
这个分数如何计算

本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。

这个项目需要核对什么

记录的仓库更新时间
2026-10-01
截图检查日期
2026-10-01

已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。

目录记录的主要技术栈是 Next.js。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。

查看具体选型方法 →

介绍的制作与核对状态

介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。

已完成服务器许可规则与 AI 来源核对;未经过人工编辑审核。

查看当时使用的来源资料

SHA-256: 2aeb03b9205ca4aa2481afc342511e067218bd0e275c97be80966ef82ce4b5a9

2026-10-01T15:20:54.388Z

来源文件 / 仓库
# Crave.js Web Storefront

A responsive Next.js storefront for restaurant ordering. Make the menu, photography,
and guest experience your own, with a shared commerce core for carts, fulfillment,
and hosted checkout.

**Bakery storefront implementation — external sandbox deployment pending acceptance**
· [Run it locally](#run-the-bakery-preview)
· [Documentation](https://docs.craveup.com)
· [Storefront API contract](docs/contracts/STOREFRONT-API.md)

Next.js 16 · React 19 · Tailwind CSS v4 · TypeScript · MIT

## See the storefront

Meet **Leclerc Bakery**, the included Bakery Editorial visual preview. These are
captures of the running template at desktop and mobile web sizes.

<table>
  <tr>
    <th>Desktop</th>
    <th>Mobile web</th>
  </tr>
  <tr>
    <td valign="top"><a href="docs/images/storefront-desktop.webp"><img src="docs/images/storefront-desktop.webp" alt="Leclerc Bakery desktop storefront with a split editorial hero, golden pastries, and sample menu" width="660" /></a></td>
    <td valign="top"><a href="docs/images/storefront-mobile.webp"><img src="docs/images/storefront-mobile.webp" alt="The same bakery storefront on mobile web, with stacked photography and content" width="190" /></a></td>
  </tr>
</table>

Open the [live bakery storefront](https://cravejs-web-template.vercel.app) and resize
your browser to explore its responsive layout, or select either screenshot to view it at full size.

Leclerc Bakery and its menu are fictional; the food photography is AI-generated.
This preset demonstrates the responsive design. The separate ordering fixtures let
you explore menus, modifiers, carts, pickup, delivery, and checkout handoff without
credentials or live orders.

## Run the bakery preview

Use **Node.js 24** and **pnpm 10.33.2**. No Crave credentials are needed.

```bash
git clone https://github.com/craveup-oss/cravejs-web-template.git
cd cravejs-web-template
corepack enable
pnpm install --frozen-lockfile
pnpm dev:fixtures --profile standalone-cli --tenant fixture-base
```

Open **[the bakery preview](http://localhost:3000/design-system-preview?preset=bakery-editorial&controls=0)**
to see the pictured storefront. Resize your browser to explore its mobile layout.

Open **[the ordering fixtures](http://localhost:3000)** to try the separate sample
ordering flow. Fixture mode is labeled **NO LIVE ORDERS**, makes no live API
requests, and disables Google Maps lookups even if a local environment contains a
browser key.

### Run the API-backed bakery

The bakery preset now applies to the real ordering route. `/` and `/menu` resolve the
configured location after verifying it belongs to the merchant. Products, prices and
menu photography come from Crave; the design preview remains a separate visual sample.

```bash
cp .env.example .env.local
pnpm dev
```

The example points to the dedicated **Crave External Sandbox** tenant. It contains
public IDs and origins only. That tenant must finish onboarding and catalog publication
before the API-backed menu can load; the app does not substitute preview data on failure.
The sandbox notice makes clear that no real pickup or delivery takes place.

For another business, replace the four `NEXT_PUBLIC_CRAVEUP_*` settings and edit
`src/config/standalone-settings.ts`. Never add a Crave administrative API key, Stripe
secret, database URL or OAuth token to the frontend or repository.

### Deploy the bakery demo

The intended hostname is `https://leclerc-bakery.order.page`, serving **this OSS
repository**, connected to `https://sandbox-api.craveup.com`. Its checkout allowlist
is `https://checkout.sandbox.order.page`. Neither internal development nor production
is the demo's backend. The existing hostname has not yet been promoted to this branch.

See [the implementation and release checklist](docs/LECLERC-SANDBOX.md). Run
`pnpm verify`, `pnpm build`, then `pnpm verify:sandbox-demo` with the deployment
environment loaded. The final command performs credential-free public SDK reads and
fails unless the correct tenant's published menu includes both pastry photographs.

The earlier visual sample at `cravejs-web-template.vercel.app` is not evidence that
the API-backed bakery has been deployed. Keep `DESIGN_SYSTEM_PREVIEW` and fixture
runtime settings unset on the bakery deployment.

## Why teams start here

| You should get to design | You should not have to rebuild |
|---|---|
| Your restaurant's voice, photography, content, layout and theme | Menu and product contracts, nested modifier rules and server-calculated money |
| The moments that make the brand memorable | Cart authority, conflict recovery, session isolation and checkout handoff safety |
| The right experience for each location and service model | Pickup and delivery flows, plus preview-only tableside and room-service states |
| The extensions that make the storefront yours | Accessibility, localization, SEO, consent and credential boundaries |

The result is room for a distinctive restaurant experience without forking the commerce logic every
time the visual direction changes.

## Choose a visual direction

The template ships six generated theme systems—`base`, `ember`, `hearth`, `meadow`, `noir` and
`signal`—over one shared set of storefront routes and commerce behavior. Themes are selected from
validated merchant configuration, rendered on the server and tested without an unthemed first paint.

Use a theme as the starting point, then change documented theme inputs, public fonts, photography,
merchant content and exported composition slots. A visual concept does not need its own copy of the
SDK integration, cart or checkout code.

### Bakery preview and imagery

The Bakery Editorial preset includes AI-generated bakery photography and fictional
Leclerc Bakery sample content. Run the fixture server, then open
`/design-system-preview?preset=bakery-editorial&controls=0` to explore the responsive
visual preview. Ordering tests continue to use the canonical fixture menu. Other
presets ship repository-authored SVG placeholders. Every shipped asset is recorded with its SHA-256 digest in
[`distribution/asset-ownership.json`](distribution/asset-ownership.json), and the release gate rejects
any image whose rights are not confirmed. Replace the placeholders with your own photography.

## What is included

- **Browse and decide:** restaurant/location bootstrap, timed menus, categories, local search,
  product detail, availability, nutrition and nested modifiers.
- **Build and recover a cart:** server-authoritative totals, quantity changes, item notes,
  recommendations, discounts, tips and explicit retry after conflicts or stale state.
- **Choose how to order:** pickup now/later and delivery are wired. Tableside and room-service UI is
  a fixture-backed preview; completed-order detail persistence remains externally gated.
- **Complete the handoff:** checkout preflight and exact-origin navigation to Crave-hosted checkout;
  no Stripe or provider secrets in the storefront.
- **Come back recognized:** OTP account entry, account details, addresses, order history and
  capability-gated loyalty. Terminal order/receipt handling remains externally gated.
- **Ship with confidence:** responsive and 200% zoom coverage, keyboard/accessibility checks,
  localization and timezone rules, SEO, consent-aware telemetry and tested failure states.

## Pick a deployment profile

| Profile | Best for | Configuration authority |
|---|---|---|
| `hosted-multitenant` | Crave-managed storefronts and custom domains | A trusted server-only exact-host registry |
| `standalone-cli` | A restaurant or agency-owned Next.js project | One validated generated storefront config |

Both profiles use the same SDK adapters, commerce behavior, components, themes and fixtures. Only
bootstrap and distribution differ.

Copy [`.env.example`](.env.example) to `.env.local`, choose exactly one profile and replace every
example public value. The browser API origin must exactly match the selected `apiBaseUrl`. Never add
`CRAVE_API_KEY`, `NEXT_PUBLIC_CRAVEUP_API_KEY`, customer sessions, cart/receipt capabilities or
payment-provider values.

### Hosted multitenant

The runtime resolves a trusted host or custom domain to validated tenant configuration. Unknown hosts
fail closed before API reads. Tenant identity participates in cache, theme, metadata, canonical URL,
robots/sitemap, structured data and asset decisions so one merchant cannot leak into another.

### Standalone CLI

The approved contract requires the separate `crave` CLI to consume an immutable release of this
repository and emit validated public configuration plus exact `.crave/storefront-template.json`
provenance. That generator has not shipped yet. When it does, it will not import the hosted registry,
generate from a mutable branch, or read a private repository or API key. Upgrades dry-run and diff,
and never silently overwrite user-owned extensions.

See [`docs/contracts/GENERATED-STARTER.md`](docs/contracts/GENERATED-STARTER.md) for the exact
generated-project contract.

## Concept presets

One storefront product and one commerce core. Four visual presets preserve useful design ideas from
earlier public storefront experiments without carrying forward their SDK 1.x, API-key, Stripe, cart
or checkout implementations.

| Preset | Default theme | Home composition |
|---|---|---|
| `bakery-editorial` | Hearth | Editorial product story |
| `noodle-house` | Ember | Immersive food hero |
| `sushi-atelier` | Noir | Split editorial grid |
| `counter-service` | Signal | Service-first ordering |

Start either fixture profile, then open `/design-system-preview?preset=bakery-editorial` and switch
presets from the preview toolbar.

## Shared architecture

- **Direct public API:** no Crave BFF and no browser API key.
- **Two SDK clients:** Server Components perform anonymous reads; client islands perform stateful
  calls through the exact SDK 2.x browser client.
- **Typed bootstrap:** hosted trusted registry and standalone generated config implement one
  `TenantResolver`/resolved-config boundary.
- **Capability lifecycle:** cart revisions/capabilities and customer/receipt sessions stay tab-scoped
  in versioned adapters.
- **Capability-gated loyalty:** a disabled or unavailable provider never blocks ordering or checkout.
- **Conflict-safe mutations:** conflicts refresh authoritative state and require explicit customer
  retry; safe lost-response transport retries reuse the identical body and key.
- **Server-calculated money:** the UI renders returned display fields and never calculates totals.
- **Server-rendered theming:** six generated theme blocks with no unthemed first paint. `?theme=` is
  labeled preview-only and ignored in production.
- **Recovery as a contract:** refresh/back, duplicate tabs, expiry, offline, price/inventory/time
  drift, OTP limits and hosted-handoff states are finite tested behavior.

Read the [Storefront API contract](docs/contracts/STOREFRONT-API.md) and the
[generated-starter contract](docs/contracts/GENERATED-STARTER.md) before writing application code.
The pinned OpenAPI document is [`docs/contracts/storefront-api.openapi.json`](docs/contracts/storefront-api.openapi.json).

## Verification

| Command | Purpose |
|---|---|
| `pnpm verify` | lint and typecheck gate for this repository |
| `pnpm lint` | ESLint across the template |
| `pnpm typecheck` | Next.js typegen plus `tsc --noEmit` |
| `pnpm build` | production build |
| `pnpm profile:smoke` | production server smoke for the selected profile after `pnpm build` |
| `pnpm distribution:payload` | build the deterministic CLI payload archive |
| `pnpm release:assemble -- --release <semver> --released-at <UTC> --output <absolute-path>` | assemble a deterministic release artifact and manifest from a clean exact commit |

This repository carries the application and its release tooling. The template's own design pipeline
and internal gate suites are not part of the public snapshot, so the commands above are the complete
set it can run.

## Provenance

This repository is generated. Each commit is a validated snapshot of a reviewed private engineering
commit, and [`.crave/source.json`](.crave/source.json) records the exact source repository and
commit. Release tags are created only from a commit on `main` after an approval-gated workflow
reverifies the tree, so a published release names the precise bytes it was built from.

Send code and documentation changes here as pull requests; maintainers apply accepted changes to the
engineering source, and the next sync brings them back into this repository.

## Community, support and sponsorship

- Read [CONTRIBUTING.md](CONTRIBUTING.md) before proposing code or documentation changes.
- Report vulnerabilities privately using [SECURITY.md](SECURITY.md), never through a public issue.
- Use [SUPPORT.md](SUPPORT.md) to distinguish reproducible project bugs from Crave implementation
  services and legacy-storefront questions.
- Read [GOVERNANCE.md](GOVERNANCE.md) for maintainer, release and sponsor decision boundaries.
- Participation is governed by [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).

## License

[MIT](LICENSE) © Crave Up, Inc.
反馈内容错误

看看同类模板

对比同技术栈与用途的模板,找到更适合的视觉与内容结构。