If you’ve ever felt the "fatigue of choice" in the NodeJS ecosystem, spending more time picking libraries, then you are going to love AdonisJS.
What is AdonisJS?
AdonisJS is a NodeJS web framework for building type-safe full-stack, API, and even Inertia applications. It also provides everything you need to build production-ready applications out-of-the-box with a coherent suite of first-party packages.
Many NodeJS frameworks are micro, meaning you have to plug in 20 different packages to get a working app and decide how those 20 different packages should play into a bigger structural picture. AdonisJS, on the other hand, gives you an opinionated code base built with a standard structure, a set of powerful tools, and a clear way of doing things. Allowing you to stop debating folder structures and whether to use this or that package and start building features.
The opinionated and convention-driven native of AdonisJS is awesome for many reasons. First, the foundations are built from tried and tested patterns to help you succeed from the gate. It also provides a predictable and easy-to-understand structure for those onboarding onto your team and project. Plus, in the era of ever-growing AI usage, these conventions act as built-in guardrails for AI as well. Allowing it to understand your project with less tweaking and teaching required by you.
AdonisJS's core suite of first-party packages also shares a coherent voice. If you familiarize yourself with one, you'll be instantly familiar with the APIs of the others. Each package has different features and purposes, but the voice they use is the same, making understanding them that much easier.
So, all-in-all, AdonisJS is built to provide a great developer experience and to allow you to rapidly build applications to help you spend more time making and less time gluing things together.
Some of the powerful batteries included with AdonisJS are:
Type-safe routing
Lucid ORM for easy database communication
EdgeJS for server-side templating
Transformers for API and response shaping
Japa for testing
Encryption, CSRF, Rate Limiting, and other security mechanisms
IoC Container with Dependency Injection
Command line interface (CLI)
Authentication
Authorization
Internationalization
File storage
Events
Email delivery
OpenTelemetry integration
And more!
Our Roadmap
Throughout this series, we'll start by getting familiar with the project structure and setting up our environment. Then, we'll move on to the fundamentals of the framework, getting comfortable with the basics.
We'll next move into the three critical topics: database, authentication, and authorization, all of which are needed by almost every application. Finally, we'll dig into the engine room of the framework, covering things like the IoC Container, dependency injection, email, file uploads, and more.
For us to cover what we need in a time-efficient manner, we won't be building a specific application. There will, however, be a general data theme we'll follow throughout.
AdonisJS 7
Version 7 of AdonisJS focuses heavily on providing type-safety and cleanliness throughout the framework. This includes type, model schema, and barrel file generation. It also introduces transformers as a way to explicitly describe the shape of the data being returned by your endpoints.
We'll be discussing each of these throughout this series, so if you're already familiar with AdonisJS, feel free to jump to those respective lessons as you see fit.
Okay, ready to start? In the next lesson, we'll set up our development environment so we're all on the same page before we create our project.