Architecture of psbFinances

Every time you start a new application, you ask yourself: what should I use to build it. Should you stick to what you know or use something new. I’ve made a few decisions about the architecture of psbFinances. For the last 9 years I’ve been working with node.js, React and MySql. I’ve built platforms for 6 startups with this stack. That’s what I used for psbFinances. But there was a couple of decisions I’ve made “inside” this stack.

Note that React is becoming less obvious choice for me these days, but that’s another topic.

TypeScript (TS)

I am big fan of Anders Hejlsberg. I was working with C# since he introduced its first beta. Even before that I’ve used his Borland Delhi. When he announced TypeScript in 2012 I was very interested. He gave many reasons why TypeScript was developed. Great tooling support (like IntelliSence, code completion) was one of them. Since then I was checking the growth of it and was asking myself whether I should use it for my projects. I’ve asked the same question many teams that I’ve lead: “should we go with pure JavaScript or with TypeScript”. Interesting situation. JavaScript developers wanted to have static typing. At the same time more C# developers were asking for dynamics.

9 years ago most of the JavaScript IDE didn’t have a good support for it. But the situation has changed a lot since then. I use WebStorm. It has a very good support for pure JavaScript development, especially in combination with JSDoc. Visual Studio Code has a great support for it too. For me using JSDoc makes code less verbose and cleaner compare to the type annotations in TS.

As for the static code analysis. Incorrect types add only a minor number of bugs that I discover in my and my teams code. Most of the bugs are in the logical flow. Type validation is also address as part of unit tests.

TypeScript allows to use the latest features of JavaScript. Browsers and node.js may not support these features yet. But you probably use Babel and that solves this issue.

That’s why I’ve decided against TypeScript for psbFinance. I don’t see enough benefits to use another “super” language on top of JavaScript.

Some developers say that “you can’t build large-scale application without TypeScript”. That’s not true. Large scale application can be built using any language. I’ve seen quite enough of them built with different languages. It’s not about language. It’s all about the skills and discipline of developers.

GraphQL

That was another tool I decided not to use. I use REST API. A debate of REST API vs GraphQL reminds me a lot about the discussion between backend developers and DBAs. DBA didn’t trust developers to be “gentle” with their databases. They insisted that database should be accessed via stored procedures only. That make sense. To some extend. “With great power there must also come great responsibility”. That debate was won by developers who now can write direct SQL statements or use some ORM helpers. I was never in the DBAs’ camp, even though I’ve done a lot of DBA work. For developers that power of accessing database with pure SQL is great. But some of them didn’t accept the responsibility. Many times I’ve seen lazy SQL code that degraded performance and introduced security issues.

That’s why it looks the same for me with GraphQL If you built multiple applications with REST API then you know how to address some challenges.

I am not saying that GraphQL is bad or that it should not be used. Far from that. What I am saying is that based on my experience and skills it doesn’t give me any significant benefits while introducing some complexity. It also means that the potential pool of developers who can contribute to psbFinances becomes smaller – not everybody know it.

Conclusion

TypeScript and GraphQL are great tools. They can be very useful in the right hands. But for me they don’t have enough benefits to use in this project. Check the code and you can see that it’s ok to live without them.

psbFinances

Do you manage you personal finances? Does mint.com ring a bell? Do you also have one or more small businesses and do your accounting yourself? QuickBooks anyone? Fraustrated managing same transactions in many places to see your financial health? You are not alone.

For the last few months I’ve been working on a project to address these challenges. Today I am open sourcing it. It’s a web application to manage personal and small business finances – psbFinances. But who needs another financial manager? Well, at least I do 🙂. Let me talk about what motivated me to create it.

I have been managing our family’s finances for a very long time (do you remember Microsoft Money?). Now we have two small businesses – my wife’s hairstyling and my softwrae consulting. I do our accounting myself. A few years ago we’ve had two LLC and one S-Corp. That year, I’ve used mint, QuickBooks Self-Employed and QuickBooks. Also I’ve had my own spreadsheet with a detailed budget, tax preparation toolkit, dashboards and cash flow monitoring. A lot of data and process duplication. A lot of frustration. I am ok to pay for the services that I use, but I cannot stand a free version full of ads or have a very pushy marketing.

I’ve tried many other applications during the last 6 year. Every time I’ve heard about a new financial manager, I tried it. Unfortunately neither of them had what I need nor saved me time managing finances. That’s when I finally decided to create my own. That’s how psbFinances came up to life.

The version that is available today is a beta. I don’t consider it ready for the “prime time”, but I’ve been using it to manage all our finances for the last 5 months. I have much better picture of our finances and spend less time managing them. Also it is easy to add a feature that I need to help me. I use mint to download our financial data from many banks, but manage everything in psbFinances. Even my own spreadsheet is now 90% obsolete.

Who is it for

psbFinances is not intended to be a tool for everyone. At least as of today. The most benefits from it will be for people who:

  • manages their personal finances
  • have one or more small businesses, and
  • do accounting themselves, and
  • would like to have all financial data in one place

Here are example of a few real life situation that psbFinances can help:

  • have you ever bought something for your personal and business needs in a single transaction? Easy to handle in psbFinances. But: “aren’t you supposed to make 3 separate purchases in this case?”. No, as long as you allocate amounts to personal and businesses
  • have you ever checked whether you will have enough cash to pay all your bills by the end of this or next months? Or play “what-if” scenario (e.g.: can I afford to buy something or put some money to a saving?)
  • do you have a detailed budget for each category and each month, rather than one number for all months?
  • do you want to let your partner to change the data, but can also see who did it and when?
  • have your data always ready for your Form 1040 Schedule C?

This is a small number of cases that I’ve tried to address so far. Take a look at it and maybe it will help you too.