DEV Community

Cover image for Compound Lab's Infrastructure Cost Calculator: web app cost estimates, built on Next.js
kyisaiah47
kyisaiah47

Posted on Originally published at thecompound.tech

Compound Lab's Infrastructure Cost Calculator: web app cost estimates, built on Next.js

https://stacktab.thecompound.tech

Compound Lab's Infrastructure Cost Calculator is a web cost calculator built on Next.js and React. It lets a developer price a database, auth service, payment provider, and host against the same user profile.

The problem

A web app bill depends on more than a plan's base fee. The estimate also depends on storage, egress, requests, paid conversion, transaction volume, and the allowances that a plan will not exceed.

Compound Lab's Infrastructure Cost Calculator prices those inputs together. Its default stack returns $367.38 a month at 10,000 users, with Neon, Clerk, Polar, and Vercel contributing separate lines to the statement.

The console shows service choices, user scales, and the resulting bill.

How Compound Lab's Infrastructure Cost Calculator works

Compound Lab's Infrastructure Cost Calculator keeps a catalogue of vendor plans, meters, allowances, source pages, verification dates, and notes. The live catalogue records 269 plans across 77 services, with each rate tied to the page where it was read.

  1. The server reads the catalogue and the latest re-read status from Supabase. The manifest includes @supabase/supabase-js for that connection.

  2. The browser parses the selected stack and user count from the URL. The Console component keeps those selections in React state and mirrors them back into the query string.

  3. profileForUsers turns the user count into a usage profile. The default profile includes 5 GB of database use, 10 GB of storage, 200 GB of egress, 2 million requests, and 0.5 million function invocations at 10,000 users.

  4. estimatePlan checks plan restrictions and hard caps before calculating charges. A plan that publishes an allowance but sells no overage becomes a blocker when the profile exceeds that allowance.

  5. estimateService calculates the eligible plans and priceStack combines the selected services. The statement keeps each charge's label, working, amount, verification status, and source URL beside the total.

  6. A missing rate stays unknown. formatUsd(null) prints price not published, and the total remains withheld until the missing figure is resolved.

The method page shows vendor-page sources, nightly re-reads, unknown rates, and hard-cap rules.

A worked example

Select Neon, Clerk, Polar, and Vercel, then choose 10,000 users. Compound Lab's Infrastructure Cost Calculator returns a total of $367.38.

Neon contributes $77.38 from 730 compute hours at $0.106. Polar contributes $270 from its $20 base, 3.8% of $4,000 in revenue, 200 transactions at $0.40, and 1.5% of $1,200 in international-card revenue. Vercel contributes its $20 base, while Clerk contributes $0 on its Free plan.

The console shows the selected stack and the $367.38 monthly statement.

How it compares

Infracost parses Terraform, CloudFormation, and AWS CDK projects to estimate resource costs and surface cost changes in pull requests. Its pricing page lists a free CI/CD plan, a $250 monthly Starter plan, and a $1,000 monthly Cloud plan. Choose Infracost when the input is infrastructure code and the review belongs in CI/CD.

CloudZero ingests AI, cloud, and SaaS billing with telemetry, allocates spend across business dimensions, and sends the result to dashboards, alerts, reports, and engineering surfaces. Its pricing page offers a single subscription with a custom price quote. Choose CloudZero when the input is observed spend and the question is cost per outcome.

Compound Lab's Infrastructure Cost Calculator works earlier in the decision. It uses public vendor rate cards and an editable usage profile to compare a web stack before there is billing telemetry or an infrastructure plan to scan.

Limits

Compound Lab's Infrastructure Cost Calculator models public rate cards. It does not cover negotiated or enterprise pricing, and it does not ingest a company's actual billing data.

The usage profile is an assumption, not a measurement of a running application. Compound Lab's Infrastructure Cost Calculator prints the assumptions beside the figure and lets the reader edit them in the calculators.

Try it

The first step is picking a database, auth service, payment provider, and host in the console. Then choose the user count that matches the estimate you want to inspect.

https://stacktab.thecompound.tech

Top comments (0)