My thoughts on ElysiaJS
Tags: bunjs, backend, development, elysiajs
Published: 2023-11-19 22:49:40

![Bun in the Oven](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6yrqzhdg61qn3qtstvzr.png)
### Before the Oven
My background in Graphic Design and Motion Graphics has drawn me closer to frontend development as the next step in my career, I've found myself really comfortable working in the UI/UX space, but of late after designing a few mobile app's, I developed an urge to learn how apps connect to the rest of the world, I experimented with Backend-as-a-Service systems (BaaS) such as [Appwrite](https://appwrite.io/), Supabase and Firebase, these left me with an even deeper hunger to want to learn how backend systems work.

![ExpressJS logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q3c6r4ycqtmajhuckih8.png)

I had tried ExpressJS in the past, I understood the concept of it but never really had the interest in working with backend systems  until recently when I discovered [NestJS ](https://nestjs.com/) - _A mature, progressive framework_ running on NodeJS. Having a background in Angular development myself, NestJS felt like home. I recommend it to anyone trying to get into the backend world.

![Bun logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i9hkohopxuq5a2aircud.png)

### 100 degrees celsius
When I first read stories about Bun, I was really excited, not only because it was another "Node killer", but because of the story of it - being built from the ground up using more performant tools and housing even more libraries by default - unlike Node. It was the same excitement I had when I discovered Cinema 4D and Blender taking over from 3DS Max. Every once in a while great tools begin to show their age due to the foundations they were built on, it is that way in the human world, and also in the tech world, and funny enough I happen to be watching [Cars 3](https://en.wikipedia.org/wiki/Cars_3) as I write this, which has a similar storyline.
Node is battle tested with over 13 years of development and perfection, meanwhile Bun only recently hit version 1.0 which will ofcourse have some minor issues here and there before it can truly take over the scene, but in it's current state it still shows off a massive improvement in requests per second, load times and several other benchmark tests.

![Bun benchmarks](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s5z1vh9bpy0xptxrtlrz.png)

### Backend on fire
Over time, the world will adopt Bun - I hope, even though as you read this blog, Bun cannot natively be installed on Windows OS, but I had no problems whatsoever installing it on Ubuntu 20 via WSL2 (Windows Subsystem for Linux). My main interest with Bun has been to try [ElysiaJS](https://elysiajs.com/), an "Ergonomic Framework for Humans", quite basically a faster and more capable ExpressJS, thanks mainly to Bun 😎

![ElysiaJS statistics](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iyg1ia7w327dh7ulriin.png)
The above image will explain it all - why I was eager to try Elysia. Don't get me wrong Nest is still an all-round production-ready and modern framework, not forgetting it's a breeze to use if you're familiar with Angular, and did I mention it's currently sitting at version 10.2.9?
Well, while at version 0.7.21, Elysia is still pretty impressive despite not having a CLi. I was able to fire it up and manually set up a module system which is basically a folder consisting of a Routes, Controllers and a Services folder, a regime I picked up from Nest, and even though setting up a Microservice should be possible with Elysia (manually) I am yet to try this, something that NestJS offers out of the box with ease!!

My Elysia server consists of a Users and Auth system that relies on [Prisma ORM](https://www.prisma.io/), [PostgreSQL database](https://www.postgresql.org/) and [Lucia Authentication](https://lucia-auth.com/). To run my database locally I am using [Laragon](https://laragon.org/index.html) which requires an installation of Postgres as it doesn't come with one out-of-the-box, other than that everything else was a breeze except for one minor issue, Prisma is built for NodeJS and as such requires an installation of Node - for now atleast, once that is set up you're good to go!

From the documentation section of Elysia you will notice it offers several plugins that make Elysia even more capable, these include plugins such as

- **Eden**, a secure way for your client to access backend functions
- **Swagger**, an endpoint to view all your API endpoint documentation
- **GraphQL**, **tRPC**, A query language for API's, end-to-end typesafe API's 
- **CORS**, **Helmet**, **Bearer**, **JWT** and **CRON** just to mention a few

All this comes on top of Elysia's pre-existing features which include:
- Lifecycle hooks and data transformation,
- Response validation using schemas (think of typescript interfaces),
- File uploading and serving,
- Error Handling,
- Lazy-loading of modules,
- Web Sockets,
- Data streaming,

---

I will share my Elysia project soon and keep updating it as I go but you can have a look at it's current structure, pretty similar to ExpressJS 😎

Feel free to contact me for any questions or collaboration requests