alex shapalov Profile picture
founder & cto https://t.co/SQ0ihOxECK 🐇 AI that fixes production bugs 24/7 • building // 💼 https://t.co/V7RgI2cRYx • https://t.co/iecCB5jVY7
Dec 3, 2025 9 tweets 4 min read
37signals open-sourced Fizzy, their Kanban tracker for issues & ideas. @dhh

I went through the code and stole 10 patterns you can reuse in your own Rails / SaaS app 👇

github.com/basecamp/fizzy 1️⃣ Account slug multi-tenancy (no namespaced controllers)

Fizzy uses a rack middleware (AccountSlug::Extractor) that:

Pulls the numeric account id from the URL
Rewrites SCRIPT_NAME / PATH_INFO
Wraps the request in Current.with_account

Result: the whole app is effectively mounted at /{account_id} and controllers stay clean & non-multi-tenant-aware.Image