Post
Topic
Board Project Development
Re: New project: btc2fiat.me -- a lightweight btc to fiat converter
by
NotATether
on 10/05/2022, 04:01:50 UTC
I like how fast btc2fiat.me loads and that it has no trackers.

One improvement / addition suggestion, would be a completely static version, that lets you pass a URL parameter.
It would be even more lightweight and require no JavaScript.

Let's say I go to https://btc2fiat.me/?btc=0.5, it would display a static version of the current webpage, with the amount set to 0.5BTC.
And https://btc2fiat.me/?usd=50.0 would display the exchange rate for 50USD.

My motivation for this idea is: https://plaintextsports.com/

Hey, yeah the plan is to be able to use non-JS but for calculators where you expect immediate input that becomes tricky. I still think it would be cool to have that support. In fact plaintextsports.com is using JS for its toggle light-dark mode.

For my tools, what I'm doing is using Python at the backend served using Flask & uWSGI. This lets you use all the threads on your server for serving requests. I have also implemented a memory and time ceiling for the scripts so that arbitrary user input can't crash the runtime (it's relatively easy to do). In case it does crash, I have it running inside a docker container that will auto-restart (but you could easily use something like nodaemon for this as well)

It works for relatively small loads, but if you start getting overwhelmed with requests, you can run the backend on another server and use HAProxy on a third to distribute requests between them. Just thought that this configuration might hekp you with your own tools.