Interview with Kamil Myśliwiec: Part One
NestJS is a framework that loyal readers of Angular.love have already had the chance to explore. If you haven't come across it yet, be sure to check out our earlier coverage.
We've been keeping a close eye on the work of Nest's creator, Kamil Myśliwiec. His journey has been such a source of inspiration for us that we reached out to him for an interview. Kamil was kind enough to respond to 25 questions, just for you!
Here is the first installment of our conversation, where we discuss the origins and the road ahead for Nest, with a few thoughts on Angular mixed in.
Maciej Sikorski: What pushed you to build NestJS? Did people warn you against starting yet another framework?
Kamil Myśliwiec: When I began tinkering with Nest in the latter part of 2016, I had no clear objectives. I never imagined the project would grow into the full-fledged framework it is today or attract so much attention. In the beginning, it was just a hobby project I tinkered with late at night. I held no particular expectations; I simply kept adding features that I wished the frameworks I used would have, designed in what I considered the "ideal" way. Every tweet mentioning the project or every GitHub star felt like a win and fueled my motivation to keep going.

Was Nest your first attempt at building a framework from scratch? If so, why do you think it succeeded where other attempts might have failed?
Like most developers, I'd thrown together my own set of reusable "boilerplates" or mini-frameworks for various projects over the years. However, Nest was the first effort of this magnitude. It's important to note that the early designs and prototypes looked quite different from what we have today. It was a bumpy road.

