Project tutorial

Build a Rails Blog

Build Junction Almanac with Rails, PostgreSQL, ERB, Pico.css, secure session authentication, profiles, owned post CRUD, search, password reset, and Fly.io deployment.

  • Difficulty Intermediate
  • Parts 12
  • Stack Ruby, Rails 7.1, ERB, Pico.css, PostgreSQL, Active Storage, has_secure_password

How this project works

Junction Almanac is an original teaching blog built as twelve complete Rails snapshots. Clone the repository once and run any numbered folder without replaying every earlier lesson.

The course uses Rails conventions without hiding authentication behind Devise. You will see has_secure_password, a small session controller, an explicit current-user object, server-side ownership checks, and expiring one-use reset tokens.

Snapshots 4–12 seed [email protected] and [email protected] with password123. PostgreSQL runs from the root Compose file on host port 5434, while unique database names keep the snapshots independent.

The final app packages the same code in a multi-stage Docker image and deploys to Fly.io on internal port 3000. Environment variables provide the database URL, application host, and Rails secret.

Start with part 1 Open GitHub repo

Parts in order

Work through the parts in sequence. Each lesson explains the ideas in plain language, then points you to a complete runnable snapshot on GitHub for that stage.

  1. Part 1: Getting StartedBoot a minimal Rails application on port 3000.
  2. Part 2: RoutingMap home and about URLs to controller actions.
  3. Part 3: Layout and UICreate a shared ERB layout styled with Pico.css.
  4. Part 4: Data LayerPersist users and posts with PostgreSQL and Active Record.
  5. Part 5: Feed and DetailRender a database-backed feed and individual post pages.
  6. Part 6: RegistrationRegister users with validated, hashed passwords.
  7. Part 7: Login and SessionsAuthenticate users with Rails cookie sessions.
  8. Part 8: Profiles and MediaEdit public profiles and upload avatars with Active Storage.
  9. Part 9: Posts CRUD and OwnershipCreate, update, and delete only the signed-in author's posts.
  10. Part 10: Pagination and SearchPaginate the feed and search PostgreSQL text safely.
  11. Part 11: Password ResetSend expiring one-use password reset links.
  12. Part 12: DeployPackage and deploy Junction Almanac to Fly.io.