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!