← Back to Blog
    Analytics

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

    April 8, 20268 min

    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:

    • MRR (Monthly Recurring Revenue): Sum of all active subscription amounts normalised to monthly
    • ARR (Annual Recurring Revenue): MRR × 12
    • Net New MRR: New MRR − Churned MRR + Expansion MRR
    • Churn Rate: (Customers lost this month / Customers at start of month) × 100
    • LTV (Lifetime Value): ARPU / Monthly Churn Rate
    • ARPU (Average Revenue Per User): MRR / Active Customers

    2. Data Source: Stripe API

    All your metrics live in Stripe. The key endpoints:

    • stripe.subscriptions.list({ status: 'active' }) — current subscribers
    • stripe.subscriptions.list({ status: 'canceled' }) — churned
    • stripe.invoices.list({ status: 'paid' }) — revenue history
    • stripe.customers.list() — customer metadata

    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:

    • MRR/ARR trend line chart (last 12 months)
    • Net new MRR waterfall chart (new + expansion − churn)
    • Active customers count with growth rate
    • Churn rate gauge
    • Recent churned customers list with plan and LTV
    • Top customers by MRR contribution

    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:

    • You need it immediately with no development time
    • You want email reports and Slack notifications out of the box
    • You have investors who want access to your metrics

    Build your own if:

    • You want it embedded in your admin dashboard
    • You need custom metrics specific to your business model
    • You want to avoid $100+/month in tool costs early on

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

    Ready to ship your SaaS in weeks?

    Book a Free Call