Rails启动器

cybros_core_starter_mark — Rails 启动器模板

作者 markmcdonald51

基于 Rails 的裸应用启动模板,集成 Devise 用户系统、Webpacker 与 CoreUI 前端,并附带凭据加密、邮件配置等实用改造。

看看你的网站会是什么样

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

1 个预览视图
作者提供的预览
作者提供的预览

来自项目 README 的原始预览。

目前有 1 张原始预览,可打开完整图片查看设计细节。

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

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

值得关注的模板亮点

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

01

基于 Devise 的用户系统,包含登录页与管理员用户管理页面

02

使用 Webpacker 5 并移除 Sprockets,通过 application.js 统一引入静态资源

03

集成 CoreUI 与 Bootstrap、FontAwesome 的前端样式方案

04

提供 credentials.yml 加密流程与集中式 ActionMailer 配置的定制改造

05

包含表单辅助方法重写、模型默认值与 enum 国际化等 concern

模板详细介绍

Cybros Core 是一个从作者个人项目抽取的 Rails 裸应用启动模板,用于快速搭建新项目的基础骨架。它基于 Devise 构建用户系统,并包含登录、管理后台等页面。前端采用 Webpacker 5 并移除 Sprockets,使用 CoreUI 搭配 Bootstrap 与 FontAwesome,同时保留 Rails 服务端渲染方式,复杂页面可局部引入 React 或 Vue。模板还提供了若干工程化改造:通过自定义 bin/rails 支持 credentials.yml 的加密流程,将 ActionMailer 配置集中到 config/mailer.yml,重写表单辅助方法以适配 Bootstrap 校验样式,并加入模型默认值、enum 国际化等 concern。README 中明确列出待办事项,包括 UI/UX 改进、邮件布局、ActiveStorage 头像上传、Docker 部署等,说明部分功能尚未完成。

Rails启动器

适合你的项目吗?

适用场景

  • 需要快速搭建带用户系统与管理后台的 Rails 项目骨架
  • 希望以服务端渲染为主、局部引入 React 或 Vue 的 Rails 应用
  • 需要参考 Rails Credentials 加密流程或集中式邮件配置的实现方式
  • 想了解 Webpacker 替代 Sprockets 后的资源组织方式

适合人群

  • 熟悉 Rails 并需要可复用启动模板的开发者
  • 偏好服务端渲染与经典 Rails 视图层的团队
  • 需要 Devise 用户系统与管理员后台基础实现的个人项目

上手与定制指南

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

  1. 1

    依次执行 bundle、yarn,并复制 database.yml、credentials.yml、mailer.yml 的示例文件

  2. 2

    运行 rails credentials:encrypt 生成 credentials.yml.enc 与 master.key

  3. 3

    执行 rails db:migrate 后运行 rails s 启动应用

  4. 4

    开发环境接收确认邮件需安装并运行 mailcatcher

  5. 5

    将邮箱写入 settings.local.yml 的 admin.emails 后可在用户菜单看到 Administration 入口

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

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

使用时需要遵守

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

额外费用与待核对事项

  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
  • 作者说明该模板源自其个人副项目,最初仅供朋友分享,但明确表示可自由使用。
  • 作者表示希望模板达到生产可用,但用词为 should,属于目标而非保证,实际完成度需自行评估。
  • 作者明确不打算加入过多功能,尤其是业务特定功能,因此模板功能范围有限。
  • README 中存在未文档化的部分,相关功能说明缺失。
  • 开发环境接收确认邮件需额外安装并运行 mailcatcher 外部工具。
  • 需手动复制配置文件并将邮箱写入 admin.emails 才能看到管理入口。
  • 运行前需执行 gem update --system 以使用最新 Rubygem。
  • Docker 部署支持仍处于 Help wanted 待办状态,尚未实现。
  • ActiveStorage 头像上传功能仍为待办事项,尚未完成。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

I'm used to maintaining a barebone app that helps me build new project quickly, and this is extracted from my side project initially for sharing my ideas to friends, but if this is valuable to you, use it freely.

README 原文

I hope this could be a template for new apps, it should be production-ready, so I'll keep polishing the codebase, follow best practice, keep dependencies up to date.

README 原文

I don't wanna add too much features especially business-specific, but I'd like to perfection User system (based on Devise) because most apps need this, and keep improving UI/UX relates works.

README 原文

### Undocumented yet TODO:

README 原文

In development, I use `mailcatcher` to receive mails, run `gem install mailcatcher` to install it.

README 原文

- `cp config/settings.yml config/settings.local.yml` - Put your email into `admin.emails` - In user menu (right-top of pages), you should see `Administration`

README 原文

Make sure run `gem update --system` to use latest Rubygem

README 原文

- Docker for deployment, including stages to compiling assets & copy `yml`s, easy to migrate to k8s

README 原文

- Try support uploading user avatar using ActiveStorage

README 原文
https://github.com/markmcdonald51/cybros_core_starter_mark/blob/main/MIT-LICENSEhttps://github.com/markmcdonald51/cybros_core_starter_mark/blob/main/README.md

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

项目核对记录与介绍依据

模板资料

来源平台
GitHub
资料与维护参考分
资料较少 · 45 / 100
技术栈
Rails
网站类型
启动器
这个分数如何计算

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

这个项目需要核对什么

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

目前没有记录演示链接。请依据仓库说明在本地评估;仅凭截图无法确认交互行为。

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

查看具体选型方法 →

介绍的制作与核对状态

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

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

查看当时使用的来源资料

