# Limestone
[![<archonic>](https://circleci.com/gh/archonic/limestone.svg?style=svg)](https://circleci.com/gh/archonic/workflows/limestone/tree/master)
Limestone is a boilerplate SaaS app built with Rails 6 on Ruby 2.7.2 and has an opinionated integration with NPM using [Webpacker](https://github.com/rails/webpacker) and [Stimulus](https://stimulusjs.org/).
## Vote!
Help decide future features and changes for Limestone with this poll:
https://www.strawpoll.me/42684734/
## Versions
Versioning in this repo in intended to maintain and modernize the boilerplate. New versions are not intended to update existing forks, although looking through the commits serves as a good upgrade resource.
v0.1 is Rails 5.2
v0.2 is Rails 6
v0.3 introduces the [Pay gem](https://github.com/pay-rails/pay)
v0.4 uses ruby 2.7.2
See more in the [changelog](https://github.com/archonic/limestone/blob/master/CHANGELOG.md).
## The Stack
The [gemset](https://github.com/archonic/limestone/blob/master/Gemfile) has been chosen to be modern, performant, and take care of a number of business concerns common to SaaS.
## Features
* Free trial begins upon registration without credit card. Number of days is configurable with ENV var.
* Subscription management. Card update form, switch plan form and cancel account button.
* [Devise confirmable](https://github.com/heartcombo/devise/wiki/How-To:-Add-:confirmable-to-Users) installed and configured.
* Emails for welcome, receipt, refund, subscription renewing and payment action required.
* [letter_opener](https://github.com/ryanb/letter_opener) and [letter_opener_web](https://github.com/fgrehm/letter_opener_web) installed and configured. Visit /admin/letter_opener in development to see emails sent.
* Mail sends through Sidekiq with deliver_later for production. [Sendgrid](https://sendgrid.com/) is configured and ready to use once your API keys are set in ENV.
* Direct cloud uploading with [ActiveStorage](https://edgeguides.rubyonrails.org/active_storage_overview.html). Lazy transform for resizing. Demonstrated with user avatars.
* Icon helper for user avatars with fallback to user initials.
* Icon helper for [Font Awesome 4.7](https://fontawesome.com/v4.7.0/icons/) icons.
* Administrate dashboard lets you CRUD records. Easy to add more models and customize as you like. Visit /admin/.
* Impersonate users through Administrate dashboard.
* Pretty modals using Bootstrap integrated into rails_ujs data-confirm. Demonstrated with cancel account button.
* Banner with a link to billing page users that are past due.
* Opinionated search integration using Elasticsearch via Searchkick. Gem is in place but integration is up to you.
* Feature control using the [Flipper](https://github.com/jnunemaker/flipper) gem. Demonstrated with the `public_registration` feature.
* 84% RSpec test coverage.
* Solargraph (language server for code-aware auto-completions) configured in docker-compose.yml. Just point to localhost:7658 in your solargraph extension in your code editor.
## Notes
* RSpec controller tests have been omitted in favour of requests tests.
* You can run tests locally with `docker-compose run web rspec`
## Pre-requisites
### Development
* Install [Docker](https://docs.docker.com/engine/installation/) and [Docker Compose](https://docs.docker.com/compose/install/)
* A [Stripe](https://dashboard.stripe.com/register) account and a [Stripe API Key](https://stripe.com/docs/keys).
### Test
* [Codeship](https://codeship.com/) files are in place - just create an account and integrate with your repo. You will need to create your [codeship.aes file](https://documentation.codeship.com/pro/builds-and-configuration/environment-variables/#downloading-your-aes-key), [install jet](https://documentation.codeship.com/pro/jet-cli/installation/) and run `jet encrypt .env .env.encrypted`.
* [CircleCI](https://circleci.com/) files are in place - just create an account and integrate with your repo.
* **NOTE** Limestone expects your product prices to have trial days > 0. If you don't create a trial, testing will get the error `Pay::Error: This customer has no attached payment source or default payment method.`.
* You could also just run test locally with `docker-compose run web rspec` or `docker-compose exec web rspec` if you've already run `docker-compose up`.
### Production
* A cloud storage account [compatible with ActiveStorage](https://edgeguides.rubyonrails.org/active_storage_overview.html#setup).
* Because Docker is already configured, you may want a Kubernetes host ([GKE](https://cloud.google.com/kubernetes-engine/), [AWS](https://aws.amazon.com/kubernetes/) or [DigitalOcean](https://www.digitalocean.com/products/kubernetes/)).
## Getting Started
1. Clone this repository at the most recent tag and `cd` into it:
```
git clone -b 'v0.3' --single-branch --depth 1 https://github.com/archonic/limestone.git
cd limestone
```
2. Make a copy of `.env-example` named `.env`:
```
cp .env-example .env
```
3. Update the `.env` file - running the project requires you change the following:
- `STRIPE_API_KEY`
- `STRIPE_PUBLISHABLE_KEY`
- `STRIPE_SIGNING_SECRET` (This can be something random)
You probably want to update the `ADMIN_*` environment variables. If you want a different `COMPOSE_PROJECT_NAME` and database name, now is the best time to do that.
4. Run `docker-compose run web yarn install --pure-lockfile` to download images, build your development image and install node_modules. This will take a while.
5. Run `docker-compose up` to run your project and it's dependencies.
5. Once everything is up, run `docker-compose exec web rails db:prepare` to create DB, load schema and seed. Seeding will also create your plan(s) in Stripe.
6. Visit [http://localhost:3000](http://localhost:3000) and rejoice :tada: You can login using the Admin user defined in `.env`. Keep in mind your admin doesn't have active billing. Enter a [test card](https://stripe.com/docs/testing#cards) when prompted or by visiting /subscribe.
7. See the [Limestone Wiki](https://github.com/archonic/limestone/wiki) more about [development with Docker](https://github.com/archonic/limestone/wiki/Development-with-Docker)
### Note About Flipper / Public User Registration
1. The [Flipper gem](https://github.com/jnunemaker/flipper) controls feature flagging and provides a UI. Visit the `/admin/flipper`.
2. The feature called `public_registration` has been created for you (during seeding). You can enable/disable this to control user registration :clap:
### Setting up production
A wiki will be written about this. Feel free to help out here if you're familiar with Docker/Kubernetes.
没有合适的资源?快使用搜索试试~ 我知道了~
BoilerplateRails6SaaS应用程序与Webpack、Stimulus和Docker.zip
共262个文件
rb:106个
haml:37个
yml:16个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 174 浏览量
2023-04-06
22:19:30
上传
评论
收藏 321KB ZIP 举报
温馨提示
BoilerplateRails6SaaS应用程序与Webpack、Stimulus和Docker
资源推荐
资源详情
资源评论
收起资源包目录
BoilerplateRails6SaaS应用程序与Webpack、Stimulus和Docker.zip (262个子文件)
.browserslistrc 9B
bundle 156B
chromedriver 823B
chromedriver-update 837B
ci 210B
coderay 801B
Dockerfile 1KB
.dockerignore 47B
db.env 97B
app.env 88B
.env-example 5KB
_collection.html.erb 4KB
_navigation.html.erb 1012B
index.html.erb 998B
application.html.erb 884B
_javascript.html.erb 493B
_flashes.html.erb 429B
sidekiq.yml.erb 162B
Gemfile 3KB
.gitignore 735B
_navbar_loggedin.haml 1KB
edit.haml 1KB
application.haml 1KB
pricing.haml 1KB
_links.haml 1KB
haml 792B
new.haml 769B
_navbar_loggedout.haml 736B
edit.haml 602B
_form.html.haml 545B
new.haml 479B
_card_form.haml 467B
_signin_form.haml 462B
_plan_switch_form.haml 451B
invoice_failed.haml 441B
new.haml 437B
new.haml 373B
new.haml 372B
reset_password_instructions.haml 362B
pro.haml 338B
welcome_email.haml 332B
source_expiring.haml 294B
trial_will_end.haml 265B
show.haml 257B
unlock_instructions.haml 249B
_past_due.haml 199B
invoice_paid.haml 193B
confirmation_instructions.haml 176B
mailer.haml 173B
new.haml 134B
cancelled.haml 125B
show.haml 118B
billing_updated.haml 107B
password_change.haml 106B
features.haml 56B
about.haml 48B
mailer.text.haml 8B
haml-lint 807B
404.html 2KB
422.html 2KB
500.html 2KB
htmldiff 804B
favicon.ico 0B
modals.js 10KB
subscriptions.js 3KB
babel.config.js 2KB
application.js 1KB
hello_controller.js 448B
environment.js 447B
index.js 396B
consumer.js 271B
postcss.config.js 224B
index.js 212B
development.js 155B
test.js 155B
production.js 154B
global.js 128B
manifest.js 23B
package.json 568B
.keep 0B
.keep 0B
.keep 0B
.keep 0B
.keep 0B
.keep 0B
.keep 0B
.keep 0B
ldiff 798B
listen 798B
yarn.lock 328KB
Gemfile.lock 12KB
README.md 7KB
CHANGELOG.md 1KB
LICENSE.md 1KB
UPGRADING.md 299B
nokogiri 804B
money_sloth.png 20KB
logo.png 14KB
apple-touch-icon.png 0B
apple-touch-icon-precomposed.png 0B
共 262 条
- 1
- 2
- 3
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9156
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功