Full Stack Dart/Flutter in production. Our journey at Nova Money

Damian Ndoja
Nova Money
Published in
5 min readOct 7, 2022

It’s amazing. If you try to make it amazing.

Welcome to the wild wild west of mobile app development, the untamed cross platform world. We’ve been here for a few years, in which we’ve managed to make this chaotic ecosystem work on our favour. We’ve managed to write our Android, iOS apps and our Backend in the same language, sharing most of the code. This has proven to be tremendous for our development process, allowing our tiny team to iterate very quickly on our product.

Flutter

When you enter the cross platform world, there is one very important choice you have to make, that is whether you’re going to use Flutter or React Native. Now there are a ton of articles written on this so I’m not going to waste your time comparing the two frameworks. We chose Flutter for a few reasons, the most important being performance, followed by the fact that we wouldn’t have to deal with the garbage fire that is the JS ecosystem. We have ZERO regrets.

Dart

With Flutter comes Dart, a language that doesn’t get much love in the community due to it being rather simple. We would beg to differ. Dart’s simplicity is, in our opinion, one of its’ strongest features. The language is powerful enough to be used for virtually anything in mobile development but simple enough that you can be proficient with it in couple of weeks. It also doesn’t introduce many unfamiliar concepts, so if you have used Java, Kotlin, Swift, Typescript or any other statically typed language you should be able to write decent Dart code by default. This is very important as not many people are familiar with the language currently, so it being easy to learn means that we can onboard new developers without worrying about them having a hard time getting used to Dart.

Roll up your sleeves and DIY

If you are coming from a well established ecosystem where you can find a stable maintained library for everything you could think of, you’re in for a fun time in Dart. The ecosystem tends to be a little on the sketchy side. While there are some packages which are stable and work very well, the majority are buggy and unstable. This means that at some point of your Dart adventures you will have to get your hands dirty and either fork a package or roll your own. We have a dozen of packages which we have forked and maintain + a handful which we’ve created from scratch in-house. Some of them being our packages for Data Classes Generation, State Persistence, Charts and the Backend Framework.

Things you might miss when you start using Dart

There are some features that you may taking for granted in other languages but they don’t exist in Dart. It can sometimes feel like you’re taking a step back to a time with fewer fancy language features. Some of them being:

  1. No out of the box support for Data Classes, Union Types, Pattern Matching and clunky codegen. Sure you can get this using the Freezed package which is very clever but you will have to litter the files with part 'file.g.dart' and run the code generator every time you create a new class which feels very clunky and annoying especially when you compare it to another language such as Kotlin.
  2. No runtime reflection (in Flutter). Sad news for you arcane magic lovers, you won’t be able to create/use those super convenient yet cryptic libraries that you’ll find in other languages that rely on reflections to work.
  3. Overall lack of syntatic sugar. This is not a very big deal in my opinion and there are libraries that try to address this, e.g DartX. However, if you have a syntatic sweet tooth, you will find Dart a bit bland. Especially if you’re coming from languages such as Kotlin or C# which have as much sugar in their APIs as Hershey’s does in their chocolates.

Backend Frameworks (or lack there of)

The part that some of you have probably been wondering. What 3rd party framework have we chosen to use for our backend? Dart in the backend is still somewhat of a rare unicorn and while there are some frameworks/libraries which are trying to make it work we feel that they aren’t mature enough yet for us to commit to one of them, or we find that they try to do too many things (such is the case with Conduit). We have implemented our own very minimalistic library to handle HTTP Requests which works rather well and since it’s minimalistic it’s very easy to read/write code for it. Granted it doesn’t support many fancy features that you’ll find in popular backend frameworks from other languages such as Spring Boot, Django, gin or any other Goliath. But the key here is that it works and we can improve it or replace it anytime if we find a better alternative.

If anyone is interested we can share the details of how it works in another article. Spoiler: It’s shoved into a Docker container and deployed to Google Cloud Run

Why it’s all worth it

So you might be asking, is it worth it to get out of your cozy JVM or Swift/ObjC ecosystem and face the new uncharted territory that is the Flutter world?

In our case it’s absolutely worth it. If you’re building a product from scratch, chances are that you don’t really know yet what the direction of that product is going to be and will need to adapt fast to lessons learned from your users. If you don’t adapt quickly enough chances are that you will fail.

In that regard, the code sharing and velocity gained from having all of your codebase in one language is priceless. We’ve managed to explore so many directions in our app because of this. We were able to experiment (and scrap) a whole social network experience for our app. All of it took 3 weeks to write for all platforms.

It’s extremely easy to work across the whole stack and there’s no friction switching between Frontend and Backend. We share the same business logic and models in all of our platforms, which removes inconsistencies between Android and iOS or Frontend and Backend. We don’t have to write the same tests in three different platforms.

All of this makes it worth it for us to deal with a bit of roughness in the ecosystem. Flutter/Dart is improving very fast and it will get even better from here, but in our opinion even in its’ current state it is the most appealing option in the mobile world.

--

--