Astro电商博客

astro-njx-boutique — Astro 电商模板

作者 njbSaab

基于 Astro 的编辑风格时尚电商主题,内置模拟商品数据,可通过环境变量切换至 Shopify Storefront API,静态构建输出。

看看你的网站会是什么样

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

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

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

全部页面与视图 3

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

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

值得关注的模板亮点

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

01

Astro 静态构建,页面在构建时输出为纯 HTML,可部署到任意静态托管

02

内置 JSON 模拟商品目录,无需外部账号即可运行完整店面流程

03

通过环境变量在 mock 与 Shopify Storefront API 两种数据源之间切换

04

购物袋基于 localStorage 持久化,支持快速加购、数量调整与清空,并交由 Shopify 托管结账

05

内联索引搜索按 / 键唤起,不发起网络请求;收藏功能带计数徽章与独立页面

06

站点文案集中在 components.ts 与 pages.ts 两个常量文件中,便于整体替换

模板详细介绍

astro-njx-boutique 是一个面向小型时尚品牌、工作室与精品店的静态店面主题,使用 Astro 构建,页面在构建时渲染为纯 HTML。项目自带一份 JSON 模拟商品目录,无需任何外部账号即可本地运行;通过设置 COMMERCE_PROVIDER 环境变量,可将同一套页面切换为从 Shopify Storefront API 读取真实商品,并由 Shopify 托管结账流程。

功能层面,主题包含全幅首页、系列展示、带客户端标签筛选与排序的商品目录、含尺码与图集灯箱的商品详情页、相关推荐,以及基于 localStorage 的持久购物袋(支持快速加购、数量调整、单行删除与清空)。搜索使用内联索引,按 / 键打开,不发起网络请求;收藏功能带计数徽章与独立页面;明暗主题切换在刷新时无闪烁。站点文案集中在两个常量文件中,便于整体替换品牌文字。

使用限制方面:本次收录的是公开仓库中采用 MIT 许可的免费版本,不包含资料中提及的付费 Pro 升级(如客户账户、评价等)。演示图片、字体与图标等第三方素材需按各自许可单独核对,不能仅凭代码的 MIT 许可判断。域名、托管、Shopify 等外部服务可能另行收费。主题的 provider 接口位于 src/lib/commerce/,资料称可通过实现一个 TypeScript 接口接入 WooCommerce、Medusa 或自有 API,但未提供现成实现。

Astro电商博客

适合你的项目吗?

适用场景

  • 为小型时尚品牌或精品店搭建静态商品展示与结账店面
  • 先用模拟目录快速预览页面结构与交互,再接入 Shopify 真实商品
  • 需要编辑风格排版、全幅图片与明暗主题切换的电商前端
  • 将构建产物部署到 Cloudflare Pages 或其他静态托管平台

适合人群

  • 小型时尚品牌、工作室与精品店
  • 希望以静态站点方式运营店面、避免自建服务器的开发者
  • 已使用 Shopify 并希望自定义编辑风格前端的商家
  • 需要可整体替换文案与设计令牌的 Astro 项目

上手与定制指南

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

  1. 1

    克隆仓库后执行 npm install,复制 .env.example 为 .env,默认使用内置模拟目录,npm run dev 启动本地开发

  2. 2

    接入 Shopify 需在后台创建应用并授予 Storefront API 读取权限,将 COMMERCE_PROVIDER 设为 shopify,并填写 PUBLIC_SHOPIFY_DOMAIN 与 PUBLIC_SHOPIFY_STOREFRONT_TOKEN

  3. 3

    商品数据可编辑 src/data/mock-catalog.json 并替换 public/products/ 下的图片

  4. 4

    品牌文案在 src/constants/components.ts 与 src/constants/pages.ts 中修改,设计令牌在 src/styles/global.css 的 @theme 块中调整

  5. 5

    部署到静态托管时需在平台仪表盘配置相同的环境变量;Cloudflare Pages 可使用 wrangler pages deploy 上传 dist 目录

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

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

