All source code of the application we’ll be building can be found here.
Table Of Content
What is AdonisJs?
Some of you are wondering, “what in the world is AdonisJs in the first place?”. AdonisJs describes itself as, “a backend framework for Node.js.” However, you can do both back-end and front-end development using the framework. It follows the Model View Controller(MVC) architecture, therefore, you can create fully functional web apps using a single framework. It has its own templating engine called edge. It was created by Aman Virk.
A couple of weeks ago, I started using the framework. Being torn between express and Adonis, I finally swayed the Adonis way. The reason for this is;
- It has a robust Object Relational Mapper(ORM), which provides first-class support for SQL databases, Query builder with active records, seeds, migrations, and Redis support. This to me was the biggest factor in choosing it as I didn’t have to go through the extra step of manually configuring the ORM.
- Typescript support outside the box🎊
- Well-written and thorough documentation. You can build a web app by just using the documentation.
- Multi driver auth support, which lets you choose between JWT, session, and opaque API tokens.
- It is easy to set up and use.
- It follows good design patterns on what should encompass a web framework.
- Strong emphasis on web security
- A growing community. I personally see Adonis cementing itself as a top backend framework in the next couple of years.
I could go on and on about why I like the framework, but for that, I’ll link some communities at the end of the post for you to have a look at the discussions around it.
Before we make any development I’ll highlight what we’ll be building and the requirements you’ll need to set up an Adonis project.
We’re going to be making a sports apparel store, called FitIt. The goal of the series is to highlight a couple of concepts that are important in your journey to becoming a top-notch Adonis developer. The store will be multi-tenant, meaning users can own different stores and post their gear for that particular shop.
The Database model is illustrated below;
These are the features we’ll be going over, which are essential to understand while working on any project.
- Installation and setup(using typescript)
- Login and registration
- Different authentication schemes
- Account activation
- social signup
- one to many
- many to many
- CRUD operations
- File uploads
- Success and error messages
- Slug system
- Lifecycle hooks
- Events in AdonisJs
- Database Seeders
- Hook up to vue.js frontend.
- Node.js – AdonisJS is a Node.js framework and hence it requires Node.js to be installed on your computer. To be precise, we require at least the latest release of Node.js 14.
- A package manager. I will be using npm However, you can use yarn.
- A code editor. My go-to editor is Visual Studio Code.
- Postman for API testing.
Communities and Resources
If you’ve made it this far, then I’m sure I’ve picked your interest in learning this framework. AdonisJs has a growing community, where you’ll get assistance in your journey. For more info on the framework, you can check out;
You can also follow me on dev as well as check out my personal website where I’ll be writing more on Adonis and full stack development.