This article was originally published on Rails Designer
Ever wondered about how big a Rails project or product is? Looking for inspiration for small, but still (financial) successful Rails products? Want to share your Rails project with others? Now you can!
Introducing: railsstats.com
Over the past weeks I spent a bit of time here and there to build the most basic version. The goal with this first version is to collect as many projects as possible. Then later cool features and views can be built on top of them.
bin/rails stats
But first, bin/rails stats
? Yes, Rails comes with a feature to view your app's stats. It includes lines of code, test ratio and so on. You can view them by running bin/rails stats
in your app. It will output a table-like view with all the deets.
It's this data you can paste into railsstats.com.
Small, medium or large
13 years ago, almost to the day today, DHH shared in this article, Basecamp Next (aka “Basecamp 2”) was almost 15,000 lines of code upon launch (today Basecamp is closer to 244,000 🤯). The article also mentions the original Basecamp was just about 2,000 lines when it launched! 😎 For comparison: Rails Stats, also just launched, and which is a wáy simpler app (minimal business logic) than Basecamp original, is about 1,500 lines of code.
Compare that to GitHub's Rails monolith that, in 2023, had about 2 million lines of code (GitHub dev, if you read this: feel free to add your stats ✌️).
As a guideline you can use:
- Small: Up to 25,000 LOC;
- Medium: 25,000 to 150,000 LOC;
- Large: 150,000 to 500,000 LOC;
- Enterprise: Over 500,000 LOC.
Open Source
railsstats.com is OSS so you can see the full codebase, clone it and add features and fix bugs. It's a truly vanilla Rails 8 application: partials, helpers, Hotwire and vanilla CSS (and, okay, I also have used a few decorators). Deployed using Kamal.
Some choices might surprise you, as Rails Designer has been heavily focused on ViewComponent and Tailwind CSS, but I often work with different stacks, either when building a SaaS for others or with teams via my Tailor-Made UI packages. While I love Rails Designer's default stack, checking out the vanilla path keeps things interesting to me.
So if you run a Rails project, be sure to add the stats or check out the source (star it ⭐ and contribute! ❤️)
Top comments (1)
Forem that is powering this very site is about ~180k lines: railsstats.com/projects/forem