Rails 后端与 React + TypeScript 前端通过 Inertia.js 集成
react-starter-kit — Rails 启动器模板
作者 inertia-rails
基于 Rails 与 React 的 Inertia.js 全栈启动器,内置用户认证、shadcn/ui 组件库、Vite 与 Kamal 部署配置,并可选开启 SSR。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
全部页面与视图 2
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
集成 shadcn/ui 组件库
内置基于 Authentication Zero 的用户认证系统
使用 Kamal 进行部署,并提供可选的 SSR 支持
由 inertia-rails/generator 生成并自动同步
模板详细介绍
这是一个 Rails 后端加 React 前端的 Inertia.js 全栈启动应用,参考 Laravel React Starter Kit 的思路构建,仓库由 inertia-rails/generator 生成并自动同步。
技术组成上,项目使用 Inertia Rails 与 Vite Rails 完成前后端衔接和资源构建,前端为 React 加 TypeScript,并集成 shadcn/ui 组件库;用户认证系统基于 Authentication Zero;部署使用 Kamal。SSR 默认关闭,但已具备开启条件:Puma 插件在进程内管理 Node.js 渲染器,无需额外附属服务。
使用方式为克隆仓库后运行 bin/setup 并访问本地 3000 端口。如需 SSR,需在 config/initializers/inertia_rails.rb 中设置 config.ssr_enabled = true,并在构建镜像时传入 SSR_ENABLED=true;开发环境下仅切换 ssr_enabled 即可,Vite 会通过开发端点提供 SSR 与 HMR。
需要注意,仓库中大部分文件由生成器在每次同步时覆盖,对应用本身的改动应提交到 inertia-rails/generator,只有 README 和部署工作流属于本仓库维护。若需要不同框架、JavaScript 而非 TypeScript 或不同功能组合,可用 rails new 配合生成器模板自行生成。
适合你的项目吗?
适用场景
- 快速搭建 Rails + React 的全栈应用骨架
- 需要 Inertia.js 而非独立 API 的前后端一体化项目
- 希望直接使用 shadcn/ui 与 TypeScript 的 React 前端
- 需要内置用户认证与 Kamal 部署配置的起步项目
适合人群
- 熟悉 Rails 并希望引入 React 前端的开发者
- 需要 Inertia.js 全栈方案而非前后端分离架构的团队
- 希望以生成器方式定制框架或语言选项的项目
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
克隆仓库后运行 bin/setup 完成依赖安装并启动服务,访问 http://localhost:3000
- 2
SSR 默认关闭,需在 config/initializers/inertia_rails.rb 中设置 config.ssr_enabled = true
- 3
生产镜像需在构建时传入 SSR_ENABLED=true,Kamal 部署可在 config/deploy.yml 的 builder.args 中添加
- 4
开发环境下开启 ssr_enabled 即可,Vite 通过开发端点提供 SSR 与 HMR
- 5
对应用本身的改动应提交到 inertia-rails/generator,本仓库多数文件会被同步覆盖
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 仓库中大部分文件由 inertia-rails/generator 生成并在每次同步时覆盖,对应用本身的改动需提交到生成器仓库,只有 README 和部署工作流属于本仓库维护。
- SSR 默认关闭,需在 config/initializers/inertia_rails.rb 中设置 config.ssr_enabled = true,并在生产镜像构建时传入 SSR_ENABLED=true 才能启用。
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
To contribute changes to the app itself, open a PR against the generator
README 原文
https://github.com/inertia-rails/react-starter-kit/blob/main/LICENSEhttps://github.com/inertia-rails/react-starter-kit/blob/main/README.mdThis starter kit ships SSR-ready but turned off.
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-02。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- GitHub
- 资料与维护参考分
- 资料较完整 · 96 / 100
- 技术栈
- Rails · React
- 网站类型
- 启动器
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2026-09-25
- 截图检查日期
- 2026-10-02
已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。
目录记录的主要技术栈是 Rails。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
已完成服务器许可规则与 AI 来源核对;未经过人工编辑审核。
查看当时使用的来源资料
SHA-256: 7970360c4cc92b9a6c0595b8c57b7457dc0d7d5577dbc5aba360a3d6bbfda7c6
2026-10-02T03:15:48.414Z
来源文件 / 仓库# Inertia Rails React Starter Kit
A modern full-stack starter application with Rails backend and React frontend using Inertia.js based on the [Laravel Starter Kit](https://github.com/laravel/react-starter-kit).
## About this repo
This starter kit is generated output of [inertia-rails/generator](https://github.com/inertia-rails/generator):
each generator release regenerates the app and opens an automated sync PR here, so most files in this repo
are overwritten on every sync. **To contribute changes to the app itself, open a PR against the generator** —
only this README and the deploy workflow are kit-owned.
Prefer different options (framework, JavaScript instead of TypeScript, feature set)? Generate your own app:
```sh
rails new myapp -m https://raw.githubusercontent.com/inertia-rails/generator/dist/template.rb
```
## Features
- [Inertia Rails](https://inertia-rails.dev) & [Vite Rails](https://vite-ruby.netlify.app) setup
- [React](https://react.dev) frontend with TypeScript & [shadcn/ui](https://ui.shadcn.com) component library
- User authentication system (based on [Authentication Zero](https://github.com/lazaronixon/authentication-zero))
- [Kamal](https://kamal-deploy.org/) for deployment
- Optional SSR support
See also:
- [Svelte Starter Kit](https://github.com/inertia-rails/svelte-starter-kit) for Inertia Rails with Svelte
- [Vue Starter Kit](https://github.com/inertia-rails/vue-starter-kit) for Inertia Rails with Vue
<a href="https://evilmartians.com/?utm_source=inertia-rails-react-starter-kit&utm_campaign=project_page">
<img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" alt="Built by Evil Martians" width="236" height="54">
</a>
## Setup
1. Clone this repository
2. Setup dependencies & run the server:
```bash
bin/setup
```
3. Open http://localhost:3000
## Enabling SSR
This starter kit ships SSR-ready but turned off. The Puma plugin
([`plugin :inertia_ssr`](config/puma.rb)) manages the Node.js renderer
in-process — no separate accessory required.
To turn SSR on, flip two switches:
1. Set `config.ssr_enabled = true` in [`config/initializers/inertia_rails.rb`](config/initializers/inertia_rails.rb).
2. Build the image with `SSR_ENABLED=true` so the SSR bundle ships
alongside the app. Two ways:
**With Kamal** — add to [`config/deploy.yml`](config/deploy.yml):
```yml
builder:
args:
SSR_ENABLED: true
```
**By hand** — pass the build arg directly:
```bash
docker build --build-arg SSR_ENABLED=true -t react_starter_kit .
```
That's it. Puma boots the SSR process automatically when
`ssr_enabled` is true, and Inertia falls back to client-side
rendering if it ever fails (see `config.on_ssr_error`).
In development, flipping `ssr_enabled` is enough — Vite serves SSR
via its own dev endpoint with HMR. The Docker build arg only matters
for production images.
## License
The project is available as open source under the terms of the [MIT License](LICENSE).
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

rails-tabler-starter
Free and open source Ruby on Rails starter kit built using Tabler
Rails · 后台

plutonium-core
Build production-ready Rails apps in minutes, not days. Convention-driven, fully customizable, AI-ready.
Rails · 后台

ace-template
Rails 8+ app template. Go from 0 to full-featured deployed app in less than 5 minutes (self-hosted or PaaS)
Rails · 启动器

kern
SaaS starter for Rails apps. Skip the boilerplate and start shipping the actual product.
Rails · SaaS

rails-react-starter
Simple React & Rails starter
Rails · 启动器

SknServices
Authentication and Authorization focused starter Rails 5 Application
Rails · 启动器
