Dennis Dang

July 9, 2024

Finny First Steps

I embark on a journey to build a financial planning app that’ll actually nudge me the right ways.

The key nudge is seeing the time remaining in real-time from fulfilling my goals, primarily retirement and all the little things in life. If I spend or save more, it’ll change my timeline.

So far, I have a Flutter app and Scala web server. All new tech to me. Being an engineer, I’ll wax tech more.

Flutter’s been an easy start. I’m using the flutter_plaid library that handles the Plaid Link work for me. I also chose Powersync, a postgres to SQLite sync service, to build a local-first app. Can all number crunching be done locally? Given how fast SQLite is and no network, I can hypothetically compute account balances for many historical days from tens of thousands of transactional data without even caching. This will reduce load immensely on my database and server, so hopefully my bills will be much smaller. Bootstrapping - sigh. Among my accounts, it seems I only have 60k ish transactions. Totally doable, but we’ll see. Thanks to powersync, I don’t need to write any http code at all. The only fear is that I accidentally create sync buckets that expose user data to the wrong user. I’ll need better controls in place here and likely ask the powersync team for ways to prevent such an issue. 

I settled on Scala after shopping around for a functional programming first language. I’m not an fp purist, but I like the niceties that come with it: expressions, algebraic data types, easy composability, no early returns (meaning no crazy branching of logic. I’m avoiding the pure fp side for now, and writing Scala how I’d write light fp in Typescript. I preferred Scala over F# (second choice) and Haskell for its breadth and depth of libraries. Scala tooling can be better - there’s no single npm/cargo/gotools but it works well! Mill is great. I flip flop between Intellij and Vscode, still deciding which is better. I make heavy use of Java libraries like resilience4j and the plaid Java sdk, and the interop is great. Wrap all exception throwing calls in a Try and convert it to an Either with .intoEither. Life is easy with referential transparency.

Why not F#? I really like F#. And dotnet. I’m an Ocaml fan myself. The dotnet sdk cli and ASP.NET make got a very cohesive story. There’s even a dotnet watch command, something that’s required usually installed as a third party dependency in most other ecosystems. But interop with Java just feels way easier in Scala. I’ll touch on this another day, if i get around to this.

Haskell is Haskell - not being an fp expert yet, I can’t trust myself to write Haskell productively. I rely heavily on chatgpt to onboard onto Scala, and there’re just more Scala training data, not to mention the  anemic ecosystem rendering to the JVM ecosystem.

Today marks day 2 full time. I have a complete flow of data from Plaid to app, rendering a list of accounts and transactions. I’ve only connected a single institution (Wealthfront) so far because oauth implementation is required for larger banks, like Bank of America.

Dennis