Ruby on Rails project structure

Ruby on Rails project structure

Explorer

  • .git…
  • .github
  • dependabot.yml
  • .kamal
  • hooks
  • secrets
  • app
  • bin
  • brakeman
  • bundler-audit
  • ci
  • dev
  • docker-entrypoint
  • importmap
  • jobs
  • kamal
  • rails
  • rake
  • rubocop
  • setup
  • thrust
  • config
  • application.rb
  • boot.rb
  • bundler-audit.yml
  • cable.yml
  • cache.yml
  • ci.rb
  • credentials.yml.enc
  • database.yml
  • deploy.yml
  • environment.rb
  • importmap.rb
  • master.key, not committed
  • puma.rb
  • queue.yml
  • recurring.yml
  • routes.rb
  • storage.yml
  • db
  • cable_schema.rb
  • cache_schema.rb
  • queue_schema.rb
  • seeds.rb
  • schema.rbnew
  • lib
  • log…
  • public
  • 400.html
  • 404.html
  • 406-unsupported-browser.html
  • 422.html
  • 500.html
  • icon.png
  • icon.svg
  • robots.txt
  • script
  • backfill_enrollment_status.rbnew
  • storage…
  • test
  • test_helper.rb
  • helpers…
  • tmp…, not committed
  • vendor
  • javascript…
  • .dockerignore
  • .gitattributes
  • .gitignore
  • .rubocop.yml
  • .ruby-version
  • config.ru
  • Dockerfile
  • Gemfile
  • Gemfile.lock
  • Procfile.devnew
  • Rakefile
  • README.md
  1. # Install Rails (needs Ruby 3.2 or newer; a version manager such as mise or rbenv is easiest)

    gem install rails
  2. # Create the app with SQLite, import maps and Hotwire (the defaults)

    rails new tuition
  3. # Or choose PostgreSQL and Tailwind at creation time

    rails new tuition --database=postgresql --css=tailwind
  4. # Start the development server

    cd tuition && bin/dev
  5. # Add session based sign-in, password reset and a User model

    bin/rails generate authentication && bin/rails db:migrate
  6. # Generate a resource with model, migration, controller, views and tests

    bin/rails generate scaffold Course title:string description:text seats:integer starts_on:date
  7. # Run every CI step locally

    bin/ci
  8. # Prepare the server and deploy the first time with Kamal

    bin/kamal setup