Back to Blog

Build a Baremetrics-Style SaaS Metrics Dashboard (MRR, Churn, LTV)

Baremetrics charges $129+/month to display your Stripe metrics. You can build 90% of it yourself in a weekend. Here is how — and why it matters.

1. The Metrics That Actually Matter

Most SaaS founders track too many vanity metrics and not enough actionable ones. The core metrics you need:

2. Data Source: Stripe API

All your metrics live in Stripe. The key endpoints:

For historical data, use Stripe's webhook events. Listen to customer.subscription.created, customer.subscription.deleted, and invoice.paid to maintain a local database of subscription history.

3. Database Schema for Metrics Storage

Store a daily snapshot in Supabase:

CREATE TABLE metrics_snapshots (
  id uuid DEFAULT gen_random_uuid(),
  snapshot_date date NOT NULL,
  mrr integer NOT NULL,       -- in cents
  arr integer NOT NULL,
  active_customers integer,
  churned_this_month integer,
  new_this_month integer,
  expansion_mrr integer,
  churned_mrr integer,
  new_mrr integer,
  created_at timestamptz DEFAULT now()
);

Run a daily cron job to snapshot your metrics. This gives you historical charts without expensive Stripe API calls on every page load.

4. Calculating MRR Correctly

Normalise all subscriptions to monthly amounts:

function calculateMRR(subscriptions: Stripe.Subscription[]): number {
  return subscriptions.reduce((total, sub) => {
    return total + sub.items.data.reduce((subTotal, item) => {
      const amount = item.price.unit_amount || 0;
      const interval = item.price.recurring?.interval;
      const monthlyAmount = interval === 'year' ? amount / 12 : amount;
      return subTotal + monthlyAmount * item.quantity;
    }, 0);
  }, 0);
}

5. Building the Dashboard UI

Use Recharts for charts in your Next.js app. Build components for:

6. Churn Analysis: Going Deeper

Beyond the churn rate number, build cohort analysis: group customers by the month they signed up and track what percentage are still active after 1, 3, 6, and 12 months. This reveals whether your churn problem is early (onboarding failure) or late (product-market fit).

7. When to Buy Baremetrics vs Build Your Own

Buy Baremetrics (or Chartmogul) if:

Build your own if:

Want a custom Stripe analytics dashboard built into your SaaS? Hire me on Fiverr — I have built this exact feature for 20+ SaaS products.

Share this article