SHA-256: 2bafebfac8b085deadb2aac7807bf268ad0446036ecd32c1f657bc4d27bef256

2026-10-13T05:04:08.440Z

来源文件 / 仓库
Cybros Core
====

[![CircleCI](https://circleci.com/gh/jasl/cybros_core.svg?style=svg)](https://circleci.com/gh/jasl/cybros_core)

This is a barebone Rails 6.0 app to show some basic configurations.

I'm used to maintaining a barebone app that helps me build new project quickly,
and this is extracted from my side project initially for sharing my ideas to friends,
but if this is valuable to you, use it freely.

## Goal

I hope this could be a template for new apps, it should be production-ready,
so I'll keep polishing the codebase, follow best practice, keep dependencies up to date.

I don't wanna add too much features especially business-specific,
but I'd like to perfection User system (based on Devise) because most apps need this,
and keep improving UI/UX relates works.

BTW: I'm really hoping someone could extract GitLab's user system.

I list some helps wanted, see below.

## Features

### Classic front-end

Personally, I'm not skilled at front-end and I still prefer classic Rails server-side rendering,
and partially introduce React or Vue for complex pages.

A good example is Gitlab, I also cheat some useful helpers to this app.

#### Webpacker 5 without Sprockets

Webpacker can do all the jobs that Sprockets does,
and has full support of front-end community,
So I remove Sprockets and tune Webpacker allows Assets Pipeline experience.

I do these:

- Remove gems related to Sprockets
- Search and remove `assets` related configs
- `resolved_paths: ['app/assets']` in `config/webpacker.yml`
- `app/javascript/packs/application.js` require all static assets (images, webfonts, etc.)

#### CoreUI with Bootstrap, FontAwesome

See `app/assets/stylesheets/application.scss`

### Application configuration

#### A hack about Rails Credentials

Rails Credentials is a useful feature to store security-sensitive configs.

But we can't bundle `master.key`, and `credentials.yml.enc` isn't readable,
so it's difficult to redistribute the app,
I gave a [PR to Rails](https://github.com/rails/rails/pull/34777) but no respond,
I consistantly think it's useful so I integrate it as a hack, see `bin/rails`.

So you can copy `config/credentials.yml.example` as `config/credentials.yml`,
edit it, then run `rails credentials:encrypt` that will generate `config/credentials.yml.enc` and `config/master.key` for you.

#### A hack about ActionMailer configuration

Unlike `database.yml`, ActionMailer's config separates in many files,
I do a hack that you can config ActionMailer in one place.

See `config/mailer.yml`

Codes in `config/application.rb`

### Implemented a full-feature layouts & views

I don't have art skill but ... at least it works!

#### Overrides Form Helpers to enhance them to support Bootstrap form validation style

The technique is in <https://guides.rubyonrails.org/engines.html#implementing-decorator-pattern-using-class-class-eval>

See `app/overrides/action_view/helpers/form_builder_override.rb`

In addition, see `config/application.rb` for how to require overrides.

#### Don't render ActionView's default error field wrapper

That will break many CSS frameworks.

See `config/initializers/action_view.rb`

#### Default value for model fields

See `app/models/concerns/acts_as_default_value.rb`

Default value of column can only be a static value,
Active Record's `attribute` DSL can set default for field but doesn't have entity context,
Using hooks (such as `after_initilize`) to set default values has edge cases,
you can use `default_value_for` to set default value.

Here's a complex example:

```ruby
default_value_for :role_id,
                    -> (member) {
                      if member.has_attribute?(:tenant_id) || member.tenant
                        member&.tenant&.member_role&.id
                      end
                    }, allow_nil: false
```

#### I18n for `enum`

See `app/models/concerns/enum_attribute_localizable.rb`

Rails doesn't have best practice for `enum` I18n,
I integrate my personal practice.

For example, I have a model `Post` with `status` column for `enum`

```ruby
class Post < ApplicationRecord
  enum status: %i[draft published archived]
end
```

The locale `post.en.yml` looks like

```yaml
en:
  activerecord:
    models:
      post: Post
    attributes:
      post:
        status: Status
        statuses:
          draft: Draft
          published: Published
          archived: Archived
```

To render human readable post's status, you can do like this:

```ruby
Post.human_enum_value(:status, @post)
```

### Undocumented yet

TODO:

## Run the app

- Clone it
- `bundle`
- `yarn`
- `cp config/database.yml.example config/database.yml`
- `cp config/credentials.yml.example config/credentials.yml` & `rails credentials:encrypt`
- `cp config/mailer.yml.example config/mailer.yml`
- `rails db:migrate`
- `rails s`

### Receive Devise confirmation mail

In development, I use `mailcatcher` to receive mails,
run `gem install mailcatcher` to install it.

Open a new terminal, run `mailcatcher`, then follow the instructions

### Set user as admin

- `cp config/settings.yml config/settings.local.yml`
- Put your email into `admin.emails`
- In user menu (right-top of pages), you should see `Administration`

## Troubleshooting

Make sure run `gem update --system` to use latest Rubygem

## Help wanted

- UI/UX design & SCSS & HTML improvement
- Layout for mails
- Coding style & structural improvement
- Try support uploading user avatar using ActiveStorage
- Find bugs
- Docker for deployment, including stages to compiling assets & copy `yml`s, easy to migrate to k8s

## Screenshots

![Sign in page](_screenshots/sign_in_page.png)
![Admin user page](_screenshots/admin_user_page.png)

## License

[MIT License](https://opensource.org/licenses/MIT).
反馈内容错误

看看同类模板

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