CaretCMS 官方演示主题,展示 Astro 站点接入 CaretCMS 的完整方式
sterling-district — Astro 电商模板
作者 web-stacked
Sterling District 是 CaretCMS 的官方演示主题,用 Astro 构建珠宝类电商店面,内容存于 Cloudflare KV、媒体存于 R2,并带内联编辑与 Studio 后台。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
全部页面与视图 3
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
内容由 src/content-schema.ts 中的 Zod schema 定义,可在 /admin/cms 的 Studio 编辑
内容存 Cloudflare KV(CMS_KV),媒体上传至 R2(CMS_R2)
模板通过 caretize 生成的 data-caret 属性支持内联编辑
自带种子页面、商品目录与详情、FAQ、评价和全局站点设置
前端使用 Tailwind CSS 4 服务端渲染,可部署到 Cloudflare Workers
模板详细介绍
Sterling District 是 CaretCMS 的官方演示主题,用于展示 CaretCMS 如何端到端接入一个 Astro 站点。主题面向珠宝类电商场景,自带种子页面(首页、系列、奢华、服务、联系)、带详情页的商品目录、FAQ、客户评价以及全局站点设置。内容结构由 src/content-schema.ts 中的 Zod schema 定义,可在 /admin/cms 的 Studio 中编辑;前端页面使用 Tailwind CSS 4 服务端渲染,内容存放在 Cloudflare KV(CMS_KV),媒体上传到 R2(CMS_R2),模板通过 caretize 生成的 data-caret 属性接入内联编辑。
使用方式上,它可以作为 CaretCMS + Cloudflare 站点的起点:克隆后替换种子内容,再部署到 Cloudflare Workers。本地开发需要 Node 20+ 与 npm,运行 npm run dev 后访问 /admin;未设置 CARET_EDIT_PASSWORD 时,开发密码会打印在终端。环境变量需同时写入 .env(Astro 读取)和 .dev.vars(Wrangler 读取),包括 CARET_EDIT_PASSWORD、CARET_SESSION_SECRET、R2_PUBLIC_DOMAIN,以及可选的 PUBLIC_CONTACT_FORM_ENDPOINT(不配置时联系表单仅为 UI)。部署前需创建 KV 命名空间与 R2 存储桶,复制 wrangler.production.toml.example 并填入 KV id 与 R2 桶名,再执行 npm run deploy:production;编辑者认证通过 wrangler secret 在 Cloudflare 侧设置。
需要注意的限制:@caretcms/core 的 peer 依赖范围是 Astro 5/6,而该主题使用 Astro 7,因此 .npmrc 中设置了 legacy-peer-deps=true;astro build 可能对 @caretcms/cloudflare 0.1.x 的 provider 导出给出警告,这些导出在运行时解析。仓库采用 MIT 许可,免费范围是该版本代码,演示图片、字体、图标等第三方素材以及域名、托管、数据库、支付或 AI 等外部服务需另行核对许可与费用。
适合你的项目吗?
适用场景
- 作为 CaretCMS + Cloudflare 站点的起始模板,替换种子内容后搭建自己的店面
- 演示 Astro 项目如何用 Zod schema 定义内容并在 Studio 中编辑
- 演示内容存 KV、媒体存 R2 的 Cloudflare 部署结构
- 作为珠宝类电商页面(首页、系列、商品详情、服务、联系)的参考实现
适合人群
- 需要 CaretCMS 与 Cloudflare Workers 组合示例的开发者
- 准备以 Astro 搭建内容可编辑电商站点的团队
- 希望参考 Zod schema 与内联编辑接入方式的 Astro 项目
- 需要珠宝类电商页面结构参考的开发者
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
需要 Node 20+ 与 npm;本地运行 npm install 后执行 npm run dev,访问 /admin
- 2
复制 .env.example 为 .env 和 .dev.vars,两处填入相同值:CARET_EDIT_PASSWORD、CARET_SESSION_SECRET、R2_PUBLIC_DOMAIN,以及可选的 PUBLIC_CONTACT_FORM_ENDPOINT
- 3
未设置 CARET_EDIT_PASSWORD 时,开发密码会打印在终端
- 4
部署前创建 KV 命名空间与 R2 存储桶,复制 wrangler.production.toml.example 并填入 KV id 与 R2 桶名,再执行 npm run deploy:production
- 5
修改模板后运行 npm run caretize 重新绑定 data-caret 属性
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
- 该主题使用 Astro 7,但 @caretcms/core 的 peer 依赖范围仅为 Astro 5/6,因此 .npmrc 中设置了 legacy-peer-deps=true 以绕过 peer 依赖冲突。
- 构建时 astro build 可能对 @caretcms/cloudflare 0.1.x 的 provider 导出给出警告,这些导出在运行时才解析。
- PUBLIC_CONTACT_FORM_ENDPOINT 为可选环境变量;未配置时联系表单仅为 UI,不会实际提交。
- 部署需要 Cloudflare 账户,并需创建 KV 命名空间与 R2 存储桶,属于外部服务依赖。
- 编辑者认证需在 Cloudflare 侧通过 wrangler secret 设置,而非在 GitHub Actions 中配置。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
`@caretcms/core` peer range is Astro 5/6 — this theme uses Astro 7; `.npmrc` sets `legacy-peer-deps=true`
README 原文
`astro build` may warn on `@caretcms/cloudflare` 0.1.x provider exports — they resolve at runtime
README 原文
`PUBLIC_CONTACT_FORM_ENDPOINT` — optional; form is UI-only without it
README 原文
Cloudflare account for deploy.
README 原文
https://github.com/web-stacked/sterling-district/blob/main/LICENSEhttps://github.com/web-stacked/sterling-district/blob/main/README.mdSet editor auth once in Cloudflare (not in GitHub Actions):
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-12。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- GitHub
- 资料与维护参考分
- 资料较完整 · 80 / 100
- 技术栈
- Astro
- 网站类型
- 电商
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2026-06-26
- 截图检查日期
- 2026-10-12
已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。
目录记录的主要技术栈是 Astro。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
审核声明: [email protected] · 2026-10-13
查看当时使用的来源资料
SHA-256: db6cdbaff6fd80c229486431d0d2959192e62fbaedeb9a35c22555d2aea9caee
2026-10-12T22:26:37.414Z
来源文件 / 仓库# Sterling District CaretCMS starter theme — Astro 7 storefront on Cloudflare Workers with inline editing, Studio, and Zod schemas. Sterling District is a production-ready jewelry storefront built to show how CaretCMS fits an Astro site end to end. The theme ships with seeded pages (home, collections, luxury, services, contact), a product catalog with detail views, FAQs, testimonials, and global site settings — all typed from Zod schemas in `src/content-schema.ts` and editable in Studio at `/admin/cms`. On the front end, pages are server-rendered with Tailwind CSS 4; on the back end, content lives in Cloudflare KV, media uploads go to R2, and templates are wired for inline editing via `data-caret` attributes from `caretize`. Clone it as a starting point for your own CaretCMS + Cloudflare site, swap the seed content, and deploy to Workers. | | | | --- | --- | | Inline editing | `/admin` | | Studio | `/admin/cms` | | Schemas | `src/content-schema.ts` | | Storage | KV (`CMS_KV`) + R2 (`CMS_R2`) | | Templates | `data-caret` from `caretize --all` | [`@caretcms/core`](https://www.npmjs.com/package/@caretcms/core) · [`@caretcms/cloudflare`](https://www.npmjs.com/package/@caretcms/cloudflare) · [`@caretcms/zod`](https://www.npmjs.com/package/@caretcms/zod) · [`@caretcms/caretize`](https://www.npmjs.com/package/@caretcms/caretize) Node 20+, npm. Cloudflare account for deploy. ## Local ```sh npm install npm run dev ``` Open `/admin`. Without `CARET_EDIT_PASSWORD`, the dev password prints in the terminal. ```sh cp .env.example .env cp .env.example .dev.vars ``` Same values in both — Astro reads `.env`, Wrangler reads `.dev.vars`: - `CARET_EDIT_PASSWORD` - `CARET_SESSION_SECRET` — `openssl rand -base64 32` - `R2_PUBLIC_DOMAIN` - `PUBLIC_CONTACT_FORM_ENDPOINT` — optional; form is UI-only without it Preview on the Workers runtime: `npm run preview:cf` ## Deploy ```sh npx wrangler kv namespace create CMS_KV npx wrangler r2 bucket create sterling-district-uploads cp wrangler.production.toml.example wrangler.production.toml # fill KV id + R2 bucket npm run deploy:production ``` Set editor auth once in Cloudflare (not in GitHub Actions): ```sh npx wrangler secret put CARET_EDIT_PASSWORD npx wrangler secret put CARET_SESSION_SECRET ``` ### CI Pushes to `main` → [`.github/workflows/deploy.yml`](.github/workflows/deploy.yml) | Name | Type | | --- | --- | | `CLOUDFLARE_API_TOKEN` | Secret — [Edit Cloudflare Workers](https://dash.cloudflare.com/profile/api-tokens) template | | `CLOUDFLARE_ACCOUNT_ID` | Secret | | `CF_KV_NAMESPACE_ID` | Variable | | `CF_R2_BUCKET_NAME` | Variable | ## Content Seeds in `src/content/seeds`. Schemas in `src/content-schema.ts`. Mirror in `.caret/data` for bundled Worker fallback before KV has data. After template changes: `npm run caretize` ## Scripts | Command | | | --- | --- | | `npm run dev` | Dev server | | `npm run build` | Production build | | `npm run preview` | Local preview | | `npm run preview:cf` | Workers runtime preview | | `npm run deploy:production` | Deploy with `wrangler.production.toml` | | `npm run caretize` | Re-bind `data-caret` attributes | ## Gotchas - `@caretcms/core` peer range is Astro 5/6 — this theme uses Astro 7; `.npmrc` sets `legacy-peer-deps=true` - `astro build` may warn on `@caretcms/cloudflare` 0.1.x provider exports — they resolve at runtime ## License MIT
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

astro-shopify
astro-shopify 是一个面向开发者的轻量级电商启动模板,用于构建基于 Shopify 的无头店面。
Astro · 电商

astro-ecommerce
Astro Ecommerce - Ready to use components
Astro · 电商

astro-medusa-starter
Astro + Medusa starter for e-commerce. Optimized to the core.
Astro · 电商

sanity-astro-club
sanity-astro-club 开源网站模板。
Astro · 电商

atelier-ko
Atelier Kō 是一个为小型家具工坊或类似手工艺目录设计的 Astro 电商主题,它的核心假设是:作品不多,摄影足够有力,因此界面刻意保持冷静和建筑感。
Astro · 电商

starter-astro
A small, production-minded storefront starter for Astro.
Astro · 电商
