We build Ruby on Rails apps.

Railscoder is a small studio shipping full-stack Rails applications — and taking them native on iOS and Android with Hotwire Native. Here's what we've built, and what we've learned along the way.

How We Build

One stack, top to bottom. No framework sprawl.

Rails All the Way Down

Rails 8 monoliths with Hotwire on the front end and SQLite plus the Solid trifecta — Queue, Cache, and Cable — behind it. No Redis, no SPA framework, no build step we don't need.

Native with Hotwire Native

The same Rails app ships as real iOS and Android applications. Native navigation, native screens where they earn their keep, and one codebase to maintain instead of three.

Full Stack, Start to Finish

Design, build, deploy, and run it. We provision the servers and handle the deploys, backups, and monitoring that keep what we ship online.

From the Blog

Rails recipes, tutorials, and development logs.

All articles →
November 26, 2026

Loud, Then Calm: Redesigning VegasSims in 10 PRs with Rails 8.1 and Tailwind CSS v4

When you run a sports simulation platform, trust is the entire product. Every day, VegasSims runs 10,000+ Monte Carlo simulations per game built on confirmed daily lineups across MLB, NFL, NBA, NHL, WNBA, and MLS, comparing model probabilities against sportsbook odds to surface betting edges. If the data is sharp but the interface feels chaotic, readers bounce. Over three days—November 24 through November 26, 2026—we shipped a complete redesign of VegasSims across 10 single-purpose pull requests (#34 through #43). The story of those three days comes down to four words: loud, then calm. We started by swinging hard at a bold, high-voltage aesthetic, lived with it for a day, realized it was too loud for a serious data tool, and pivoted to a calmer, content-first architecture. Because we built on plain Rails, Hotwire, and Tailwind CSS v4 design tokens, that pivot didn't require a rewrite—just a few edits to a single CSS file. The Stack: Zero New GemsEverything in this redesign was built using the existing VegasSims stack, adding zero new gems and zero JavaScript packages: • Backend & Database: Ruby on Rails 8.1 backed solely by SQLite, running the Solid trifecta (Solid Cache, Solid Queue, Solid Cable) and Active Storage for article covers. • Frontend: Hotwire (Turbo + Stimulus) with importmap (no Node build step) and Tailwind CSS v4. • Testing & CI: Minitest paired with GitHub Actions running RuboCop, Brakeman, an importmap JavaScript audit, and the full test suite (which grew from 270 to 295 passing tests during the sprint). • Deployment & Mobile: Auto-deployed on merge via Hatchbox, with Hotwire Native iOS and Android apps wrapping the web views. Each PR was developed on its own branch, verified in a browser across desktop, tablet, and phone viewports in both dark and light modes, and merged to main—meaning merging equaled shipping. Making a Re-Theme a One-File ChangeIn PR #34, our first instinct was to avoid looking like every other green-and-slate betting dashboard. We launched a volt yellow-green and violet palette alongside a new "coin" brand mark (a green coin with a white ring and lightning bolt, replacing an old bell-curve icon that turned into a smudge at favicon size). After 24 hours with it, the volt-and-violet theme felt overly aggressive. Taking cues from established sports data platforms like Sportsline and Action Network, PRs #35 and #36 pulled the palette back to near-neutral charcoal surfaces (ink) with a single, disciplined accent color (brand green) reserved strictly for primary actions, favored-side indicators, and positive edge chips. Because Tailwind CSS v4 configures design tokens directly in CSS via @theme, pivoting the entire application's look came down to redefining two custom color scales in app/assets/tailwind/application.css: @theme { --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif; --font-weight-extrabold: 700; --font-weight-black: 800; --color-brand-500: #15a35a; --color-brand-600: #11864a; --color-ink-900: #17161f; --color-ink-950: #0e0d14; /* ...full brand and ink scales... */ }Instead of guessing by eye, we checked contrast ratios with numbers: • brand-400 text on dark cards: 6.0:1 • brand-600 (#11864a) text on white: 4.6:1 (the brightest green on our hue that clears the 4.5:1 AA threshold) • brand-500 (#15a35a) large text on white: 3.3:1 (clearing the 3:1 requirement for large stats and wordmarks) Dark mode remains the default experience, and setting the CSS color-scheme property ensures native form controls follow the active site theme rather than fighting the user's OS setting. A 40-Line Minitest Guardrail for Invisible TextOne subtle trap with Tailwind CSS is that referencing a shade that doesn't exist in your palette—like text-red-650—doesn't throw an error. Tailwind silently omits the utility class, leaving text uncolored and effectively invisible in one theme. During the redesign, we caught several real instances of this on our Log out and Cancel Subscription buttons, as well as light-mode loss figures. To prevent regressions, we wrote a ~40-line Minitest check (test/views/color_classes_test.rb) with zero external dependencies. It parses the shades defined inside our @theme block, scans every ERB template and Stimulus controller for color utility classes, and fails the build if any view references a nonexistent shade. If you maintain a custom palette in Tailwind v4, this is one of the highest-leverage tests you can add to your suite. Typography Built for Odds and ScoresSports analytics interfaces live and die by dense numbers. We standardized on two self-hosted variable web fonts totaling roughly 78 KB on a first visit: 1. Inter (400–800): Used for all UI copy and articles thanks to its tall x-height and clear distinction between 1/l/I and 0/O in compact odds tables. 2. Outfit (800–900): Reserved strictly for scoreboard numerals and headline stats via a custom Tailwind v4 @utility rule: @utility font-score { font-family: "Outfit", "Inter", ui-sans-serif, system-ui, sans-serif; font-weight: 900; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }We also remapped --font-weight-extrabold to 700 and --font-weight-black to 800 inside @theme. That single token adjustment toned down heavy headings across dozens of existing templates without touching a single ERB file. Team-Color Win Bars and Color-Math Edge CasesPreviously, our win-probability bars always colored the away team's segment. In PRs #35 and #38, we replaced that with a shared shared/_win_bar partial that fills both sides with each team's actual primary color so the larger block visually anchors the favorite. Real-world team palettes introduce immediate edge cases, which we encapsulated in a tested TeamColorsHelper: • Look-alike matchups: When two navy-blue teams play each other (an RGB Euclidean distance under 90), the home side automatically falls back to its secondary color. • Near-black primaries: Teams like the Spurs, Nets, or Penguins vanish against dark charcoal cards, so they switch to their secondary color—or a neutral grey if their secondary is white. • Sliver thresholds: Percentage labels are omitted on segments narrower than 18% so text never overflows. • Dynamic label contrast: Labels (DET 60.1%) switch between white and near-black based on the fill color's WCAG relative luminance: def win_bar_label_color(hex) r, g, b = rgb(hex).map do |c| c /= 255.0 c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055)**2.4 end luminance = (0.2126 * r) + (0.7152 * g) + (0.0722 * b) luminance > 0.35 ? "#0e0d14" : "#ffffff" endContent First: The Home Hub and Hybrid Game RowA sports betting site's product is the daily slate, not a hero banner. In PRs #38, #39, and #41, we restructured the information architecture around immediate utility: • Daily Home Hub: The root URL is no longer a marketing landing page (which moved to /about). Visitors now land directly on a live score strip of today's and tomorrow's games, featured analysis, top model edges, and a right rail highlighting the Game of the Day alongside a preview card for our upcoming Bet Tracker. • Flatter Surfaces: We stripped large drop shadows from 51 spots across 27 views, replacing them with flat surfaces and crisp 1px borders that read cleanly in light mode. • One Hybrid Game Row: On the Matchups board, we eliminated the old card-versus-list view toggle (and its tracking cookie) in favor of a single box-score-style game row. Desktop displays aligned column headers; mobile stacks the line and model pick cleanly beneath the matchup. Pro-locked games still display the teams and sportsbook line while gating projections, picks, and win probabilities—matching the amber lock-and-"Pro" badges we added to gated articles on the home page (#43). • Two-Column Board: On desktop, the Matchups board pairs league/date filters and projections on the left with a contextual right rail housing our NRFI/YRFI and BTTS screeners (shown only when viewing relevant leagues) and a concise methodology card. Using plain CSS flex-wrap, the rail drops naturally below the board on narrow screens. Small Stimulus, Big Polish: The Score StripFor the horizontal score strip at the top of the home hub (#39), we wanted native touch scrolling on mobile without ugly scrollbars on desktop. With scrollbar-width: none and a (hover: none) media query hiding controls on touch devices, a ~40-line Stimulus controller (scroller_controller.js) paired with a ResizeObserver handles keyboard-focusable paging arrows that only appear on hover when there is actually more content to scroll: update() { const track = this.trackTarget const maxScroll = track.scrollWidth - track.clientWidth this.prevTarget.hidden = track.scrollLeft <= 2 this.nextTarget.hidden = track.scrollLeft >= maxScroll - 2 }Three Production Lessons from the TrenchesShipping 10 PRs straight to production surfaced three classic Rails and infrastructure gotchas worth keeping in your back pocket: 1. Turbo + Heavy CSS Filters: Our initial hero section used blurred, masked background layers. Navigating back via Turbo in WebKit left those glows half-rendered until a hard refresh. Swapping them for standard CSS radial-gradient backgrounds solved the repaint issue immediately. 2. Purge Cloudflare for Favicons: Updating favicon.ico and favicon.svg in public/ wasn't enough in production—Cloudflare kept serving the cached icon until we explicitly purged /favicon.ico at the CDN edge. 3. Active Storage vs. String URLs: After deploying the new home hub (#40), our featured article cover vanished in production because the template only checked the image_url column while production articles used Active Storage uploads (cover_image). Consolidating rendering into a single helper fixed it everywhere—with a subtle reminder that image_tag treats plain strings as asset-pipeline paths, so external URLs need tag.img: def article_cover_tag(article, **options) if article.cover_image.attached? image_tag(article.cover_image, **options) elsif article.image_url.present? tag.img(src: article.image_url, **options) end endAdmin Tooling for Full-Slate AnalysisFinally, PR #42 streamlined how we generate daily slate breakdowns. Individual game pages already included an admin-only text export containing projections, odds, edges, betting splits, starting pitchers, and injury notes. We extended MatchupsController#index to respond to a third format—format.text alongside HTML and CSV—so clicking Slate report (TXT) exports the entire filtered day's slate in one download, prefixed with a one-line-per-game summary formatted for quick multi-game analysis. Wrapping UpYou don't need a component library, a SPA framework, or a multi-month rewrite to modernize a Rails app. Defining clear design tokens in Tailwind CSS v4 lets you test bold visual ideas and dial them back in hours instead of weeks, while small Minitest assertions catch the silent CSS mistakes that slip past code review. Explore the redesigned boards and daily simulation projections live at vegassims.com.

September 02, 2026

The Production-Ready Rails Setup: Hatchbox, Cloudflare, and Edge Optimization

Getting a Rails app running on a clean VPS via Hatchbox takes about ten minutes. But getting that app to run blazingly fast, handle traffic surges without spiking CPU, and eliminate common SSL and caching traps requires an intentional partnership between Hatchbox and Cloudflare. Too often, developers slap Cloudflare in front of Rails in default "Orange Cloud" (proxy) mode and run into edge redirection loops, cache poisoning on session cookies, or bloated Puma workers serving redirect loops for media files. Here is the blueprint for pairing Hatchbox with Cloudflare, along with the exact edge rules, proxy configurations, and caching tweaks needed to extract maximum performance from your server. 1. The SSL Handshake & Redirect FoundationHatchbox provisions Caddy out of the box to manage local SSL via Let’s Encrypt. When you place Cloudflare’s proxy in front of Caddy, you introduce two layers of TLS. • Set SSL to Full (Strict): In Cloudflare under SSL/TLS -> Overview, choose Full (Strict). Never use "Flexible." Flexible forces Cloudflare to speak to Caddy over unencrypted HTTP (port 80). Caddy will issue a 301 back to HTTPS, causing an infinite redirect loop (ERR_TOO_MANY_REDIRECTS). Strict ensures end-to-end encrypted validation against Caddy's certificates. • Apex to WWW (or WWW to Apex) at the Edge: Never make Puma or Rack handle domain rewrites. Offload it entirely to Cloudflare using Redirect Rules (under Rules -> Redirect Rules): • The Prerequisite DNS Record: Cloudflare's edge rules only evaluate if traffic actually reaches Cloudflare. Ensure you have a proxied (Orange Cloud) record for www in your DNS settings, either a CNAME pointing www to @ (your apex domain), or an A record pointing to your server's IP. If this record is missing or gray-clouded, browsers will throw NXDOMAIN before the rule ever executes. • Rule: If Hostname equals "[www.yourdomain.com](https://www.yourdomain.com)" • Action: Dynamic 301 redirect to concat("[https://yourdomain.com](https://yourdomain.com)", http.request.uri.path) • This resolves the canonical redirect at the edge in single-digit milliseconds, saving your VPS from ever handling a useless handshake. 2. Taming Active Storage with Proxy Mode & Edge Cache RulesBy default, Active Storage uses redirect mode: a client requests an asset, your Rails process boots, generates a short-lived signed S3 or bucket URL, and issues a 302 redirect. If you have 50 avatars or attachments on a page, your Puma threads spend all their bandwidth negotiating signed redirects. Enable Proxy Mode in RailsBy default, Active Storage runs in redirect mode: when a client requests an attachment, Puma generates a signed, expiring 302 redirect URL to your storage provider (such as S3 or Backblaze B2). If a page renders 30 images, your Rails server spends compute generating 30 unique signed redirects on every single page load. Instead of hunting down every view to manually swap in rails_storage_proxy_path, tell Rails to route all Active Storage attachments through proxy mode by default. Add this single line to config/environments/production.rb: # config/environments/production.rb config.active_storage.resolve_model_to_route = :rails_storage_proxyNow, standard view calls automatically generate proxy endpoints: <%# Automatically resolves to /rails/active_storage/blobs/proxy/... %> <%= image_tag @article.featured_image %>When proxy mode is active, Rails streams the file directly through your domain and emits long-term, immutable caching directives on binary responses: cache-control: max-age=3155695200, public, immutableThis hands Cloudflare the exact headers needed to cache assets at the edge for months without any manual TTL overrides. Cache Active Storage at the EdgeBecause proxy paths (/rails/active_storage/blobs/proxy/* and /rails/active_storage/representations/proxy/*) serve immutable file contents, you want Cloudflare to cache them permanently so Puma never sees a repeated request. In Cloudflare, go to Caching -> Cache Rules and create an Active Storage Edge Cache rule: • Matching Expression: (http.request.method in {"GET" "HEAD"} and starts_with(http.request.uri.path, "/rails/active_storage/"))• Settings: • Cache Eligibility: Eligible for cache • Edge TTL: Use cache-control header if present, bypass cache if not (or "cache request with Cloudflare's default TTL if not") • Browser TTL: Respect origin TTL Once primed, your VPS CPU stays near 0% when pages with dozens of user-uploaded files load. Why This Works• Zero Compute on Repeat Hits: The first request pulls through Puma, Caddy, and Cloudflare to prime the cache. Every subsequent visit from anywhere in the world serves a sub-20ms edge HIT. • Permanent Browser Caching: Because Browser TTL respects origin headers, client browsers store the file locally across visits (immutable), eliminating unnecessary re-downloads. • No Direct Upload Conflicts: POST requests to direct upload endpoints bypass the rule cleanly. Verifying Edge Performance in DevToolsTo confirm Cloudflare and Hatchbox are communicating correctly: 1. Open Chrome DevTools (Cmd + Option + I or Ctrl + Shift + I) and click the Network tab. 2. Uncheck Disable cache so you can observe real-world browser caching. 3. Reload your page, click on any Active Storage image request, and open the Headers panel: • cf-cache-status: HIT: Cloudflare served the asset from its edge without touching your VPS. • cache-control: max-age=..., public, immutable: Cloudflare preserved your Rails cache headers. • via: 1.1 Caddy: Shows that Hatchbox’s native Caddy reverse proxy handled the upstream origin response when the cache was originally primed. • age: [seconds]: Shows how long the asset has been cached at the edge. 3. Asset Pipeline Edge Offloading (/assets/*)Modern Rails (whether using Propshaft, Sprockets, Vite, or Tailwind CLI) produces fingerprint-digested assets (e.g., application-d893f412.css). Caddy serves these statically from /public/assets, but Cloudflare should absorb 100% of this traffic globally: • Create a Cache Rule for Assets: • Expression: http.request.uri.path starts_with "/assets/" • Cache Eligibility: Eligible for cache • Edge TTL: Override origin -> 1 year • Browser Cache TTL: Override origin -> 1 year Because Rails digests asset filenames whenever file contents change, aggressive 1-year caching will never show stale CSS/JS after a Hatchbox deployment. 4. Protecting Dynamic Rails Routes from Cache LeaksCloudflare's default cache level respects origin Cache-Control headers, but human error in custom controllers can accidentally broadcast private sessions if you enable global caching rules. Ensure you explicitly safeguard authenticated paths by creating a Bypass Rule: • Expression: (http.request.uri.path starts_with "/admin") or (http.cookie contains "_your_app_session")• Action: Bypass cache This ensures that any user carrying a logged-in Rails session cookie always hits the origin Puma worker directly, eliminating edge-caching bugs for logged-in sessions. 5. Caddy & Rails Real IP RestorationBecause every request hits Cloudflare before reaching Hatchbox, your Rails production logs and request.remote_ip calls will show Cloudflare IP addresses by default unless restored. In your Rails configuration: # config/environments/production.rb config.action_dispatch.trusted_proxies = ActionDispatch::RemoteIp::TRUSTED_PROXIES + [ # Trust local reverse proxy (Caddy) IPAddr.new("127.0.0.1"), IPAddr.new("::1") ]Caddy forwards the X-Forwarded-For header automatically, allowing Rails to accurately track user rate-limits, audit logs, and security geolocation. The ResultVector Unoptimized Default Hatchbox + Cloudflare Edge Stack Asset Delivery Puma/Caddy disk I/O on every cold visit Sub-20ms edge HIT globally Active Storage Puma handles 302 redirects per file load Cached at CDN; 0 Rails worker overhead Domain Redirects Full TCP/TLS trip to VPS server Edge 301 resolved before origin ping Compute Cost High memory/Puma thread exhaustion Small $6–$12 VPS comfortably scales By moving static assets, media caching, and redirect logic entirely to Cloudflare's edge, Hatchbox only has to do what Rails does best: render dynamic business logic and process background jobs.

August 26, 2026

The PaaS Hangover: Why I Deploy Rails with Hatchbox

Deploying a modern Ruby on Rails application usually forces you into one of two extremes. On one side lies the PaaS route (Heroku, Render, Fly.io). It offers simplicity: push your code, let their buildpacks figure out the rest, and go back to building features. But the convenience tax is brutal. You are locked into arbitrary memory limits, sleep cycles, and per-dyno billing that makes running three small side projects feel like leasing commercial real estate. On the other side is the DIY and containerized route (Kamal, Dokku, or raw VPS orchestration). You get cheap compute, but you also inherit the DevOps maintenance tax. You are suddenly managing Docker registries, debugging multi-stage Dockerfiles, troubleshooting proxy containers, and configuring Let’s Encrypt edge cases. For the vast majority of independent builders and lean software teams, neither extreme makes sense. That is why Hatchbox is my default deployment tool for Rails. The Power of "Bring Your Own Compute"Hatchbox is a control plane, not a hosting provider. You connect your own servers from Hetzner, DigitalOcean, Linode, or AWS via SSH, and Hatchbox handles provisioning, environment configuration, database setups, and zero-downtime deploys. This separation of concerns changes the economics completely. Take a look at some example costs here based on deployment solutions: Platform / Setup Architecture Est. Monthly Cost (3 Small Apps + DBs + Background Workers) Heroku Managed Dynos + Eco Dynos + Postgres Add-ons $70 – $150+ Render / Fly.io Managed Micro-VMs / Containers $45 – $90 Hatchbox + Hetzner/DO 1 Dedicated VPS (4GB RAM, 2 vCPU) + Hatchbox Plan $16 – $24 total With Hatchbox, you pay for raw server hardware once. If you have three low-traffic Rails applications, a handful of cron jobs, and background workers, you can pack them onto a single $6 to $12/month VPS without paying a per-application penalty. Rails-First Sensibility (No Container Friction)Most modern deployment tooling treats Rails as just another generic web service inside a Docker container. Hatchbox treats Rails as a first-class citizen because it was built specifically for it. • Boring, Understandable Infrastructure: Hatchbox provisions native Ubuntu environments with systemd services, Puma, and a fast Caddy reverse proxy. Deploys run using the proven symlink release pattern. • Frictionless Debugging: When an issue crops up, you don't need to jump through Docker namespaces or container exec commands. You SSH into your server, cd into your current release, and run bin/rails console or inspect standard Linux logs. • Modern Rails Defaults: Hatchbox natively supports Rails credentials (RAILS_MASTER_KEY), runs database migrations cleanly on release, handles asset precompilation out of the box, and works out-of-the-box with modern SQLite setups and the Solid Trifecta (Solid Queue, Solid Cache, Solid Cable). The Push-to-Deploy Experience Without the Lock-InHatchbox connects directly to GitHub. Once configured, your workflow looks identical to a high-end platform: 1. Merge your pull request to main. 2. A GitHub webhook triggers the build on your server. 3. Hatchbox runs your bundle, compiles your assets, runs pending migrations, and performs a zero-downtime phased Puma restart. 4. Caddy automatically provisions and renews your SSL certificates. You get the frictionless "push to deploy" developer experience without handing over control of your database or paying an exponential markup on RAM. The Verdict For solo developers, bootstrappers, and small teams, developer cycles are too valuable to spend debugging container orchestration, and server budgets are too lean to hand over to PaaS markup. Hatchbox occupies the exact middle ground: it automates the tedious parts of server administration while keeping your stack standard, fast, and remarkably affordable.

Built for Rails developers

Everything we work out along the way gets written down here — the articles, plus a curated shelf of boilerplates, libraries, and utilities worth your time.

Working on something in Rails? Say hello.