---
title: "How to Build a Web App with and without Rails Libraries"
description: "Builds a small birthday-tracker web app called Mirth from scratch in plain Ruby, then rebuilds it with Rails components to show what each layer abstracts away."
url: "https://swe.quest/articles/how-to-build-a-web-app-with-and-without-rails-libraries-4251321e95591e52"
canonical: "https://shopify.engineering/building-web-app-ruby-rails"
source: "Shopify Engineering"
published: "2021-03-26"
difficulty: "medium"
kind: "How-to"
reading_minutes: 28
tags: ["ruby","networking","api-design"]
---

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

A post on [Shopify Engineering](https://swe.quest/sources/shopify.md), published 2021-03-26, 28 min read, How-to. Original: [https://shopify.engineering/building-web-app-ruby-rails](https://shopify.engineering/building-web-app-ruby-rails)

## Summary

Builds a small birthday-tracker web app called Mirth from scratch in plain Ruby, then rebuilds it with Rails components to show what each layer abstracts away. It starts with a TCP server on Ruby's socket library and adds hand-written HTTP request-line parsing, GET/POST routing, Content-Length body reading and response construction with 303 redirects. Later sections add persistent storage and swap in Rack plus Rails libraries (Action Controller, Action Dispatch, Active Record, Action View). The payoff is a concrete picture of what Rails handles for you.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Ruby](https://swe.quest/tags/ruby.md) (Languages)
- [Networking](https://swe.quest/tags/networking.md) (Infrastructure)
- [API design](https://swe.quest/tags/api-design.md) (Backend & APIs)

## Prerequisites

- basic Ruby ([easy posts on Ruby](https://swe.quest/tags/ruby.md?difficulty=easy))
- command line usage

## Keywords

Ruby on Rails, Rack, TCP, HTTP, Active Record, Action Controller, Action View, Action Dispatch

## Related posts

- [Turso Adds Ruby on Rails Support](https://swe.quest/articles/turso-adds-ruby-on-rails-support-80c171904d4e2326.md): Turso · 2024-12-18 · Medium · 3 min read · Ruby, SQLite, Databases
  Turso has released a technical preview of libsql\_activerecord, an ActiveRecord adapter that connects Rails applications to Turso/libSQL databases.
- [Building a Business System Integration and Automation Platform at Shopify](https://swe.quest/articles/building-a-business-system-integration-and-automation-platform-at-shopify-ca92d2227e71ff9f.md): Shopify Engineering · 2022-04-22 · Medium · 11 min read · Ruby, System design, API design, Testing
  Shopify replaced Mulesoft with an in-house Ruby on Rails platform for integrating internal business systems such as Salesforce, Airtable and Netsuite, because the proprietary JVM/XML tool sat outside Shopify's stack and couldn't easily reach internal services like Kafka.
- [Shopify-Made Patterns in Our Rails Apps](https://swe.quest/articles/shopify-made-patterns-in-our-rails-apps-92bda4387ca54f09.md): Shopify Engineering · 2021-07-13 · Easy · 8 min read · Ruby, Developer productivity, Distributed databases, System design, Schema migrations
  Shopify's Rails monolith relies on a set of in-house patterns: the dev CLI for consistent environment setup, a podded architecture that shards the full infrastructure stack by shop, and domain-driven components that share a single database with no database-level foreign keys.
- [Migrate a Rails App from Heroku to Render](https://swe.quest/articles/migrate-a-rails-app-from-heroku-to-render-a8a375d8766a19ae.md): Render · 2022-05-23 · Medium · 8 min read · Ruby, Infrastructure as code, Deployment, Cloud platforms
  Migrating the open-source git-scm.org Rails app from Heroku to Render means mapping Heroku concepts (web/worker processes, dynos, Heroku Postgres/Redis, Scheduler, config vars) to Render equivalents and codifying the whole stack in a render.yaml Blueprint.
- [Migrating From Heroku To Railway](https://swe.quest/articles/migrating-from-heroku-to-railway-dbd89b10c75a9d07.md): Railway · 2022-08-19 · Medium · 7 min read · Deployment, Cloud platforms, Ruby
  Moving a Heroku app to Railway comes down to three steps: deploy from a GitHub repo, import Heroku config vars, and add Postgres and Redis as separate database services.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
