New rails projects
Use rails new — do not try to create it manually. Use rails generators whenever possible.
Key configuration
Always use the following unless explicitly instructed otherwise:
- postgres for the database
- rspec for testing
- sidekiq for jobs
- kamal for deployment
Make things start using foreman, defining a Procfile.dev, eg:
web: rails s -b 0.0.0.0 -p 3000
worker: bundle exec sidekiq
redis: redis-server
vite: bin/vite dev
(redis is nice to start inline, rather than as a service)
Recommended libraries
Apply these if relevant. Not all projects will need these, but most will.
- sidekiq-scheduler: cron-like recurring jobs for Sidekiq, such as nightly cleanup, polling, syncs, and reminders.
- sidekiq-unique-jobs: prevents duplicate Sidekiq jobs from being enqueued or run at the same time.
- colorize: adds colored terminal output, useful for rake tasks, scripts, logs, and dev tooling.
- annotaterb: writes database schema comments into Rails models/specs so column names and types are visible in code.
- vite-rails: integrates Vite with Rails for modern JS/CSS bundling, fast dev reloads, and frontend asset handling.