AdonisJS Documentation

website·Indexed Apr 11, 2026

https://docs.adonisjs.com/

Official documentation for AdonisJS, a full-stack web framework for Node.js. Covers routing, controllers, HTTP context, middleware, request/response handling, body parsing, validation with VineJS, file uploads, sessions, and exception handling. Includes guides for frontend integration with EdgeJS, Inertia, Transformers, Tuyau, TanStack Query, and Vite. Details database operations using the Lucid SQL ORM, Redis integration, and authentication via session, access tokens, and basic auth guards.

Tokens
29.3K
Snippets
109
Records
311
Agent score
50%

What's inside AdonisJS

  1. Dependency injection overview in AdonisJS

    Dependency injection is a design pattern that eliminates manual creation and management of class dependencies. Instead, you declare dependencies as constructor or method parameters, and the AdonisJS IoC container resolves them automatically. The container is integrated into controllers, middleware, event listeners, and Ace commands. AdonisJS uses TypeScript's experimentalDecorators and emitDecoratorMetadata compiler options (pre-configured in new projects).
  2. Authorization overview in DevShow tutorial

    This tutorial demonstrates adding authorization to a DevShow application using AdonisJS Bouncer's policy system. The approach involves creating PostPolicy and CommentPolicy classes to centralize permission logic, enforcing permissions in controllers using bouncer.with(Policy).authorize(), and sending pre-computed permission flags (can flags) to the frontend for UI decisions.
  3. What controllers are and why to use them

    Controllers are JavaScript classes that organize route handlers into dedicated files, solving the problem of route file bloat. Each controller represents a resource (like Users, Posts, or Comments) and defines actions for CRUD operations. Controllers keep routes clean, enable dependency injection, and follow RESTful conventions. Without controllers, all route logic must be defined inline in the routes file, which becomes unmanageable as the application grows.
  4. Extend AdonisJS framework classes with macros and getters

    AdonisJS allows you to add custom methods (macros) and computed properties (getters) to framework classes at runtime without modifying the framework source. This uses the macroable package internally. Extensions are ideal for: adding framework-specific logic reused across your app, maintaining fluent API style, building packages that integrate with the framework, and getting type-safe autocomplete support.
  5. Scaffolding and codemods overview

    Scaffolding generates source files from templates (stubs), while codemods programmatically modify existing TypeScript files using AST manipulation. Together they enable packages to provide seamless setup experiences like node ace configure @adonisjs/lucid. The codemods API is powered by ts-morph and lives in @adonisjs/assembler (a development dependency).
  6. Repl package v1.0.0 stable release

    The @adonisjs/repl package reaches v1.0.0 stable. Later versions (v1.1.0-v1.1.4) added provider and command setup, renamed the package path from Adonis/Core/Repl to Adonis/Addons/Repl, and introduced environment switching via settings.environment.
  7. Auth presets now create user model and migration

    When configuring the auth package, it now automatically creates a user model and migration. Also creates auth and guest middleware.
    v2.0.0, v2.1.0
  8. Queue package v0.3.0 release

    The queue package reached v0.3.0 with major features including Job Retention, Bulk Dispatch, and Storage Redesign.
  9. Official starter kits overview

    AdonisJS provides four official starter kits: Hypermedia (Edge + Alpine.js for server-rendered HTML), React (Inertia.js for fullstack React), Vue (Inertia.js for fullstack Vue), and API (monorepo with Turborepo for custom frontend setups). All include pre-configured auth, TypeScript, ESLint, and Prettier.
  10. Inertia + React Architecture

    Inertia connects AdonisJS backend to React frontend without frontend routing or complex state management. The backend (AdonisJS) handles routing, authentication, database queries, validation, and business logic. The frontend (React) handles rendering and user interactions. Inertia acts as the glue sending JSON responses from controllers to React components. Request flow: Browser → AdonisJS Router → Controller (validates, queries DB) → inertia.render('component', props) → React Component (via Vite) → Browser Response.
  11. Cache package initial release

    AdonisJS Cache package released as v1.0.0-0 (initial release). This is a new package for caching functionality.