Skip to content

digitalWestie/speedrail

 
 

Repository files navigation

Speedrail

a Rails 7 boilerplate template by @ryanckulp, created to ship SaaS apps quickly. Learn how to use this at 24 Hour MVP.

features:

  • user authentication via Devise
  • design via Tailwind UI
  • user billing management via Stripe Checkout portal
  • safely manage ENV variables with Figaro
  • responsive toggle navbar w/ logic for login, signup, settings
  • SEO toolbelt via metamagic
  • rename your app in 1 command with Rename
  • increased debugging power with Better Errors
  • seed your DB in seconds via Seed Dump
  • production-ready DB via Postgres
  • easy API requests with HTTParty
  • Postmark for transactional emails, letter_opener for local dev mailers
  • script tag component (Google Analytics, etc)
  • testing suite via RSpec
  • cron job task scheduler (lib/tasks/scheduler.rake)
  • random data generation with Faker
  • Heroku <> Cloudflare HTTPS via lib/cloudflare_proxy.rb
  • background job queue via Delayed
  • paid subscriptions CRUD via Stripe Checkout
  • interactive charts via Chartkick

Installation

  1. clone the repo
  2. bin/speedrail new_app_name

Development

bin/dev # uses foreman to boot server, frontend, and bg job queue

troubleshooting

ActionCable - to support WebSockets, run rails g channel channel_name --assets then add mount ActionCable.server => '/cable' to config/routes.rb. update cable.yml -> production: to include the following for Heroku to connect w/ Redis for ActionCable.broadcast:

ssl_params:
    verify_mode: <%= OpenSSL::SSL::VERIFY_NONE %>

Turbo Drive lazy-loads pages following form submission, causing script tags at the bottom of following views to not always load.

<!-- add data-turbo=false to form submission buttons if the following view needs a full render -->
<button data-turbo="false" type="submit" ...>Submit</button>

Testing

bundle exec rspec # run all tests inside spec/
bundle exec rspec spec/dir_name # run all tests inside given directory

Deploying

figaro heroku:set -e production # you only need to do this once
heroku git:remote -a heroku_app_name_here # you only need to do this once
git push heroku master # deploys master branch
git push heroku some_branch_name:master # deploys non-master branch

note: Heroku must have 2 'dynos' enabled, web + worker, to process background jobs. if you don't need a queue, simply remove the worker task from Procfile and don't invoke .delayed functions.

Miscellaneous

to use Postmark for emails, set postmark_api_token inside application.yml, then verify your sending domain.

About

Rails 7 app template: user auth, Stripe billing, Tailwind CSS, admin panel, SEO, gravatar, etc

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Ruby 52.3%
  • HTML 45.2%
  • JavaScript 1.9%
  • Other 0.6%