×

BrokerageCalc

screenshot of the brokerageCalc site
BrokerageCalc: Know your fees realtime

About:

This started from a conversation about CSV files.

On one of the Discord groups, someone had asked if it were possible or reasonable to parse CSV files in the browser, and somehow convert them to JSON objects. About an hour later, I had a CSV <-> JS converter. It was fun, and turned out fairly robust. Lets me convert a spreadsheet in CSV format into an array of objects, and vice versa.

Once that existed, the next question was, how involved might it be to create an interface that allows for that uploading, parses the file, and then applies a series of calculations to those objects? Not the same calculation each time, mind you - we're talking about a number of taxes and fees, customized to the app user.

So we made this. A purely front-end app, nothing sent to a server, simply reads the CSV, creates the objects, and then applies the various tax and fee rules, as they apply to each order. Additionally, when the file is uploaded, it can then be re-downloaded as a CSV including the fee and tax information.

Challenges:

The CSV-JSON converter happened first, in isolation. That was tested, worked great, built the interface for an order system completely in vanilla javascript.

Then it was mentioned that this needed an entire UI designed. At that point, I was learning Svelte, so it struck me as a great way to toss myself in at the deep end.

The learning curve for Svelte was pretty shallow, it's a great system, but trying to connect my Order system into it looked to be challenging... until I realized that I could simply access it via the interface I'd built. Left that running in its own space, and the Svelte app simply pulls in the parts it needs.