Next.jsReact电商启动器

medusa-storefront-nextjs-default-starter — Next.js 电商模板

作者 vanphongngo

基于 Next.js 的 Medusa 无头电商前端启动器,需搭配本地 Medusa 服务运行,包含商品、账户、搜索与支付等模块。

看看你的网站会是什么样

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

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

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

全部页面与视图 2

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

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

值得关注的模板亮点

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

01

基于 Next.js、Tailwind CSS 与 TypeScript 构建的电商前端

02

覆盖商品浏览、客户账户、购物车与结账流程

03

内置 Stripe 与 PayPal 支付集成配置入口

04

搜索默认支持 MeiliSearch 插件,可切换为 Algolia

05

采用 MIT 许可,可免费使用、修改与分发

模板详细介绍

该模板是 Medusa 官方 Next.js Starter 的复刻版本,用于为 Medusa 无头电商引擎搭建前端店面。技术栈为 Next.js、Tailwind CSS 与 TypeScript,代码托管在 GitHub,采用 MIT 许可。

功能范围覆盖完整电商流程:商品浏览、客户账户、购物车与结账,并内置 Stripe 与 PayPal 支付集成,搜索默认对接 MeiliSearch 插件,也可切换为 Algolia。README 提到 App Router 与 Product Module 支持属于计划中(coming soon),当前版本并未包含。

使用前需要先在本机 9000 端口运行 Medusa 服务,并准备 Medusa 后端地址等环境变量;支付与搜索还需在 Medusa 服务端完成对应插件配置。演示站点部署在 Vercel,仓库本身不包含后端与第三方服务。

Next.js电商启动器

适合你的项目吗?

适用场景

  • 为自建的 Medusa 后端搭建配套的 Next.js 前端店面
  • 在已有 Medusa 服务上快速验证商品、账户与结账流程
  • 需要同时接入 Stripe 与 PayPal 的电商前端项目
  • 希望以 MeiliSearch 或 Algolia 实现商品搜索的店铺

适合人群

  • 已部署或计划部署 Medusa 服务的开发者
  • 熟悉 Next.js 与 TypeScript 的前端团队
  • 需要无头电商前端启动代码的独立开发者
  • 希望自行托管电商前端与后端的技术团队

上手与定制指南

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

  1. 1

    运行前需先在本机 9000 端口启动 Medusa 服务,可参考 medusa-starter-default 快速搭建。

  2. 2

    将 .env.template 复制为 .env.local,并填写 Medusa 后端地址等环境变量。

  3. 3

    使用 Yarn 安装依赖后执行 yarn dev,开发服务器默认运行在 8000 端口。

  4. 4

    启用 Stripe 或 PayPal 需在 .env.local 中配置对应公钥,并在 Medusa 服务端安装相应插件。

  5. 5

    启用搜索需在 store-config.json 中打开 search 开关,并在 Medusa 服务端安装 MeiliSearch 插件。

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

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

使用时需要遵守

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

额外费用与待核对事项

  • 使用该模板前必须自行部署并运行 Medusa 后端服务(默认本地 9000 端口),模板本身不含后端,缺少后端则无法正常使用。
  • 启用 Stripe 与 PayPal 支付需自行申请并配置对应的公钥/客户端 ID,并在 Medusa 服务端安装相应插件,涉及第三方支付账户。
  • 启用搜索功能需在 Medusa 服务端安装 MeiliSearch 插件,并可能需自行部署 MeiliSearch 服务。
  • 若改用 Algolia 搜索,需额外安装 algoliasearch 依赖并配置 Algolia 的 App ID 与 API Key,属于第三方付费服务。
  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

To use the starter you should have a Medusa server running locally on port 9000.

README 原文

To enable the integrations you need to add the following to your `.env.local` file:

README 原文

Before you can search you will need to install the plugin in your Medusa server

README 原文

you will need to add `algoliasearch` to the project

README 原文
https://github.com/vanphongngo/medusa-storefront-nextjs-default-starter/blob/main/LICENSEhttps://github.com/vanphongngo/medusa-storefront-nextjs-default-starter/blob/main/README.md

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

项目核对记录与介绍依据

模板资料

来源平台
GitHub
资料与维护参考分
资料一般 · 70 / 100
技术栈
Next.js · React
网站类型
电商 · 启动器
这个分数如何计算

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

这个项目需要核对什么

记录的仓库更新时间
2023-06-30
截图检查日期
2026-10-02

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

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

查看具体选型方法 →

介绍的制作与核对状态

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

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

查看当时使用的来源资料

SHA-256: b6c8bf5d5eb9f37fb05430059220027081c8ec37bfa39eff2bc1f129f721da05

2026-10-02T19:44:57.050Z

来源文件 / 仓库
<p align="center">
  <a href="https://www.medusajs.com">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/59018053/229103275-b5e482bb-4601-46e6-8142-244f531cebdb.svg">
    <source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/59018053/229103726-e5b529a3-9b3f-4970-8a1f-c6af37f087bf.svg">
    <img alt="Medusa logo" src="https://user-images.githubusercontent.com/59018053/229103726-e5b529a3-9b3f-4970-8a1f-c6af37f087bf.svg">
    </picture>
  </a>
</p>

<h1 align="center">
  Medusa Next.js Starter
</h1>

<p align="center">
Medusa is an open-source headless commerce engine that enables developers to create amazing digital commerce experiences.
</p>

