SkillAgentSearch skills...

Profitable

💸 Calculate the MRR, ARR, TTM, churn, LTV, ARPU, total revenue & valuation of your pay-powered Rails SaaS app. MRR dashboard for your Rails app.

Install / Use

/learn @rameerez/Profitable
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

💸 profitable - MRR dashboard & SaaS metrics for your Rails app

Gem Version Build Status

[!TIP] 🚀 Ship your next Rails app 10x faster! I've built RailsFast, a production-ready Rails boilerplate template that comes with everything you need to launch a software business in days, not weeks. Go check it out!

profitable allows you to calculate the MRR, ARR, churn, LTV, ARPU, total revenue & estimated valuation of your pay-powered Rails SaaS app, and display them in a simple dashboard. It also provides handy methods you can use independently if you don't want the full dashboard.

Profitable gem main dashboard

Why

pay is the easiest way of handling payments in your Rails application. Think of profitable as the complement to pay that calculates business SaaS metrics like MRR, ARR, churn, total revenue & estimated valuation directly within your Rails application.

Usually, you would look into your Stripe Dashboard or query the Stripe API to know your MRR / ARR / churn – but when you're using pay, you already have that data available and auto synced to your own database. So we can leverage it to make handy, composable ActiveRecord queries that you can reuse in any part of your Rails app (dashboards, internal pages, reports, status messages, etc.)

Think doing something like: "Current MRR: $#{Profitable.mrr}" or "Your app is worth $#{Profitable.valuation_estimate("3x")} at a 3x valuation"

Installation

Add this line to your application's Gemfile:

gem 'profitable'

Then run bundle install.

Provided you have a valid pay installation (Pay::Customer, Pay::Subscription, Pay::Charge, etc.) everything is already set up and you can just start using Profitable methods right away.

Current MRR processor coverage is verified for stripe, braintree, paddle_billing, and paddle_classic.

For Stripe, metered subscription items are intentionally excluded from fixed run-rate metrics like mrr, arr, new_mrr, and churned_mrr.

[!IMPORTANT] profitable does not yet normalize MRR for every processor that pay supports. If a subscription comes from an unsupported processor such as lemon_squeezy, it will currently contribute 0 to processor-adapter-dependent metrics until an adapter is added.

Verified processor-adapter coverage today:

  • stripe
  • braintree
  • paddle_billing
  • paddle_classic

Metrics that depend on processor-specific subscription amount parsing include mrr, arr, new_mrr, churned_mrr, mrr_growth, mrr_growth_rate, lifetime_value, time_to_next_mrr_milestone, and MRR-derived fields in summaries.

Metrics based primarily on Pay::Charge and generic subscription lifecycle fields are much more portable across processors, including all_time_revenue, revenue_in_period, ttm_revenue, revenue_run_rate, customer counts, subscriber counts, and churn calculations.

Mount the /profitable dashboard

profitable also provides a simple dashboard to see your main business metrics.

In your config/routes.rb file, mount the profitable engine:

mount Profitable::Engine => '/profitable'

It's a good idea to make sure you're adding some sort of authentication to the /profitable route to avoid exposing sensitive information:

authenticate :user, ->(user) { user.admin? } do
  mount Profitable::Engine => '/profitable'
end

You can now navigate to /profitable to see your app's business metrics like MRR, ARR, churn, etc.

Main Profitable methods

All methods return numbers that can be converted to a nicely-formatted, human-readable string using the to_readable method.

Revenue metrics

  • Profitable.mrr: Monthly Recurring Revenue (MRR) from subscriptions that are billable right now
  • Profitable.arr: Annual Recurring Revenue (ARR), calculated as current mrr * 12, not trailing revenue
  • Profitable.ttm: Founder-friendly shorthand alias for ttm_revenue
  • Profitable.ttm_revenue: Trailing twelve-month revenue, net of refunds when amount_refunded is present
  • Profitable.revenue_run_rate(in_the_last: 30.days): Recent revenue annualized (useful for TrustMRR-style revenue multiples)
  • Profitable.all_time_revenue: Net revenue since launch
  • Profitable.revenue_in_period(in_the_last: 30.days): Net revenue (recurring and non-recurring) in the specified period
  • Profitable.recurring_revenue_in_period(in_the_last: 30.days): Only recurring revenue in the specified period
  • Profitable.recurring_revenue_percentage(in_the_last: 30.days): Percentage of revenue that is recurring in the specified period
  • Profitable.new_mrr(in_the_last: 30.days): Full MRR from subscriptions that first became billable in the specified period
  • Profitable.churned_mrr(in_the_last: 30.days): MRR lost due to churn in the specified period
  • Profitable.average_revenue_per_customer: Average revenue per customer (ARPC)
  • Profitable.lifetime_value: Estimated customer lifetime value (LTV)
  • Profitable.estimated_valuation(at: "3x"): ARR-based valuation heuristic
  • Profitable.estimated_arr_valuation(at: "3x"): Explicit ARR-based valuation heuristic
  • Profitable.estimated_ttm_revenue_valuation(at: "2x"): TTM revenue-based valuation heuristic
  • Profitable.estimated_revenue_run_rate_valuation(at: "2x", in_the_last: 30.days): Recent revenue run-rate valuation heuristic

