Next.jsReact启动器

strapi-next-starter — Next.js 启动器模板

作者 rileyseaburg

基于 Next.js、Strapi、PostgreSQL 与 Docker 的全栈 JavaScript 启动模板,内置认证与路由,需手动在 Strapi 后台创建 Author 与 Post 内容类型。

看看你的网站会是什么样

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

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

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

全部页面与视图 3

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

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

值得关注的模板亮点

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

01

Next.js 前端与 Strapi 后端组合的全栈 JavaScript 启动模板

02

使用 PostgreSQL 作为数据库,并通过 Docker 组织运行环境

03

仓库自述称已内置认证与路由

04

提供 yarn setup、yarn dev:frontend、yarn dev 等脚本化启动方式

05

README 给出 Author 与 Post 内容类型及 Public 角色权限的完整配置步骤

模板详细介绍

这是一个面向全栈 JavaScript 开发的启动模板,前端使用 Next.js,后端内容管理使用 Strapi,数据库为 PostgreSQL,并通过 Docker 组织运行环境。仓库自述称模板已内置认证与路由,可在此基础上直接开始开发。

使用前需要准备 Node.js、Yarn 与 Docker;在 Windows 上还要求安装 WSL,否则无法完成安装。安装流程为克隆仓库后执行 yarn setup,再进入 frontend 目录复制 .env.local.example 为 .env.local,并设置 STRAPI_PREVIEW_SECRET(任意不含空格的随机字符串,用于 Next.js 预览模式)与 NEXT_PUBLIC_STRAPI_API_URL(本地为 http://localhost:1337,不带结尾斜杠)。

模板不会自动生成内容模型,需要在 Strapi 的 Content-Types Builder 中手动创建 Author 与 Post 两个集合类型:Author 包含 name(短文本)与 picture(单媒体);Post 包含 title、content(多段富文本)、excerpt(长文本)、coverImage(单媒体)、date、slug(UID,关联 title)、author(与 Author 的一对一关系)以及 status 枚举(published、draft)。随后在 Settings 的 Users & Permissions 中为 Public 角色开放 Author 与 Post 的 count、find、findone 权限,并手动录入至少 1 条 Author 和 2 条 Post 示例数据。

开发时可用 yarn dev:frontend 单独启动 Next.js,或用 yarn dev 一条命令启动整个项目。仓库未提供部署章节的具体内容,README 中仅指向 deployment 说明。

Next.js启动器

适合你的项目吗?

适用场景

  • 搭建以 Strapi 为内容管理后台、Next.js 为前端的全栈项目
  • 在本地通过 Docker 与 PostgreSQL 运行带认证和路由的 JavaScript 应用原型
  • 以 Author/Post 博客数据模型为起点,扩展自定义内容类型与接口权限

适合人群

  • 熟悉 Node.js、Yarn 与 Docker 的 JavaScript 开发者
  • 需要 Strapi 内容管理与 Next.js 前端组合的团队
  • 希望在已有认证与路由基础上继续开发的项目

上手与定制指南

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

  1. 1

    需预先安装 Node.js、Yarn 与 Docker,Windows 用户还必须安装 WSL

  2. 2

    克隆仓库后执行 yarn setup 安装依赖

  3. 3

    进入 frontend 目录,将 .env.local.example 复制为 .env.local,并设置 STRAPI_PREVIEW_SECRET 与 NEXT_PUBLIC_STRAPI_API_URL

  4. 4

    在 Strapi 后台手动创建 Author 与 Post 集合类型,并为 Public 角色开放 count、find、findone 权限

  5. 5

    使用 yarn dev:frontend 启动前端,或用 yarn dev 启动整个项目

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

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

使用时需要遵守

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

额外费用与待核对事项

  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
  • Windows 用户必须安装 WSL(Windows Subsystem for Linux),否则无法成功完成安装。
  • 需自行设置 STRAPI_PREVIEW_SECRET 环境变量(任意不含空格的随机字符串),用于 Next.js 预览模式。
  • 需设置 NEXT_PUBLIC_STRAPI_API_URL 环境变量,本地应为 http://localhost:1337,且不能带结尾斜杠。
  • 模板不预置内容模型,必须在 Strapi 后台的 Content-Types Builder 中手动创建 Author 集合类型。
  • 必须在 Strapi 后台手动创建 Post 集合类型,并逐项添加 title、content、excerpt、coverImage、date、slug、author、status 等字段。
  • 需在 Settings 的 Users & Permissions 中手动为 Public 角色开放 Author 与 Post 的 count、find、findone 权限,否则接口不可访问。
  • 需手动录入示例内容,建议至少创建 2 条 Post 记录(以及 1 条 Author 记录)才能看到完整效果。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

> **Windows subsystem for linux must be installed for a successful windows installation! **

README 原文

- `STRAPI_PREVIEW_SECRET` can be any random string (but avoid spaces), like `MY_SECRET` - this is used for [Preview Mode](https://nextjs.org/docs/advanced-features/preview-mode).

README 原文

- `NEXT_PUBLIC_STRAPI_API_URL` should be set as `http://localhost:1337` (no trailing slash).

README 原文

#### Step 5. Create an `Author` collection From **Content-Types Builder**, **create a new collection type**.

README 原文

#### Step 6. Create a `Post` collection From **Content-Types Builder**, **create a new collection type**.

README 原文

From **Settings, Users & Permissions, Roles**, edit the **Public** role. Then select: `count`, `find`, and `findone` permissions for both **Author** and **Post**. Click **Save**.

README 原文

- We recommend creating at least **2 Post records**.

README 原文
https://github.com/rileyseaburg/strapi-next-starter/blob/main/LICENSEhttps://github.com/rileyseaburg/strapi-next-starter/blob/main/README.md

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

项目核对记录与介绍依据

模板资料

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

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

这个项目需要核对什么

记录的仓库更新时间
2021-03-23
截图检查日期
2026-10-13

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

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

查看具体选型方法 →

介绍的制作与核对状态

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

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

查看当时使用的来源资料

SHA-256: 89ce84cc1066eba57913bb2a282ab2acdc06da393fa9555db789b7d39f9c7aa5

2026-10-13T04:52:26.843Z

来源文件 / 仓库
# Strapi Next Starter Template
## Table of Contents

- [About](#about)
- [Getting Started](#getting_started)
- [Usage](#usage)
- [Contributing](./CONTRIBUTING.md)

## About <a name = "about"></a>

This is a starter template for creating fullstack javascript applications. 
The template includes technologies such as Docker, NextJS, Strapi, and PostgreSQL.
With authentication and routing built in you should have no problem getting started building.
Stop looking around for other frameworks or stacks to please your itch. 

This stack has everything you need as a javascript developer and it's here right now. 

Fork this repo today and start hacking. 

## Getting Started <a name = "getting_started"></a>

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See [deployment](#deployment) for notes on how to deploy the project on a live system.

### Prerequisites

 - NodeJS [Click Here To Install](https://nodejs.org/en/download/)
 - Yarn   [Click Here To Install](https://classic.yarnpkg.com/en/docs/install/)
 - Docker [Click Here To Install](https://docs.docker.com/engine/install/) 
 - (Windows Only) WSL [Click Here To Install WSL](https://docs.microsoft.com/en-us/windows/wsl/install-win10)
> **Windows subsystem for linux must be installed for a successful windows installation! **


### Installing

A step by step series of examples that tell you how to get a development env running.

#### Step 1. Clone the repository

```
git clone https://github.com/RileySeaburg/strapi-next-starter
```

#### Step 2. Setup the project & Install dependencies.
```
yarn setup
```

#### Step 3. Set client side environment variables
CD into the frontend client side directory holding your NexJS application.
```
cd frontend
```

Copy the `.env.local.example` file in this directory to `.env.local` (which will be ignored by Git):

```bash
cp .env.local.example .env.local
```

#### Step 4. Set each variable on `.env.local`:

- `STRAPI_PREVIEW_SECRET` can be any random string (but avoid spaces), like `MY_SECRET` - this is used for [Preview Mode](https://nextjs.org/docs/advanced-features/preview-mode).
- `NEXT_PUBLIC_STRAPI_API_URL` should be set as `http://localhost:1337` (no trailing slash).



#### Step 5. Create an `Author` collection

From **Content-Types Builder**, **create a new collection type**.

- The display name should be `Author`.

Next, add these fields (you don't have to modify the settings):

- **Text** field called **`name`** (**Short text**)
- **Media** field called **`picture`** (**Single media**)

Then click **Save**.

#### Step 6. Create a `Post` collection

From **Content-Types Builder**, **create a new collection type**.

- The display name should be `Post`.

Next, add these fields (you don't have to modify the settings unless specified):

- **Text** field called **`title`** (**Short text**)
- **Rich Text** field called **`content`** (**Multiple-paragraph Text**)
- **Text** field called **`excerpt`** (**Long text**)
- **Media** field called **`coverImage`** (**Single media**)
- **Date** field called **`date`** (type should be **date**)
- **UID** field called **`slug`** (attached field should be **title**)
- **Relation** field called **`author`** (Post **has one** Author)
- **Enumeration** field `status` (the values should be **published** and **draft**)

#### Step 7. Set permissions

From **Settings, Users & Permissions, Roles**, edit the **Public** role.

Then select: `count`, `find`, and `findone` permissions for both **Author** and **Post**. Click **Save**.

#### Step 8. Populate Content

Select **Author** and click **Add New Author**.

- You just need **1 Author entry**.
- Use dummy data for the name.
- For the image, you can download one from [Unsplash](https://unsplash.com/).

Next, select **Posts** and click **Add New Post**.

- We recommend creating at least **2 Post records**.
- Use dummy data for the text.
- You can write markdown for the **content** field.
- For the images, you can download ones from [Unsplash](https://unsplash.com/).
- Pick the **Author** you created earlier.
- Set the **status** field to be **published**.

#### Step 9.

Start Next.js dev server
```
yarn dev:frontend
```


#### Bonus: Run the whole project with one command. <a name = "usage"></a>

```
yarn dev
```
反馈内容错误

看看同类模板

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