Victor Ndaba

Introducing backframe.js

By Victor Ndaba, 8/31/2023
Tags: #backframe#nodejs#frameworks

Disclaimer

backframe.js is still in its very early stages of development. Please note that this blog may describe features that are not yet implemented at the time of reading as to give you an idea of what the final product will look like.

The why

I don’t know about you but the first time I used Firebase, it felt really awesome. It was just so cool have to do next to nothing and yet have a fully functional backend*. And not just that, but a dashboard from where I could see/manage everything. It was just so cool: The power of the sun, in the palm of my hand :). But then as I grew as a backend developer, I found myself craving certain functionalities that Firebase didn’t provide. And not just them, but other BaaS providers as well: supabase, appwrite, nhost, amplify (😬 shakes traumatically). And thus began the series of steps that would eventually lead me down the backframe.js road.

Now I know what you’re thinking: ‘Oh God, another backend framework/baas’. And while you are completely justified in thinking that, allow me to explain why I think backframe.js is different.

In my journey as a backend developer, I’ve worked with a bunch of BaaS providers and backend frameworks. And while they all had their pros and cons, I found that they all had one thing in common: They were all extremely opinionated. And while that’s not necessarily a bad thing, it does mean that you have to learn how to do things their way. And if you’re like me, you probably don’t like that. I mean, I’m all for learning new things, but I don’t want to have to learn a new way of doing things every time I want to use a new framework.

The best metaphor I once came up with for this is that it’s like you’re trying to buy legos. Now amplify and the rest, sell you an already built lego set (that is glued together for some reason). And while that’s great for certain use cases, it means that you can’t really do much with it. You can’t really build anything new with it. You can only use it for what it was built for. And that’s fine, but what if you want to build something new? What if you want to build a lego house? Well, you can’t. You might find creative workarounds/hacks for your use cases, but you shouldn’t have to do that in the first place. And that’s where backframe.js comes in. backframe.js doesn’t sell you a lego set. It sells you the legos. And that’s the beauty of it. It’s not as opinionated. It just gives you the tools to do things. And that’s what I love about it. And that’s why I think you’ll love it too.

The what

So what exactly is backframe.js? Well, this is where it gets a bit tricky. I often find it hard to explain it to people because it’s a bunch of things at once. At its core, it is simply a nodejs framework built on top of express and other technologies as well. Now the framework comes with a CLI and a plugin ecosystem that allow it be used to power simple APIs or complex backends. The architecture of the framework allows functionality to be spread across modules(plugins - the legos) which can be combined in any way to create a backend. i.e You can start with the framework itself @backframe/rest and create simple API endpoints. Then realize you need to add authentication and user management, so you add the @backframe/auth plugin. And what about storage ? That’s where the @backframe/storage plugin comes in. By the end of it, you’ll have a full fledged backend with authentication, user management, storage, and more. You can top it all off with an admin dashboard by adding the @backframe/admin plugin. Please note that the plugins outlines above are still in active development at the time of writing this blog.

I hope that gives you a better idea of what backframe.js is. If you’re still confused, don’t worry. I’ll be writing more blogs about it in the future. I’ll also be writing a blog about how to use it to build a simple API. So stay tuned for that.

The how

It definitely took a while to get to this point. The idea sprung to mind about 2 years ago but still it was just that, an idea. Earliest versions for more of express generators and simply generated boilerplate code but with time the idea slowly took shape and became what it is today. I’m still actively working on it and I hope to have a stable release by the end of the year. It is fully open source and built on top of some really cool tools and technologies.

The journey was not without inspiration and ‘code borrowing’. Most came from what I would call the Frontend ecosystem (like Next.js) and while that’s not strictly a frontend framework, it is at least frontend-heavy. It just seemed to me like the frontend ecosystem was moving at a much faster pace than the backend ecosystem. And I wanted to bring some of that energy and concepts they had introduced to the backend. Thus came the file-system based routing inspired by Next.js, Remix and Solid Start, the plugin system ‘borrowed’ from Vite’s API and Rollup’s plugin system, the CLI closely resembling that of Astro, and the list goes on. It’s open source because it was built on open source.

All contributions are welcome. If you’re interested in contributing, please check out the github repo and the documentation.

The when (roadmap)

As mentioned earlier, I hope to have a stable release by the end of the year. But before then, there’s still a lot of work to be done. I have recently just made the alpha versions available on npm and I’m hoping to get some feedback from some real users which will help shape the future of the framework. You can get started by running the following command:

pnpx create-bf@latest backframe-app

Beware of bugs!!! And please report them if you find any. This is still very much a work in progress.

Here’s how the roadmap looks like at the moment:

  • Alpha release
  • Beta release
  • Stable release
  • Full fleged Documentation
  • Complete official plugins
  • backframe.js client libraries

Whew! That’s a lot of work. But I’m excited for the future of this framework and I hope you are too. If you’re interested in contributing, kindly reach out to me on X (https://twitter.com/vndaba_) or on the project’s github repo. (I’m still working on the community aspect of this project). Thanks for reading and I hope you will give backframe.js a try.

See an error on this page? Edit on github
Introducing backframe.js