You mentioned the early sketches were quite different. Does that mean Angular wasn't the initial inspiration?
Angular's architecture and core principles were a source of inspiration right from the start, but it's true that the first prototypes were lacking certain elements like guards or interceptors. Many decorators also had different names back then (the @Injectable decorator wasn't there, for example), and there were even some subtle nods to Spring that were quickly removed. Plus, there was no CLI at that time, which now depends heavily on @angular-devkit packages.
What kind of experience do you have with Angular?

My first encounter with what we now know as Angular was back in 2013, when I was working with its predecessor, Angular.js. To be completely honest, I wasn't ever a huge fan of it. In the period before the first "Developer Preview" versions of Angular 2 appeared, I found myself gravitating towards React much more often.
The very first professional project I tackled with the "new" Angular relied on its beta version—which, given the number of "breaking changes" released later, was probably not the smartest move. From then on, I kept a close watch on its progress, and once a stable and practical version finally came out, it became a regular part of my tech stack. Interestingly enough, I actually joined my first project using the stable release of Angular as a React developer.
Why did you decide to base so much of NestJS on Angular?

Throughout my career, I've frequently switched between languages and tools, often due to changing jobs or projects. While I believe it's valuable to explore various technologies to broaden your experience and gain different perspectives, I've also noticed how many concepts are fundamentally similar, even if they have entirely different names or designs.
The problem is that this often adds little to our actual knowledge. Instead, we end up spending a lot of time just trying to figure out how to accomplish the "same" thing in a new tech stack, memorizing the API and poring over docs rather than learning new concepts or techniques.
Nest is a demonstration that even from different worlds like backend and frontend, you can use shared vocabulary and mirrored ideas (in this case, drawing from Angular's very generic terminology) without having to reinvent the wheel. By staying close to terms and patterns people already know, Nest is much more approachable for those with a background in Angular and acts as a bridge into backend development. Furthermore, if you're working on both sides of the stack, using Nest and Angular together noticeably lowers the cognitive load required to switch between the two projects.

What were the most significant hurdles you faced while building NestJS?

There have been plenty of challenges, and picking the biggest one is tough. But I'd say the main struggle was a shift in mindset. Creating an application for end users is entirely different from designing libraries on this scale. The aim was to build a tool that maximizes efficiency, boosts productivity, and encourages a certain structure without being restrictive. It shouldn't become a burden to the developer. You want to make complex tasks easier or faster, and sometimes you have to do the opposite. The key is to avoid constraining the user. Finding that sweet spot between flexibility and defining clear boundaries and abstractions is incredibly difficult, and getting it wrong is probably why so many tools end up failing.

Were there times you wanted to walk away from this project?

The beginning was definitely the hardest period. I was working on Nest mostly at night and on weekends because my days were already full with a full-time job and other obligations. There were entire months where my GitHub activity dropped to nearly nothing just because I was overloaded. But I never hit a breaking point where I seriously thought about abandoning the project altogether.

What was your approach to promoting the framework? Besides writing the code, what were the key actions that helped NestJS gain so much traction? Even the NestJS Discord server seems to have more daily active users than its Angular counterpart.

In the open source world, news spreads fast, sometimes on its own. My main focus was on development. I did maintain a Twitter account for marketing and wrote the occasional article. Also, giving talks at conferences and running workshops definitely helped raise awareness about the project.

At what stage did you feel Nest was ready to be presented at a conference?
If it were solely up to me, I probably would have never decided to do it on my own. In late 2018, Zack, the organizer of the ngAtlanta conference, reached out to me. He told me he was organizing a conference in four months and wanted me to speak. At that time, I didn't have a visa or even a passport that was still valid. And that is how it all began.

In what ways has building this framework helped you grow as a programmer and as a manager?

For me, this has been an incredible and invaluable "baggage of experience". The most significant growth opportunity has come from interacting with the global developer community. When you publish a project like this, you open yourself up to criticism from all directions. You'll encounter many ideas and opinions that challenge your initial assumptions. This forces you to be able to defend your own decisions when they are correct, but also to be self-critical and open to discussion, and ultimately to improve by learning from others.

Is there a fun story behind the cat becoming the project's mascot?
No, actually! The truth is, the only reason cats are featured across all our marketing is because of my, perhaps excessive, fondness for them. Cats are largely self-reliant, independent, and quite proud. In many ways, this aligns perfectly with Nest's philosophy.
What are your plans for Nest in the future?
In the near term, we're focusing on releasing the v8 version which has been in the works for a few months. This new "major release" brings both small incremental improvements (such as automatic type inference when using "dot notation" in the "config" package, the ability to buffer logs, or subscribing to the same event in parallel from multiple controllers) as well as new features. This includes improved application versioning and the capability to lazy-load modules "at runtime," even though this mechanism operates quite differently from what Angular does. We'll also make some small documentation improvements, introducing a new chapter on serverless, which was one of the most requested topics in our repository. In the long run, it's about continuous development of the framework and its surrounding ecosystem.
The answer to this question was provided on June 23rd, 2021. NestJS 8 has since launched—find more details here.

Do you have any big goals or a "dream" for NestJS?
I don't have any specific, far-off ambitions. But I have often joked that the ultimate goal would be to see Nest's download numbers on NPM rival Angular's.

How can the Nest community help with the development and the roadmap?
The best way is through direct contributions, which usually means addressing issues reported by the community with Pull Requests. Some of these are not too time-intensive and don't require deep knowledge of the entire codebase, just understanding certain parts of it. Similarly, if there is a feature request for a small improvement, it's worth considering if you can draft a solution yourself (in addition to creating an issue), especially if it's something that can be fixed with a few lines of code.
Since you are Polish, does that give Polish developers any special advantages? Can they expect any exclusive content (beyond this interview 🙂)? Some have suggested creating Polish documentation, similar to what Vue.js has.

I've often dreamed about setting up a Polish version of the docs, and I would love to make that happen eventually. However, the main barrier to supporting multiple languages right now isn't just the translation of existing chapters, but also the ongoing maintenance required to keep them all current as new features are added. Documentation for large projects is arguably one of the most time-consuming parts of maintaining a framework, which is why Nest is still English-only for now. There have also been a few ideas floating around about writing a Polish book on Nest. I have to say, that sounds like a very fun challenge, but it would also be extremely demanding and require a lot of dedication. And, of course, I am always delighted to attend my favorite local conferences like NgPoland and JsPoland, where you can always come and say hi!
