Skip to content

Rails 7 template using Vite, Stimulus and TailwindCSS

Notifications You must be signed in to change notification settings

grascovit/rails-template

Repository files navigation

Rails Template

Rails 7.1 application template that includes TailwindCSS, Stimulus and Vite.

Instructions

  1. Clone this repository (replace your-project-name)
git clone --depth=1 --branch=main git@github.com:grascovit/rails-template.git your-project-name && cd your-project-name && rm -rf .git .github
  1. Run bin/rails app:template LOCATION=https://gist.githubusercontent.com/grascovit/4e1e8d6b49ab62ad45ac19165686afad/raw/ea1019531ec98787a739b12539cbfd079948c63f/rails_template.rb to replace the placeholder name with your project's name.
  2. Be sure to confirm the domain at app/mailer/application_mailer.rb.
  3. Remember to set the credentials from your email service in config/environments/production.rb before deploying.
  4. Run the project with foreman start -f Procfile.dev.

Remember to run bundle install if you change your Gemfile or yarn install if you change your package.json.

Tools

You can run your test suite with bundle exec rspec.

Static code analyzer that can be run with rubocop --require rubocop-rails (or rubocop --require rubocop-rails -A to apply Rubocop's suggestions).

You can also tweak its settings in .rubocop.yml.

Runtime developer console very useful to debug that can be used by inserting binding.pry in the code.

To use it, run the app with rails s in one terminal and bin/vite dev in another instead of using foreman start -f Procfile.dev.

Load environment variables that can be accessed via ENV. Create the .env file and define it like VARIABLE_NAME=123.

About

Rails 7 template using Vite, Stimulus and TailwindCSS

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published