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!