Over the years, I have accumulated many “calculators” in various spreadsheets to make my personal life easier: tax simulations, startup equity, investment allocation, real estate, …
Clearly calculators online are a dime a dozen, yet I’ve never found the competition (top hits on Google) as accurate as mine, they all seem very wonky, slapped together quickly and missing important details.
What would be the path of least friction to produce a no-backend static website that can host these calculators? I believe that with the right intuitive UX and user-friendly features (i.e. persist the input in the URL query string, instant recomputation on input change, …) they could be valuable for someone.
For context, I’m a software engineer working in FAANG as a backend developer in distributed systems and Linux kernel for many years. I just really dislike dealing with anything frontend-related and I’m utterly incompetent in it, I find CSS to be the biggest monster in computer science (and I troubleshooted bugs in distributed consensus algorithms, ha!), so I’m ideally looking for a framework/template where I can mostly focus on my business logic functions/invariants and get as a result a few static assets to host.
Thanks!
If you do want to go through the trouble of converting to another language, JavaScript would be the natural choice because it can run directly in the browser with just “a few static assets to host”. A template like the following would probably work fine as something simple and functional. (This should be a working example if you save the files to a directory and load foo.html in the browser.)
foo.js:
function foo(a, b, c) {
// do calculations and return output
return a + b + c;
}
foo.html:
Foo Calculator
Foo Calculator
a, b, c, z, and foo will be global variables in foo.html so make sure they have unique names.simple.css could also be replaced with other classless CSS frameworks.
Providing the actual spreadsheet files directly will be of far more use to other people than trying to turn them into an inferior website.
https://css-for-js.dev is a good course.
It compiles to javascript and will generate an index.html for you if you want.
Elm is highly opinionated… maybe you’ll love it, or maybe you’ll hate it, but it’s a good fit for what you want to do.
You can use Bootstrap (or similar) for some minimal theming. No CSS knowledge required - just apply the classes as described in the docs.
Alternatively you might be able to find a similar project online that you can modify to fit your needs? There are a lot of simple single-page form based apps on Github.
Just found this one on YouTube for example: https://www.youtube.com/watch?v=CGftYT6KcrM https://github.com/kaizhelam/BMI-Calculator
Also, I would stay far away from any Javascript package manager. Your calculator should be working for 10 years at least since HTML, CSS, plain Javascript, and Rust will most likely still work in 10 years and math doesn’t change either.
I also suggest react because after extensively using multiple frameworks I can say without a doubt the react ecosystem stands out far above the rest. There’s many high quality graph and table libraries for React. And having also dealt with integrating these sorts of libraries into component frameworks, it’s just not the sort of thing you want to waste time on.
As for language I would highly recommend just embracing TypeScript and skipping JavaScript. This will certainly help eliminate a whole class of potential frontend-typical problems like strings being interpreted as numbers due to developer error.
For styling I would use tailwind (although if using react styled-components is another approach, but tailwind definitely gets out of your way). This will easily get you past the styling problem you mentioned.
For hosting I would use Vercel. I would have suggested Netlify and really both are good but I’m considering migrating my sites to Vercel because netlify appears to load CSS files in a weird order, but that’s not too relevant to the discussion here I suppose.
Happy to answer anymore questions or help you get started with the code and implementation - contact links in profile! I hope this advice has been practical.
My suggestion would be webflow or some other no code that lets you just write backend stuff.
Maybe I’m misunderstanding your use case, but if you want to create web apps out of your backend work, streamlit may be your ticket for “easy to understand on the back end, hyper-simple front end.”
At least worth giving it a look.
Served by NGINX on a Linux server. I host with DigitalOcean for $6/month
I use a CSS Framework template. I like Bulma for its simplicity: https://bulmatemplates.github.io/bulma-templates/
Summary of things to google:
- simple Serverside framework for - Digital ocean nginx tutorial - CSS Framework Template Also, one of my favorite websites for learning to build websites & webapps is: https://roadmap.sh/ It guides you through some of the common steps involved in building the skills, for frontend, backend, phone apps, and devops ___________ Regarding presenting tabular data on a website for editing and downloading, I highly recommend this ReactJS framework: React Bootstrap Table v2 https://react-bootstrap-table.github.io/react-bootstrap-tabl... That said, a prerequisite for using it is learning ReactJS. For that, I recommend https://udemy.com/
They are meant for putting simple UIs on top of (Python) data apps, which I think is what you really have here. You focus on the logic and don't have to deal with the frontend directly.
I do understand this doesn’t meet your static site need. But if you’re in this for knowledge transfer and improving the state of the calculators you created perhaps opening up the code to those that could collaborate could be useful. Perhaps you could write the canonical library for those calculations. Keeping the presentation away from the business logic like this is a stated goal…
[2] https://blog.jupyter.org/and-voilà-f6a2c08a4a93 has a pretty good demo that would be effectively what you need to create an interactive calculator.
Google Sheets, Zoho Calc, Airtable and Streamlit offer functionality I like but I want something that will work in a local browser without a cloud link. Ideally something that could be served statically as you describe from Vercel or perhaps a webserver on the user's local machine.
I couldn't find anything so I started playing around with Pyodide, Elm, Typescript, XState and Tauri before discovering Yew and WebAssembly. I like the idea of a small interactive calculation engine in Rust with a customizable table/spreadsheet interface that a user could load and run entirely in their browser.
CSS is indeed a beast. I tried avoiding it but eventually decided to see how far I can go with just Bulma, CSS media queries and CSS grid-template-areas. I've started making mockups with Zola to figure out the subset of CSS that will work for me. Then I hope to port or incorporate the Zola templates in my Yew application.
If the goal is purely providing something functional to others on the internet, just create a simple page. Describe your calculators. Add links to download your calculators as excel spreadsheets.
No need to over complicate and build a spreadsheet in a browser.
If you don’t want to do that, just create some HTML pages with forms and use some JS to chain together input boxes and spit out a calculation.
Many of the suggestions here will take you the route of complicated layers of abstraction. Unless your goal is to learn these abstractions, you can avoid that complexity.
From this I am assuming you will be comfortable with C++.
> I just really dislike dealing with anything frontend-related and I’m utterly incompetent in it
May I then suggest Wt[0] to you?
If you have some front-end developers that you are close with, I would ask for some guidance and an occasional push in the right direction once you get started. If you really do dislike front end, I would try to reframe how you approach this problem, because it will just end up being a slog for you :(
I'm not sure what the best tool for a calculator app is, but there are probably many options
As for functionality, if you're "just" doing some calculations and presenting it like a spreadsheet, you probably don't need a framework. Some plain Javascript onChange event listeners for your various input fields might be all you need.
That said, to convert spreadsheet formulas (which often depend one from another) look for something reactive. Svelte might be a good choice if you can figure out its model of reactivity.
Can you share example links for what you have in mind?
Without a clear goal you will get as many suggestions as there are developers in this thread.
Best of luck with whatever you end up doing
I think these tools should work for someone coming in without prior experience and figuring it out from the docs.
Or, you could Google “classless CSS”, if you’re OK writing some HTML.
I made a plug and play CSS library here for those that don’t want to write CSS: https://github.com/andybrewer/mvp
Bootstrap is very popular and easy to find components for.
For simple interactions look into htmx or alpinejs. Or jquery.
These recommendations presume you want to get things off the ground asap, without spending months learning.
I would deploy using Netlify with their CDN or Cloudflare.
Short of hiring/partnering with someone, learning yourself is the closest best bet.
I'd say have the api ready, go through vuejs tutorials to build something, and then ask for help ?
The best I've found is NextJS (you can use their API support if you don't have a separate one yet) + Chakra UI (removes practically all the need for css).
You can pick it up in a weekend and build beautiful products.
Otherwise the Python community likes to avoid touching anything that is not Python. Dash Plotly or Streamlit are great tools to make web apps in Python.
Learn the tool designed for the puropse instead of looking for shortcuts
Unless you mean, "How do I monetize this?" in which case, good luck.
Do give it a try. There are plenty of YouTube tutorials out there.
Find some minimal CSS framework. My preference is Skeleton [0] or Bootstrap [1]. The key is just finding something minimal that works without too much fuss. Personally, I rather have a minimal framework provide 'responsiveness' so I don't have to worry about it but I also want it to get out of the way of anything I do.
Use JQuery [2]. Don't rely on CSS for animations or interactivity. In theory CSS does a lot. In practice it's a nightmare to use and to get it play well with whatever else I'm doing in the page.
Write in "bare" HTML and "vanilla" JavaScript. Don't use a static site generator and don't use a JavaScript framework.
Port in JavaScript libraries as needed. Some of the ones I tend to use are numeric.js [3], downlaod.js [4] and audience-minutes [5]. If you're doing spreadsheet things, maybe there's some JS package out there that will help.
Doing "raw" HTML/"vanilla" JavaScript makes me effectively unhirable but for limited scope side projects where I have full control and want to minimize bit-rot, this is fine.
The point is to create something that's minimal and focuses on functionality. The CSS is just there to make it not look like a Web 1.0 page but otherwise steps out of the way to focus on the actual usage of the application.
For context, here are some projects where I've used this philosophy (all open source, feel free to pilfer): Noixer [6], Resonator Voyant Tarot [7], Boston Train Track (now defunct) [8], CalebHarrington.com (an artist friend) [9], What Is This License [10], HSV Hero [11].
[3] https://github.com/sloisel/numeric
[4] https://github.com/rndme/download
[5] https://github.com/berthubert/audience-minutes
[6] https://mechaelephant.com/noixer/
[7] https://abetusk.github.io/ResonatorVoyantTarot/
[8] https://github.com/abetusk/bostontraintrack
[9] https://calebharrington.com/