AdonisJs - Introduction 
Tags: adonisjs, typescript, javascript, node
Published: 2021-08-12 19:43:32

When we talk about modern software development, it's hard to overlook the role of JavaScript. With so many frameworks to choose from, choosing the 'perfect one is often a conundrum that many newbie developers and experienced ones face when they want to learn new skills. In this series, I will highlight why you should go with [AdonisJs]([https://adonisjs.com/](https://adonisjs.com/)). By the end of the tutorial, I believe you will be able to handle most, if not all of the common tasks involved in any backend application.

All source code of the application we'll be building can be found [here.](https://github.com/tngeene/adonis-tutorial-fitit)

## Table Of Content

1. [What is AdonisJs?](#what-is-adonisjs)
2. [Why Use AdonisJs?](#why-adonisjs)
3. [Series Outline](#outline)
4. [Prerequisites](#prerequisites)
5. [Communities and Resources in AdonisJs](#communities-and-resources)

## 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)](https://www.tutorialspoint.com/mvc_framework/mvc_framework_introduction.htm) 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](https://dev.to/amanvirk1).

## Why AdonisJs

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;

1. It has a robust [Object Relational Mapper(ORM)](https://en.wikipedia.org/wiki/Object%E2%80%93relational_mapping), 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.
2. Typescript support outside the box🎊
3. Well-written and thorough [documentation](https://docs.adonisjs.com/guides/introduction). You can build a web app by just using the documentation.
4. Multi driver auth support, which lets you choose between JWT, session, and opaque API tokens.
5. It is easy to set up and use.
6. It follows good design patterns on what should encompass a web framework.
7. Strong emphasis on web security
8. 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.

## Outline

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;

![https://res.cloudinary.com/practicaldev/image/fetch/s--e9nyVRxq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pzn7uhf6fh7om3u017g5.png](https://res.cloudinary.com/practicaldev/image/fetch/s--e9nyVRxq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pzn7uhf6fh7om3u017g5.png)

## Topics

These are the features we'll be going over, which are essential to understand while working on any project.

1. Installation and setup(using typescript)
2. Login and registration
    - Different authentication schemes
    - Account activation
    - social signup
3. Relationships
    - one to many
    - many to many
4. CRUD operations
    - Pagination
    - Filters
    - File uploads
    - Validators
    - Success and error messages
    - Slug system
5. Lifecycle hooks
6. Events in AdonisJs
7. Mailing
8. Database Seeders
9. Hook up to vue.js frontend.
10. Deployment.

## Prerequisites

1. [Node.js](https://nodejs.org/en/) - 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.
2. A package manager. I will be using [npm](https://www.npmjs.com/) However, you can use [yarn.](https://yarnpkg.com/)
3. A code editor. My go-to editor is [Visual Studio Code.](https://code.visualstudio.com/)
4. [Postman](https://www.postman.com/) 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;

1. [AdonisJS Discord](https://discord.com/invite/vDcEjq6)
2. [Twitter account](https://twitter.com/adonisframework?lang=en)
3. [Official Github Repo](https://github.com/adonisjs/core)
4. [official Documentation](https://adonisjs.com/)

You can also follow me on dev as well as check out my [personal website](https://tngeene.com/) where I'll be writing more on Adonis and full stack development.