<p align="center">
  <a href="https://github.com/medusajs/medusa/blob/master/CONTRIBUTING.md">
    <img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat" alt="PRs welcome!" />
  </a>
  <a href="https://discord.gg/xpCwq3Kfn8">
    <img src="https://img.shields.io/badge/chat-on%20discord-7289DA.svg" alt="Discord Chat" />
  </a>
  <a href="https://twitter.com/intent/follow?screen_name=medusajs">
    <img src="https://img.shields.io/twitter/follow/medusajs.svg?label=Follow%20@medusajs" alt="Follow @medusajs" />
  </a>
</p>

> **Prerequisites**: To use the starter you should have a Medusa server running locally on port 9000. Check out [medusa-starter-default](https://github.com/medusajs/medusa-starter-default) for a quick setup.

# Overview

The Medusa Next.js Starter is built with:
- [Next.js](https://nextjs.org/)
- [Tailwind CSS](https://tailwindcss.com/)
- [Typescript](https://www.typescriptlang.org/)
- [Medusa](https://medusajs.com/)

Features include:
- Full e-commerce support
- Next.js 13
- Customer Accounts
- Search with Algolia
- Checkout with PayPal and Stripe
- App Router (coming soon)
- [Product Module](https://docs.medusajs.com/modules/products/serverless-module) support (coming soon)

# Quickstart

## Deploy


### Deploy with Vercel
To get started, click the "Deploy with Vercel" button below.

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fmedusajs%2Fnextjs-starter-medusa&env=NEXT_PUBLIC_MEDUSA_BACKEND_URL&envDescription=The%20URL%20of%20your%20Medusa%20server&envLink=https%3A%2F%2Fdocs.medusajs.com%2Fdeployments%2Fserver%2F&demo-title=Medusa%20Next.js%20Starter&demo-description=A%20fully-fledged%20e-commerce%20store%20with%20Next.js%20and%20Medusa&demo-url=https%3A%2F%2Fnext.medusajs.com&demo-image=https%3A%2F%2Fmedusa-server-testing.s3.amazonaws.com%2FCleanShot%2B2023-06-22%2Bat%2B09.00.53%25402x-1687417264472.png&skippable-integrations=1)

## Setting up the environment variables

Navigate into your projects directory and get your environment variables ready:

```shell
cd nextjs-starter-medusa/
mv .env.template .env.local
```

### Install dependencies

Use Yarn to install all dependencies.

```shell
yarn
```

### Start developing

You are now ready to start up your project.

```shell
yarn dev
```

### Open the code and start customizing

Your site is now running at http://localhost:8000!

Edit `/pages/index.tsx` to see your site update in real-time!

# Payment integrations

By default this starter supports the following payment integrations

- [Stripe](https://stripe.com/)
- [Paypal](https://www.paypal.com/)

To enable the integrations you need to add the following to your `.env.local` file:

```shell
NEXT_PUBLIC_STRIPE_KEY=<your-stripe-public-key>
NEXT_PUBLIC_PAYPAL_CLIENT_ID=<your-paypal-client-id>
```

You will also need to setup the integrations in your Medusa server. See the [Medusa documentation](https://docs.medusajs.com) for more information on how to configure [Stripe](https://docs.medusajs.com/add-plugins/stripe) and [PayPal](https://docs.medusajs.com/add-plugins/paypal) in your Medusa project.

# Search integration

This starter is configured to support using the `medusa-search-meilisearch` plugin out of the box. To enable search you will need to enable the feature flag in `./store-config.json`, which you do by changing the config to this:

```json
{
  "features": {
    "search": true
  }
}
```

Before you can search you will need to install the plugin in your Medusa server, for a written guide on how to do this – [see our documentation](https://docs.medusajs.com/add-plugins/meilisearch).

The search components in this starter are developed with Algolia's `react-instant-search-hooks-web` library which should make it possible for you to seemlesly change your search provider to Algoli instead of MeiliSearch.

To do this you will need to add `algoliasearch` to the project, by running

```shell
yarn add algoliasearch
```

After this you will need to switch the current MeiliSearch `SearchClient` out with a Alogolia client. To do this update `@lib/search-client`.

```ts
import algoliasearch from "algoliasearch/lite"

const appId = process.env.NEXT_PUBLIC_SEARCH_APP_ID || "test_app_id" // You should add this to your environment variables

const apiKey = process.env.NEXT_PUBLIC_SEARCH_API_KEY || "test_key"

export const searchClient = algoliasearch(appId, apiKey)

export const SEARCH_INDEX_NAME =
  process.env.NEXT_PUBLIC_INDEX_NAME || "products"
```

After this you will need to set up Algolia with your Medusa server, and then you should be good to go. For a more thorough walkthrough of using Algolia with Medusa – [see our documentation](https://docs.medusajs.com/add-plugins/algolia), and the [documentation for using `react-instantsearch-hooks-web`](https://www.algolia.com/doc/guides/building-search-ui/getting-started/react-hooks/).

# Resources

## Learn more about Medusa

- [Website](https://www.medusajs.com/)
- [GitHub](https://github.com/medusajs)
- [Documentation](https://docs.medusajs.com/)

## Learn more about Next.js

- [Website](https://nextjs.org/)
- [GitHub](https://github.com/vercel/next.js)
- [Documentation](https://nextjs.org/docs)
反馈内容错误

看看同类模板

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