Razvan Muntian Avatar

Razvan Muntian

How I ended up with Alpine.js and Express.js

How I ended up with Alpine.js and Express.js

Hello friend,

Thank you for reading these lines. Last period was a bit difficult to say the least. The fact that you read my newsletter encourages me to keep writing.

And I hope it’s been inspirational for you too, either to get better at work, or to start building a side project.

This week’s newsletter is a bit more technical. I’ll try to answer one question: “How I ended up with my tech stack”.

One of the best ways to keep growing and evolving as a software developer is to build side projects. There’s nothing more valuable than building, trying, failing, learning, and, in the end, succeeding.

What’s my past experience

I mainly build web apps and APIs. I’ve been doing this for more than 10 years. Working for multiple clients as an employee, then freelancer and recently as the owner of an outsourcing tech company taught me so much about frameworks and libraries.

The biggest project I got involved in was built with Angular and Node.js microservices. We used several other tools like Docker, CircleCI and AWS, but this newsletter will be written from coding standpoint.

Besides this big project and Angular, I used React, Redux and React Native for mobile apps. I also did jQuery at the beginning. I tried so many frameworks and libraries.

On the backend side, currently I use Node.js, but I also wrote PHP. I used CodeIgniter, Laravel and Symfony.

Why I don’t use what I knew the best

Last year I decided to start building my own apps, and I had to answer the question: “What tech stack should I choose?”

After several iterations, I ended up using Alpine.js, Node.js and Express.js.

“Why not Angular? Or React” you might ask.

There are multiple reasons for picking a niche stack:

I wanted something simple

Angular imposes a specific structure. This is actually really useful for teams with more developers. Having a specific structure, and some best practices means code style is more or less consistent across the app.

You can use external packages, or even build your own reusable components and modules.

The documentation is well written, and there are so many interesting features you might want to consider. There’s also a big community.

All these sound great for a big project, but if you have a small project, this might not be ideal. All the features are cool, but if you have to maintain the project as a solo developer, things can get really difficult really easily.

The “everything in one place” approach

React is faster than Angular. Or at least some time ago it was marketed that way. Compared to Angular, I think it doesn’t need that much setup and scaffolding.

Their selling point is: “You write everything within a component”.

Coming from Angular background, this isn’t really my cup of tea.

I want code to be split: CSS with CSS, HTML with HTML, functionality with functionality.

You might like this approach, but I don’t. So after using React and Redux for one project, and React Toolkit for another, it was eye-opening: I don’t like it.

Upgrading the NPM packages

This was so difficult to do, and it applies to both Angular and React. If you use too many NPM external packages, at some point you’ll have issues upgrading them.

One UI library won’t have Typescript support, and, when that eventually works, it gets in conflict with another library.

Also, major upgrades of libraries and frameworks occur from time to time. Either deprecating a feature you use, adding another React Hook, or simply changing some parameters forces you to spend more time fixing things.

And I didn’t have enough time for this. I want to write these once and not touch them again.

Building the app

I don’t want to have a complicated build/release flow. I mentioned earlier my long term project that had Angular as the main framework.

The build time for that web app took about 20 minutes. Twenty minutes? đŸ€Ż

It was a complex app, but still.

I wanted something as close as possible to the vanilla JavaScript. No build at all, if possible.

So why Alpine.js and Express.js

I started building my apps without any library. My first app (typoquiz.com) doesn’t use any library.

Even tough I didn’t feel the need to add a complex framework, having the basic features of a library/framework would have been nice.

After a while I heard of Alpine.js. It’s simple, doesn’t have too many features and has some basic concepts found in other libraries that come in handy.

Check out this beautifully realized video about Alpine.js:

Speaking of backend, I used Node.js and Express.js while freelancing. I got used to it, and it serves its purpose. It’s that boring decision that you know works every time.

I decided to use it for my projects as well, but this time with a twist: I’m not only building REST APIs, as you would have done for Angular or React apps, but now I’m using EJS as template rendering engine. Like back in the days 😎

I like the fact that I can render some views without having to write client-side JavaScript code. It might not be the fastest, but it gets the job done.

In conclusion

The tech stack doesn’t have to be spectacular. You want to get your job done.

Pick wisely, especially nowadays when new frameworks are released every single day.

Keep the right balance between being proficient and productive with your stack, and having fun, or being challenged from a technical standpoint.

Here are some of my old posts that you might be interested in reading:

https://razvanmuntian.com/blog/5-lessons-learned-on-a-boring-project

If you made it this far, I want to thank you for reading.

These are a few places where you can find me:

👉 I’m most active on X/Twitter: https://x.com/razvanmuntian

👉 Checkout my LinkedIn account as well: www.linkedin.com/in/razvanmuntian

👉 Or if you prefer Instagram: https://www.instagram.com/razvanmuntian

👉 My personal website: https://razvanmuntian.com

Thank you so much for reading this post and I hope it’s been inspirational!

See you soon!

This post was originally posted on Substack