---
title: "How to Build a Web App with and without Rails Libraries"
description: "This tutorial builds Mirth, a Ruby web application that lets users view displayed data and enter new data that persists, using a birthday tracker as its example. It first constructs the application with core Ruby libraries, explaining TCP sockets, HTTP requests and responses, persistent storage, and the need for a web server interface such as Rack. It then replaces that lower-level code with Rails libraries, including Action Controller, Action Dispatch, Active Record, and Action View, while using ERB templates and a configured view path. The tutorial shows how routing, database access, request handling, and HTML generation fit together, with the application available at localhost:1337/birthdays after the Rails-library version is run. Its conclusion is that building from scratch clarifies the implementation details Rails hides, while Rails remains the practical choice for web development."
---

# How to Build a Web App with and without Rails Libraries

[Shopify](https://yomu.fyi/company/shopify) · 2023-10-18 · Mar 26, 2021

**Type:** Tutorial

## Summary

This tutorial builds Mirth, a Ruby web application that lets users view displayed data and enter new data that persists, using a birthday tracker as its example. It first constructs the application with core Ruby libraries, explaining TCP sockets, HTTP requests and responses, persistent storage, and the need for a web server interface such as Rack. It then replaces that lower-level code with Rails libraries, including Action Controller, Action Dispatch, Active Record, and Action View, while using ERB templates and a configured view path. The tutorial shows how routing, database access, request handling, and HTML generation fit together, with the application available at localhost:1337/birthdays after the Rails-library version is run. Its conclusion is that building from scratch clarifies the implementation details Rails hides, while Rails remains the practical choice for web development.

## Context

The tutorial is motivated by understanding what Ruby on Rails abstracts away by building a web application without Rails first, using only standard Ruby libraries. It contrasts that low-level process with the Rails approach so the roles of web protocols, persistence, Rack, and Rails components become clearer.

## Approach / What changed

The application is built in two stages. The first uses Ruby sockets and core libraries to handle TCP, HTTP, persistent data, and web responses. The second substitutes Rails libraries including Rack, routing, Action Controller, Action Dispatch, Active Record, and Action View, with ERB templates generating the HTML.

## Takeaways

- The Mirth example uses a birthday tracker to demonstrate viewing data, entering new data, and persisting that data in a web application.
- The tutorial explains HTTP messages as a start line, zero or more headers, a blank line, and an optional body, with requests and responses using different start-line forms.
- The Rails version uses Action View with ERB templates, controller instance variables, helper methods, and a view path matching Rails conventions.

**Tags:** [Architecture](https://yomu.fyi/topic/architecture), [Ruby](https://yomu.fyi/topic/ruby)

- Source: [Shopify](https://shopify.engineering/building-web-app-ruby-rails)
- Source URL: https://shopify.engineering/building-web-app-ruby-rails
- Ingested by Yomu: 2026-08-31T01:09:57.750Z

[Read original post](https://shopify.engineering/building-web-app-ruby-rails)
