Page Inspect
Internal Links
6
External Links
41
Images
42
Headings
32
Page Content
Title:AdonisJS - A fully featured web framework for Node.js
Description:AdonisJS is a TypeScript-first web framework for building web apps and API servers. It comes with support for testing, modern tooling, an ecosystem of official packages, and more.
HTML Size:152 KB
Markdown Size:12 KB
Fetched At:November 18, 2025
Page Structure
h1Create bespoke backend applications in record time
h3Type-safe
h3ESM ready
h3Fast - Wherever it matters
h2Feature rich framework core
h2World-class testing experience
h2A huge collection of officially maintained packages
h4Lucid
h4Auth
h4Bouncer
h4FlyDrive
h4Limiter
h4Edge
h4Bentocache
h4VineJS
h4Ally
h4I18n
h4Health checks
h4Mailer
h4Transmit
h4Lock
h4Vite
h4Inertia
h4Tuyau
h3IoC container
h3Supercharged CLI
h3Security primitives
h2A wall full of love and support from developers across the world
h2Sponsored by fantastic companies and individuals
h5Community
h5Resources
h5VSCode Extensions
Markdown Content
AdonisJS - A fully featured web framework for Node.js
AdonisJS v7 Alpha is now live for Insiders! Unlock access
Menu
- Docs
- Partnership
- Sponsor new
- Blog
- About
- 18.2k
# Create bespoke backend applications in record time
AdonisJS is a TypeScript-first web framework for building web apps and API servers. It comes with support for testing, modern tooling, an ecosystem of official packages, and more.
Get started
Register routes Create a controller Make a model Define a validator Put it all together
import router from '@adonisjs/core/services/router'
import PostsController from '#controllers/posts_controller'
router.get('posts', [PostsController, 'index'])
router.post('posts', [PostsController, 'store'])
router.get('posts/:id', [PostsController, 'show'])
node ace make:controller posts
import type { HttpContext } from '@adonisjs/core/http'
export default class PostsController {
async index({}: HttpContext) {
// we want to return a paginated list of posts
}
async store({}: HttpContext) {
// we want to save a post
}
async show({}: HttpContext) {
// we want to return a post by its id
}
}
node ace make:model post
import { BaseModel, column } from '@adonisjs/lucid/orm'
export default class Post extends BaseModel {
@column()
declare id: number
@column()
declare title: string
@column()
declare contents: string
}
node ace make:validator posts
import vine from '@vinejs/vine'
export const createPostValidator = vine.compile(
vine.object({
title: vine.string().trim().minLength(4).maxLength(256),
contents: vine.string().trim()
})
)
import Post from '#models/post'
import { createPostValidator } from '#validators/post'
import type { HttpContext } from '@adonisjs/core/http'
export default class PostsController {
async index({ request }: HttpContext) {
const page = request.input('page', 1)
return Post.query().paginate(page)
}
async store({ request }: HttpContext) {
const payload = await request.validateUsing(createPostValidator)
return Post.create(payload)
}
async show({ params }: HttpContext) {
return Post.findOrFail(params.id)
}
}
### Type-safe
We pay a closer look at type-safety, seamless intellisense, and support for auto imports when designing framework APIs.
### ESM ready
AdonisJS leverages modern JavaScript primitives, including ES modules, Node.js sub-path imports, and much more.
### Fast - Wherever it matters
We ship with one of the fastest validation libraries, and our HTTP server has performance on par with Fastify.
## Feature rich framework core
The core of the framework is a single npm package that provides all the base-level features you need to create a web application from scratch.
No need to spend hours finding and assembling dozens of packages together before you can write the first line of code.
Use AdonisJS and be productive from day one.
- Config management
- Type-safe environment variables
- Thoughtful folder structure
- Routing and controllers
- Middleware
- BodyParser
- File uploads
- Type-safe event emitter
- Encryption
- Password hashing
- And much, much more.
import router from '@adonisjs/core/services/router'
import User from '#models/user'
import { middleware } from '#start/kernel'
router.put('me/avatar', async ({ request }) => {
const avatar = request.file('avatar', {
extnames: ['jpg', 'png'],
size: '2mb'
})
await avatar.move('uploads')
return avatar
})
router
.get('/users/:id', async ({ params }) => {
return User.findByOrFail(params.id)
})
.use(middleware.auth())
## World-class testing experience
Testing is not an afterthought for us. We ship with primitives to manage test databases, swap dependencies, generate fake data, interact with cookies and sessions, and much more.
With AdonisJS, you will love writing tests.
Browser testing Open API tests Trap outgoing mails Command-line tests
import { test } from '@japa/runner'
import { UserFactory } from '#factories/user_factory'
test('render polls created by the logged-in user', async ({ visit, browserContext }) => {
/**
* Create a user with 5 polls using Model factories
*/
const user = await UserFactory.with('polls', 5).create()
/**
* Mark the user as logged in
*/
await browserContext.loginAs(user)
/**
* Visit the endpoint that renders the list of
* polls for the logged-in user
*/
const page = await visit('/me/polls')
for (let poll in user.polls) {
await page.assertExists(
page.locator('h2', { hasText: poll.title })
)
}
})
import { test } from '@japa/runner'
import { UserFactory } from '#factories/user_factory'
test('get list of expenses for the logged-in user', async ({ client }) => {
/**
* Create a user with 10 expenses using Model factories
*/
const user = await UserFactory.with('expenses', 10).create()
/**
* Login user and visit the API endpoint to
* get the list of expenses
*/
const response = await client
.get('/me/expenses')
.loginAs(user)
/**
* Assert response matches the schema defined
* in an OpenAPI schema file
*/
response.assertAgainstApiSpec()
response.assertBodyContains(user.expenses.toJSON())
})
import { test } from '@japa/runner'
import mail from '@adonisjs/mail/services/main'
import VerifyEmailNotification from '#mails/verify_email'
test('create user account', async ({ client }) => {
/**
* Fake emails before executing the code that
* triggers emails
*/
const { mails } = mail.fake()
const response = await client.post('users').json({
email: 'virk@adonisjs.com',
password: 'secret',
})
response.assertStatus(201)
/**
* Assert an email was sent after making the request
* to the "/users" endpoint
*/
mails.assertSent(VerifyEmailNotification, ({ message }) => {
return message
.hasTo('virk@adonisjs.com')
.hasSubject('Verify email address')
})
})
import { test } from '@japa/runner'
import ace from '@adonisjs/core/services/ace'
import Greet from '#commands/greet'
test('greet the user and exit successfully', async () => {
/**
* Create an instance of the CLI command
* and execute it
*/
const command = await ace.create(Greet, ['virk'])
await command.exec()
/**
* Write assertions for the command status and
* logs
*/
command.assertSucceeded()
command.assertLog('[ blue(info) ] Hello world from "Greet"')
})
## A huge collection of officially maintained packages
Always find yourself switching between the latest ORMs or migrating away from those unmaintained libraries?
We have been there too! That is why AdonisJS ships with a collection of officially maintained and well-documented packages.
Pick and use the ones you need.
#### Lucid
SQL ORM with a database query builder, Active record based models, support for migrations, and model factories for testing.
#### Auth
Driver-based authentication layer with support for sessions, API tokens, basic auth, and much more.
#### Bouncer
Bouncer provides low-level APIs to build custom authorization workflows like RBAC or ACL.
#### FlyDrive
FlyDrive provides a unified API to manage user-uploaded files on S3, GCS, and the local filesystem.
#### Limiter
Protect your API endpoints by implementing fine-grained rate limiting. Supports multiple backend stores.
#### Edge
A modern and batteries-included template engine for the ones who keep things simple.
#### Bentocache
Speed up your applications by storing slowly changing data in a multi-tier cache store.
#### VineJS
A superfast and type-safe validation library for Node.js. VineJS comes with 50+ validation rules and 12+ schema types.
#### Ally
Add support for Social login to your apps. Ally ships Twitter, GitHub, Google, LinkedIn, and many more drivers.
#### I18n
Create multi-lingual web apps. We provide APIs for localization, formatting values, and managing translations.
#### Health checks
Monitor database connectivity, redis memory size, and your application health using a single package.
#### Mailer
Send emails from your application using a multi-driver mailer. Supports SMTP, SES, Mailgun, Resend and much more.
#### Transmit
Send real-time updates by leveraging the power of Server Sent Events (SSE).
#### Lock
Synchronize the access to a shared resource to prevent several processes, or concurrent code, from executing a section of code at the same time.
#### Vite
Bundle the frontend assets of your applications using Vite.
#### Inertia
Make your frontend and backend work together in perfect harmony.
#### Tuyau
An end-to-end type-safe client for interacting with your AdonisJS APIs.
### IoC container
AdonisJS ships with a zero-config IoC container that uses reflection to resolve and inject class dependencies.
### Supercharged CLI
Scaffold resources, run database migrations, use application-aware REPL, or create custom commands. All using a unified CLI framework.
### Security primitives
Implement CORS policies to protect your APIs, or use AdonisJS shield to protect against CSRF, XSS, and man-in-the-middle attacks.
## A wall full of love and support from developers across the world
> Mahmoud Mousa
>
> @MahmMousa
>
> Adonis in MVC is a blessing tbh! I use it with HTMX or Turbo and it's just perfect!
> Peter Vukovic
>
> @pvukovic
>
> Adonis is wonderful - just a perfect level of cognitive load a framework can have both in documentation and implementation.
> Not too much, not too little, but exactly what you need as a developer.
> Reagan Ekhameye
>
> @techreagan
>
> @adonisframework is the first ever framework I learnt from the docs, I'm in love with this framework, it's just like @Laravel but for the @nodejs world . I will be like I'm stuck how can i solve this, the docs got you covered. It's gonna be my long term buddy.
> Trésor Muco
>
> @mucotreso
>
> The more I work with @adonisframework the more I'm convinced that it is the best framework in the Nodejs Ecosystem.
> The docs are well written, well designed, you just want to stay there and learn more.
> Thanks to all the people who are working on this project.
> Dragos Nedelcu
>
> @Drag0sNedelcu
>
> Tried recently @adonisframework v6 and I am blown away. I love how the modules are separated, like orm, validation etc. Wish there were more discussions on this. Feels highly underrated...
> Carl Mathisen
>
> @carlmathisen
>
> We’ve used it at work for a couple of years, just replacing these express cocktails. They were fine, but I was tired of maintaining and upgrading a unique set of libraries that were our company unique combination of regular features.
> Jofie Bernas
>
> @jooop4y
>
> Having a solid experience in Laravel and wanting to explore NodeJs, I found @adonisframework a good choice for me to go through. It is been easy for me to jump in since it feels like I am just writing Laravel but in typescript and NodeJS , Awesome developer experience!.
> Dylan Britz
>
> @britzdm
>
> I've been using @adonisframework for the last two days an I've already got more done then I did in the last 3 weeks with just using expressjs.
> Sam Newby
>
> @SamNewby\_
>
> If you’re a PHP dev who loves Laravel and want to give another language a go and use a similar style framework then make sure to check out @adonisframework. It has its own ORM, Auth support, and even a CLI tool called Ace which is very similar to Artisan.#Laravel #NodeJS
> Andrew Weir
>
> @andruu
>
> So funny seeing everyone looking/begging for the node/ts equivalent of rails/Laravel when it’s existed for years. I started using @adonisframework in 2016 in production for one of the biggest startups in Asia. If you want full stack with everything built in take a look.
## Sponsored by fantastic companies and individuals
AdonisJS is an independent open-source project released under the MIT license. We rely on our GitHub sponsors to keep the lights on.
Your logo
AdonisJS is not yet another micro-framework or a wrapper on top of everything that already exists. Instead, we have written AdonisJS from scratch to be simple, elegant, and opinionated.
##### Community
Discord Twitter GitHub Forum
##### Resources
About Blog Partnership Packages Code of Conduct Brand guidelines V5 Documentation
##### VSCode Extensions
AdonisJS Edge Japa