使用时需要遵守

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

额外费用与待核对事项

  • 项目资料提及可选付费版本或功能;本次仅收录公开免费代码,不包含付费升级。
  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
  • 付费 Pro 版本(含客户账户、评价、更多区块)尚在开发中,不属于本次免费收录范围;免费版本不包含这些功能。
  • 接入真实商品与结账需使用 Shopify:需在 Shopify 后台创建应用、授予 Storefront API 权限并配置域名与访问令牌,Shopify 服务可能另行收费。
  • 演示图片来自 Unsplash,需按 Unsplash 自身许可单独核对使用条件,不能仅凭代码的 MIT 许可判断素材授权。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

An extended **Pro** version (customer accounts, reviews, more sections) is on the way — watch the repo to get notified.

README 原文

then flip one environment variable and the same pages build from your **real Shopify store**, with Shopify's hosted checkout handling payments.

README 原文

Photos: [Unsplash](https://unsplash.com).

README 原文
https://github.com/njbSaab/astro-njx-boutique/blob/main/LICENSEhttps://github.com/njbSaab/astro-njx-boutique/blob/main/README.md

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

项目核对记录与介绍依据

模板资料

来源平台
GitHub
资料与维护参考分
资料较完整 · 85 / 100
技术栈
Astro
网站类型
电商 · 博客
这个分数如何计算

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

这个项目需要核对什么

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

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

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

查看具体选型方法 →

介绍的制作与核对状态

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

审核声明: [email protected] · 2026-10-13

查看当时使用的来源资料

SHA-256: 90a4751b97e2dc05f7bb98a56d74b625ee579ce0a784e2d5c04c36e431f9bbcd

2026-10-13T00:30:21.690Z

来源文件 / 仓库
# astro-njx-boutique — editorial fashion theme for Astro

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/njbSaab/astro-njx-boutique) [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/njbSaab/astro-njx-boutique)

