rails-template
My preferred template for getting started with Rails
What's in the box?
- Devise for user authentication
- UUIDs as the default model ID type
- Tailwind for CSS
- PostgreSQL database
- esbuild for bundling JS assets
- strong_migrations for helping me understand if I'm writing a bad migration or not
- view_component for building views
- Code formatting
- Prettier
- standard
- Auto-formatting and linting as a pre-commit hook using husky and lint-staged
Setup
First clone this repo to your local machine. Then run the following command
yes | rails new app_name -f -m /path/to/rails-template/template.rb -j esbuild -c tailwind -d postgresql
Explaning the arguments:
yes |
- Answers yes when the bullet gem asks if Bullet should be installed during tests.app_name
- Replace with the app name / directory you want the Rails app to be placed in.-f
- Force any templates to be overridden (this prefers my Tailwind config over the Rails default config).-m /path/to/rails-template/template.rb
- use this Rails template-j esbuild
- Use esbuild to bundle JavaScript.-c tailwind
- Use Tailwind as the CSS framework.-d postgresql
- Use the PostgreSQL database.