Customer metrics

  • Profitable.total_customers: Total number of customers who have ever monetized through a paid charge or a paid subscription state
  • Profitable.total_subscribers: Total number of customers who have ever reached a paid subscription state (trial-only subscriptions do not count)
  • Profitable.active_subscribers: Number of customers with subscriptions that are billable right now
  • Profitable.new_customers(in_the_last: 30.days): Number of first-time customers added in the period based on first monetization date, not signup date
  • Profitable.new_subscribers(in_the_last: 30.days): Number of customers whose subscriptions first became billable in the specified period
  • Profitable.churned_customers(in_the_last: 30.days): Number of customers who churned in the specified period

Other metrics

  • Profitable.churn(in_the_last: 30.days): Churn rate for the specified period
  • Profitable.mrr_growth_rate(in_the_last: 30.days): MRR growth rate for the specified period
  • Profitable.time_to_next_mrr_milestone: Estimated time to reach the next MRR milestone

Growth metrics

  • Profitable.mrr_growth(in_the_last: 30.days): Calculates the absolute MRR growth over the specified period
  • Profitable.mrr_growth_rate(in_the_last: 30.days): Calculates the MRR growth rate (as a percentage) over the specified period

Milestone metrics

  • Profitable.time_to_next_mrr_milestone: Estimates the time to reach the next MRR milestone

Usage examples

# Get the current MRR
Profitable.mrr.to_readable # => "$1,234"

# Get the number of new customers in the last 60 days
Profitable.new_customers(in_the_last: 60.days).to_readable # => "42"

# Get the churn rate for the last quarter
Profitable.churn(in_the_last: 3.months).to_readable # => "12%"

# You can specify the precision of the output number (no decimals by default)
Profitable.new_mrr(in_the_last: 24.hours).to_readable(2) # => "$123.45"

# Get the estimated valuation at 5x ARR (defaults to 3x if no multiple is specified)
Profitable.estimated_arr_valuation(multiple: 5).to_readable # => "$500,000"

# Get trailing twelve-month revenue
Profitable.ttm_revenue.to_readable # => "$123,456"

# Founder-friendly shorthand for trailing twelve-month revenue
Profitable.ttm.to_readable # => "$123,456"

# Get recent revenue annualized (useful for TrustMRR-style revenue multiples)
Profitable.revenue_run_rate(in_the_last: 30.days).to_readable # => "$96,000"

# `estimated_valuation` remains as a backwards-compatible alias of `estimated_arr_valuation`
Profitable.estimated_valuation(at: "4.5x").to_readable # => "$450,000"

# Be explicit about the denominator when comparing marketplace comps
Profitable.estimated_ttm_revenue_valuation(2).to_readable
Profitable.estimated_revenue_run_rate_valuation(2.7, in_the_last: 30.days).to_readable

# Get the time to next MRR milestone
Profitable.time_to_next_mrr_milestone.to_readable  # => "26 days left to $10,000 MRR"

All time-based methods default to a 30-day period if no time range is specified.

Numeric values and readable format

Numeric values are returned in the same currency as your pay configuration. The to_readable method returns a human-readable format:

  • Currency values are prefixed with "$" and formatted as currency.
  • Percentage values are suffixed with "%" and formatted as percentages.
  • Integer values are formatted with thousands separators but without currency symbols.

For more precise calculations, you can access the raw numeric value:

# Returns the raw MRR integer value in cents (123456 equals $1.234,56)
Profitable.mrr # => 123456

Revenue methods are net of refunds when amount_refunded is present on pay_charges.

Notes on specific metrics

  • mrr_growth_rate: This calculation compares the MRR at the start and end of the specified period. It assumes a linear growth rate over the period, which may not reflect short-term fluctuations. For more accurate results, consider using shorter periods or implementing a more sophisticated growth calculation method if needed.
  • time_to_next_mrr_milestone: This estimation is based on the current MRR and the recent growth rate. It assumes a

Related Skills

View on GitHub
GitHub Stars96
CategoryData
Updated11d ago
Forks5

Languages

Ruby

Security Score

100/100

Audited on Mar 19, 2026

No findings