visit
Since I discovered s, I was obsessed with the idea of building something with it. Now that I have some free time, It’s time to build a ! The value proposition of the framework is exactly what the NodeJs ecosystem lacks right now, in my opinion: A very opinionated and productivity-oriented . Adonis is pretty much a Laravel/Rails clone built on top of NodeJs If you are not familiar with Laravel/Rails: Basically, AdonisJs takes care of handling Authentication, routing, mailing, database/ORM configuration for you with built-in modules, so you can just focus on your app logic I’ve grown really bored of rolling out my own auth system, db config, model engine ect.. every single time I was building a new project with Express/Koa. The of AdonisJs was already enough to convince me.If you’re a beginner to the world and you feel overwhelmed by all the packages you need to install and configure to build your first simple app (routing, parsing, mailer, orm, and a big etc) don’t worry, is here for you.
AdonisJs app structure AdonisJs command line tools (CLI) is really useful, you can generate all the scaffolding rather then having to write the same code again and again The CLI is so powerful that you don’t even really have to write that much code to start with, the command line tools can generate a lot on their own (a lot like Rails “generate scaffold” CLI command) : In order to build the job board, its all boils down to a series of CLI commands:
#Install Adonis CLInpm i --global @adonisjs/cli
# Create the projectadonis new job-board# Install the databaseadonis install sqlite3
# Create the "Jobs" SQL tableadonis make:migration jobs // pick "Choose an action" -> "Create table" adonis migration:run
#Create the related JS Model and Controlleradonis make:model Jobadonis make:controller JobController // pick "HTTP controller"
And voilà, you’ve generated the app structure:
- The “Job” database table- The model file (/models/Job.js)- The related HTTP controller (there is a support for socket-based controller)
What about the user table, model and authentication methods?
Well, it’s already been taken care of, when you used the **adonis new job-board**
Command, all the user related scaffolding have been generated!No more pulling your hairs off, or battling with documentation during 2 days
What about Facebook/Twitter/Instagram/linkedIn authentication?
There is a drop-in for that too, of course!If you have a CRUD generator, and the authentication has already been generated for you, what’s left to build for ?
I only created the forms, validators and a basic UI, and went straight to deploy my small appHow long did it take me to build the job board and deploy with AdonisJs?
4 hours. it would have taken me way longer with my usual Express/mongoose/Passport setupWhat about security?
There is a module, , and aCan you just build an API with AdonisJs, and not a full MVC monolith?
Sure, just use adonis new -api-only job-board
Finally, as a last good part, AdonisJs has native support for Async/Await, and much more modern Javascript features, unlike Express current version
The main critics against the framework relies in the fact that AdonisJs introduce a lot of it’s own modules :
TL;DR :
I’ve built with AdonisJs to try out the framework, in conclusion: