AdonisJS is a fully-featured MVC Node.js framework for building various types of applications ranging from web applications to APIs. It takes care of most of your development hassles, offering consistent and expressive APIs. AdonisJS is an opinionated framework as it employs a convention over configuration approach by following a set of standardized conventions so you can start building immediately instead of having to worry about setting up “1 million things”. Though opinionated, it also provides some flexibility by allowing you to override the defaults conventions to suit your needs.
But what does it mean to be a fully-featured framework? One of the reasons for using a framework in the first place is to have some kind of starting point (a great one I must add) containing almost everything (or a way to easily add them) you’d need typically in every application. From a business perspective, you'd want to reach MVP or ship as quickly as possible, and from a developer perspective, you’d want to be as productive as possible without having to fight the framework. With AdonisJS, you get all these and more from the get-go.
In this post, I'll be showing some of the things that make AdonisJS a fully-featured framework.
- Router: AdonisJS comes with a robust router that supports nesting routes, resource routes, routes grouping, subdomain base routing and routes filtering. You can even extend the router through macros.
- Database and ORM: AdonisJS provides an expressive way to interact with database through it ORM called Lucid and a query builder. It supports multiple databases such as MySQL, PostgreSQL, SQLite, MSSQL, and MariaDB. Whether you want to perform CRUD operations or define relationships, Lucid and the query builder has got your back. AdonisJS also provide the ability to create database seeder, model factories and database migrations.
- Authentication and authorization: AdonisJS comes with a fully fledged authentication system to authenticate the users of your application using sessions, basic auth or API tokens as well as social authentication through the
allymodule. In addition to providing authentication mechanisms, AdonisJS also provides a way for determining which users have access to what and what they are able to do through the
- Form validation: ensure your users fill out your application’s forms correctly by leveraging the AdonisJS power and expressive validator.
- Edge template engine: AdonisJS comes equipped with its own template engine called Edge that’s fully integrated with the core. Out of the box, Edge supports interpolation, conditionals, loops, components, layouts, partials amongst others.
- File uploads: AdonisJS has built-in support for file uploads. Not only can you upload files to your local filesystem, but you can also stream files directly to cloud services like S3, Cloudinary, or Google cloud storage using the Drive module.
- Sending emails: out of the box, AdonisJS supports SparkPost, SES, Mailgun, and SMTP for sending emails to your users. If using a different driver from the ones supported by default, you can easily create a custom driver.
- Assets management: AdonisJS provide a way to compile and serve frontend assets by leveraging Encore which is a wrapper on top of Webpack, so you get to use your favorite ****frontend assets in your application.
- Security: out of the box, AdonisJS provide protection against CSRF, CORS, XSS, and content sniffing through the
shieldmodule. Also, AdonisJS provides protection against SQL injections on the database layer. In addition to all these, AdonisJS provides other security layers such as encryption, hashing, and signed URLs.
- CLI: AdonisJS comes equipped with a CLI framework called Ace that makes crafting CLI applications seamless and intuitive.
- REPL: want to quickly try out something and don’t want to go through the usual route of firing up your web browser or HTTP client, AdonisJS REPL provides a way to quickly execute single-line instructions and print the output to the terminal.
- Internationalization: through the i18n module, you can easily add support for internationalization and localization to your application.
There you have it! You have seen some of the things that make AdonisJS a fully-featured framework. Of course, this is to only mention but a few. To learn more about AdonisJS, do check out the official website and documentation. If you’d like to level up your AdonisJS skills, kindly check out our courses here on Adonis Mastery.