> Part of **[njX Astro Themes](https://njxui.dev/themes)** — ecommerce storefronts & landing pages by one author, free today, Pro versions on the way.

A complete boutique storefront built with **Astro 5 + Tailwind CSS v4**: serif editorial
typography, full-bleed imagery, oxblood accents — wired for **Shopify** out of the box and
deployable to **Cloudflare Pages** (or any static host) in minutes.

**Live demo → [astro-njx-boutique.pages.dev](https://astro-njx-boutique.pages.dev)**
Everything in the demo — bag, checkout, search, favorites, dark mode — is this theme running on mock data.

![astro-njx-boutique home page](submit-assets/home.png)

## What is this?

astro-njx-boutique is a **static storefront**: Astro renders every page to plain HTML at
build time, so the site is fast by default and hosting is essentially free. Product data
comes from a pluggable provider — start with the bundled JSON catalog, then flip one
environment variable and the same pages build from your **real Shopify store**, with
Shopify's hosted checkout handling payments.

Made for small fashion brands, ateliers and boutiques that want an editorial custom
storefront without running a server.

## Features

- 👗 **Full boutique flow** — full-bleed hero, collection shelf, catalog with client-side
  tag filters (with piece counts) & sorting, product pages with sizes, sticky 3:4 gallery
  + lightbox, related pieces
- 🛍 **Working bag** — persistent (localStorage), quick-add from cards, quantity controls,
  line remove, clear all; hands off to Shopify's hosted checkout
- 🔌 **Two data providers, one switch** — `COMMERCE_PROVIDER=mock` (bundled JSON, no
  accounts needed) or `shopify` (live products over the Storefront API)
- 🔎 **Instant search** — inline index, opens with `/`, zero network requests
- ❤️ **Favorites** — heart any piece, badge counter, dedicated `/favorites` page
- 🌗 **Light & dark theme** — one click, no flash on reload
- 🤝 **Trust details on every product** — shipping, returns and repairs lines, all from config
- 📝 **All copy in two constants files** — rebrand every text on the site without touching markup
- 📄 **20 pages total** — about, contacts, FAQ, account UI, privacy, terms, honest 404
- ⚡️ **Zero client framework** — a few small vanilla scripts; no React/Vue/hydration cost

| Catalog | Dark |
| --- | --- |
| ![Collection page](submit-assets/collection.png) | ![Dark theme](submit-assets/dark.png) |

## Quick start

```bash
git clone https://github.com/njbSaab/astro-njx-boutique.git my-boutique
cd my-boutique
npm install
cp .env.example .env        # defaults to the mock catalog
npm run dev                 # http://localhost:4321
```

That's it — the boutique runs on the bundled demo catalog (`src/data/mock-catalog.json`).
Edit that file to see your own pieces immediately.

## Connect your Shopify store

1. In Shopify admin: **Settings → Apps and sales channels → Develop apps → Create an app.**
2. Give it the *Storefront API* scopes (unauthenticated read products/collections/checkouts).
3. Install the app and copy the **Storefront API access token** (this token is public-safe).
4. Update `.env`:

```bash
COMMERCE_PROVIDER=shopify
PUBLIC_SHOPIFY_DOMAIN=your-store.myshopify.com
PUBLIC_SHOPIFY_STOREFRONT_TOKEN=xxxxxxxxxxxxxxxx
```

5. `npm run build` — the same pages now build from your live catalog, and the bag creates
   a real Shopify cart and redirects to your hosted checkout.

The provider interface lives in `src/lib/commerce/` — adding WooCommerce, Medusa or your
own API means implementing one small TypeScript interface.

## Deploy

Any static host works. For Cloudflare Pages:

```bash
npm run build
npx wrangler pages deploy dist --project-name my-boutique
```

Set the same env vars in your host's dashboard for CI builds. The whole boutique fits
comfortably in Cloudflare's free tier.

## Make it yours

- **All copy in two files** — every piece of text lives in `src/constants/components.ts`
  (header, footer, drawers, bag, search) and `src/constants/pages.ts` (home, about, FAQ,
  product page, …). Rebrand the whole boutique without touching a single component.
- **Brand & colors** — design tokens in `src/styles/global.css` (`@theme` block, dark
  overrides in `.dark`; radius tokens are flattened for the editorial look — restore them
  for a softer feel). Fonts load in `src/layouts/Layout.astro`.
- **Catalog** — `src/data/mock-catalog.json` + photos in `public/products/`, or connect Shopify.
- **Layout & sections** — plain `.astro` files: header/footer/drawers in
  `src/layouts/Layout.astro`, one file per page in `src/pages/`.

## Project structure

```
src/
├── constants/
│   ├── components.ts           # all copy for the shell: header, footer, bag, search…
│   └── pages.ts                # all copy per page: home, about, FAQ, legal…
├── data/mock-catalog.json      # demo pieces & collections
├── layouts/Layout.astro        # header, footer, bag/nav drawers, search
├── components/ProductCard.astro
├── lib/
│   ├── commerce/               # provider interface + mock & shopify implementations
│   ├── cart.ts                 # persistent bag (nanostores)
│   └── favorites.ts            # persistent favorites
└── pages/                      # index, collections/, products/, about, faq, …
```

## Sibling theme & Pro

Prefer a general-goods look? **[astro-njx-store](https://github.com/njbSaab/astro-njx-store)**
is the same engine with a warm paper-and-pine design. An extended **Pro** version (customer
accounts, reviews, more sections) is on the way — watch the repo to get notified.

## Credits

Made by [njX](https://njxui.dev) — also the author of [njx-ui](https://njxui.dev), a
classless-friendly CSS library for landings. Photos: [Unsplash](https://unsplash.com).

If this theme saves you time, a ⭐️ on GitHub genuinely helps it reach more people.
反馈内容错误

看看同类模板

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