Warning: This is not the regular motivational stuff you see here. This is a story of how I decided to build Rheas.io - a NodeJs server framework.
Last December I did a freelance project for a client and they needed me to build a project using ExpressJs. Prior to that, I had no experience with the framework. But I had enough experience in PHP, Laravel, and Javascript and I knew I could do it. The project was completed and it seemed really easy to get going with ExpressJs. So I decided to do one of my personal projects using the same.
This is where things went south. What I did for my client was a really simple application that works mostly using REST API and the server was not doing any heavy workloads. But my project needed my server to do some common tasks like session handling, cookie handling, mailing, notification delivery, and many similar things. These are all necessary features of an enterprise-level web application and they were all included in a framework like Laravel.
But ExpressJs didn't have any of these built into it. There are packages and middleware for every use case and we can add them as per our needs. But trust me, there are a hundred packages for each and every feature and you have to choose one from them. Good luck with that!
If you are a beginner like me, you are most probably going to spend hours finding the best package/middlewares for your ExpressJs backend. I spent a lot of time and I didn't want to go through the same process again for my second NodeJs project and I wanted to avoid boilerplates as much as possible. And that's how I decided to create a framework that packs all the features for running a web application server on NodeJs.
Express and most middleware packages in use today are written for the Javascript of 2012. Javascript has changed a lot and new framework architectures are possible now. This is one reason why I decided to create Rheas from the bottom up. Rheas is built using TypeScript. And, ES6 classes are first-class citizens in the framework.
If you are a beginner and want to quickly spin up a web server in NodeJs, just the way you do with Laravel, Rheas could be your best bet. There is no need to find and install packages for even the basic features. Rheas come with all the common features like session handling, cookie handling, routing, pure function controllers/middlewares, the ability to add new features using services, token authentication, OAuth, etc.
That said, the framework is in the final development phase and not production-ready yet. If you are interested in this project, please watch/star/follow the repo at https://github.com/rheas-io/framework
You can see the project roadmap at https://github.com/rheas-io/framework/blob/master/README.md#Roadmap
Right now I am building a community around the project. If you are passionate about open source and would like to contribute to the project, feel free to make pull requests/feature requests. You can find all the modules in the organization account at https://github.com/rheas-io
When the framework is production-ready, you will be able to spin up a fully functional web application NodeJs server by running just three commands.
Nice work Kalesh! I starred the repo and will keep it in mind when I start my next project!
Thank you, Logan🤝
Congrats on getting this far @kalesh13!
I’ve also been thinking about creating a node framework and exploring what’s out there right now—I’m curious why you chose to build Rheas rather than use something like Adonis, Sails, or DerbyJS?
(That’s not a criticism... I’m genuinely asking myself that question too before I build.)
Thank you! Happy to hear that there are people looking for Express alternatives.
When I started, I tested Sails and DerbyJS. From what I tested and benchmarked, Sails is not at all useful for any case. The benchmark scores were very low and it is in vanilla javascript and there is a higher learning curve. Similar is the case with DerbyJs. These frameworks are architectured for the vanilla Javascript before ES6 classes.
What I wanted was a simple and elegant syntax like PHP Laravel, so that developers having experience on it can easily make a switch.
Another reason was the functional programming approach of these frameworks'. I am not a fan of the dynamic assignments on the go. You can see many Express middlewares making dynamic property assignments on the
requestorresponseobjects within the external module. This is okay on build-it and throw-it kind of projects. But not so for enterprise-level applications where OOP is the best-suited architecture.Rheas and Adonis solve all these issues. When I started I didn't know that Adonis existed. But Adonis is an SQL first framework and I needed the option of MongoDb or SQL, multiple database connections, etc. So I continued with the project. And most probably, that's going to be the only difference between Adonis and Rheas. Also, I am planning to add all the modules like social auth, OAuth on the app, UI components, etc.
@kalesh13, cool, thanks for the explanation. Suggest making it a little more clear in the readme that this is a TypeScript framework rather than pure Node; I didn't realize that was a key part until I looked closer at the docs + code.
Adonis@5 purports to be a pretty hefty re-write, and in TypeScript. Will be interesting to see how that shakes out vs Rheas.
Also, I meant to include FoalTS for sake of comparison too. So, probably, Nest.js and Foal are better for comparison rather than those others.
Last thought is that Adonis has felt, in my opinion, a lot like a Laravel port rather than an actual node framework. That's fine in many cases, but sometimes it does weird things like the
usemethod to hack into the module system and create an exact parallel to Laravel. There's other things that don't feel natural in Node. It's important to take inspiration from what Laravel does well and not basically try to port it. (I'd slot syntax like thisRoute.get('/', 'HomeController@index')into the same boat, where you should probably just import the controller and pass the method rather than the string lookup for the controller.)Yes, the documentation needs to be updated. In fact, it's a quick write up I made before I made all the repo public.
I share your same view on AdonisJs. Even I felt Adonis was trying to clone every bit of Laravel. I didn't want that to happen with Rheas, so I made the utmost caution to take the best of both worlds. I wanted it to be comfortable for both the Express developers and Laravel developers alike.
That's one reason why I made the controller/middlewares of Rheas as pure Javascript functions that take two mandatory arguments
requestandresponseand returns theresponsewhich is more like the Javascript way of doing things.That slot syntax is for the Laravel guys. For the Express/NodeJs guys, you can do it with NodeJs import or by passing the function directly.
Or passing directly,
Thanks for responding to all the comments/questions! Good luck with Rheas! Hope you get a good reception.
Gave it a look and starred the repo. Good luck with the project!
Thank you Shawn🤝
This comment was deleted 3 years ago
Thank you Peter🤝