DEV Community

SIKOUTRIS
SIKOUTRIS

Posted on • Edited on • Originally published at howmuchtostartabusiness.com

Building a Startup Cost Calculator: Data Architecture for 100+ Business Types

Building a Startup Cost Calculator: Data Architecture for 100+ Business Types

When I started building How Much To Start A Business, I faced a deceptively simple question: how do you model the costs of 100+ different business types in a way that's both flexible and maintainable?

Turns out, it's a lot harder than throwing everything into a single database table.

The Challenge

A coffee shop's startup costs look nothing like a software consultancy's. The data is wildly different:

  • Coffee shop: equipment costs, lease deposits, permits, training
  • Consultancy: website, legal setup, insurance, maybe a desk
  • Fitness studio: equipment, renovation, permits, specialized liability

I needed a system that could:

  1. Handle 100+ business types without explosion
  2. Let users customize their numbers
  3. Generate printable cost reports
  4. Support multi-currency and regional variations

The Data Architecture

Instead of a giant expenses table with thousands of rows, I went with a category-based JSON schema:

{
  "business_type": "coffee_shop",
  "categories": [
    {
      "name": "Equipment",
      "items": [
        {
          "id": "espresso_machine",
          "label": "Espresso Machine",
          "default_cost": 8000,
          "range": { "min": 5000, "max": 15000 },
          "notes": "Commercial grade"
        },
        {
          "id": "grinder",
          "label": "Grinder",
          "default_cost": 1500,
          "range": { "min": 800, "max": 3000 }
        }
      ]
    },
    {
      "name": "Legal & Permits",
      "items": [
        {
          "id": "business_license",
          "label": "Business License",
          "default_cost": 500,
          "regional": true
        }
      ]
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

This structure gives me:

  • Flexibility: Each business type has its own categories
  • Reusability: Common categories (Legal, Insurance, Permits) share templates
  • Scalability: Adding a new business type = new JSON config, not new database columns

The Frontend Layer

On the UI side, users see a clean form where they can:

  1. Select a business type
  2. Adjust individual cost estimates
  3. Add custom line items
  4. See real-time total calculations
// Simplified calculator logic
function calculateTotal(businessConfig, userInputs) {
  return businessConfig.categories.reduce((total, category) => {
    return total + category.items.reduce((subtotal, item) => {
      const userValue = userInputs[item.id] || item.default_cost;
      return subtotal + userValue;
    }, 0);
  }, 0);
}
Enter fullscreen mode Exit fullscreen mode

The beauty of this approach? Users can see how their decisions affect the total in real-time, and we're not doing crazy calculations—just summing user values or defaults.

Handling Regional Variations

Startup costs vary wildly by geography. A $50k startup in San Francisco is a $15k startup in rural Arkansas.

I added a regional flag to items that need it:

{
  "id": "office_rent_deposit",
  "label": "Office Rent (First Month + Deposit)",
  "default_cost": 5000,
  "regional": true,
  "regional_overrides": {
    "SF": 25000,
    "NYC": 20000,
    "midwest": 8000,
    "rural": 4000
  }
}
Enter fullscreen mode Exit fullscreen mode

When a user selects a region, we apply these overrides before rendering.

The Export Problem

Users wanted PDF reports. Instead of maintaining a backend PDF generator, I used a print-to-PDF approach:

  1. Generate a clean HTML table of all costs
  2. User presses "Download PDF"
  3. Browser's print API handles the rest

This saved me from wrestling with wkhtmltopdf or other server-side rendering nightmares.

What I'd Do Differently

If I were starting over, I'd:

  • Add a "similar business types" recommendation ("Your costs are closest to a consulting firm")
  • Include financing options (SBA loans, credit lines, grants by state)
  • Add timeline features ("You'll need $X in month 1, $Y by month 6")

Lessons Learned

  1. Don't normalize too early. JSON configs beat a "normalized" schema when dealing with 100+ variations of similar data
  2. Give users control. People trust calculators where they can adjust the numbers, not black boxes
  3. Print-friendly design matters. More people export than you'd expect
  4. Regional data is gold. Users want to know what things cost in their city, not nationally

Check out the full cost calculator to see this in action. The code is simpler than you might think.


What startup cost data surprised you the most when you researched it? Drop a comment below—I'm always curious what gets people's attention.

Top comments (0)