DEV Community

Fede
Fede

Posted on

I built a zero-dependency static site generator for calculator sites, then used it to launch two live sites

What it is

CalcSmith is a zero-dependency static site generator for calculator sites. MIT licensed, plain Node, one .mjs file per calculator. It outputs plain HTML/CSS/JS with JSON-LD (WebApplication + FAQPage schema), a sitemap, and FAQ blocks baked in.

export default {
  slug: "board-feet",
  title: "Board Feet Calculator",
  inputs: [
    { id: "length", label: "Length (in)", type: "number" },
    { id: "width", label: "Width (in)", type: "number" },
    { id: "thickness", label: "Thickness (in)", type: "number" },
  ],
  compute: ({ length, width, thickness }) =>
    (length * width * thickness) / 144,
};
Enter fullscreen mode Exit fullscreen mode

Why I built it

I wanted to launch real calculator sites without dragging in a framework, a build step, or a CMS. So I built the generator first, then used it for two live sites:

This isn't a look-at-my-traffic post — both sites are new and I don't have numbers worth sharing yet. This is a look-at-the-code post.

The part I'd actually want feedback on

The calculators that use live data (BCRA rates, etc.) need a fetch-with-fallback pattern: try the live source at build time, fall back to a last-known-good cached value if the fetch fails, so the site never ships broken. Repo: github.com/FedeVB30/calcsmith

If you want the finished modules instead of building your own, I put together a paid pack (12 SEO-complete calculators + guides) on Gumroad, but the repo itself is free and MIT licensed either way.

Happy to answer questions about the JSON-LD setup, the fetch-with-fallback pattern, or anything else.

Top comments (0)