Sign in

AdonisJS Framework

@adonisjs.com
1.3K followers 46 following 58 posts

A fully featured @nodejs.org framework for creating bespoke backend applications in record time. Created by @iamvirk.bsky.social. Learn on @adocasts.com

PostsRepliesMedia
AdonisJS Framework @adonisjs.com · 23/12/2025
The next AdonisJS docs will ship with dedicated LLM endpoints. Not just an llms.txt listing pages. Actual cheat sheets crafted for AI assistants. Minimal context, maximum accuracy. Your AI pair programmer is about to get much better at AdonisJS 🤖
AdonisJS documentation about routing with LLM only text
063
AdonisJS Framework @adonisjs.com · 20/12/2025
Shipping a new ESLint rule: no-backend-import-in-frontend Catches accidental backend imports in your Inertia frontend files at lint time. Type imports still allowed, and you can whitelist shared paths. One less runtime surprise 🙌
// ❌ Error: Importing backend code in frontend files is not allowed
import User from '#models/user'
import { UserService } from '../../app/services/user_service'


// ✅ Correct - type-only imports are allowed
import type { User } from '#models/user'
import type { UserService } from '../../app/services/user_service'

// ✅ Correct - imports pointing to inertia/ are allowed
import { Button } from '#components/button' // if #components/* -> ./inertia/components/*
import { utils } from '../utils'
1122
AdonisJS Framework @adonisjs.com · 18/12/2025
We updated our session package so you can now store sessions in your database! 🔥 On top of that, we added session tagging across drivers (redis, database) with a new SessionCollection API to easily manage all sessions for a user. docs.adonisjs.com/guides/basic...
import app from '@adonisjs/core/services/app'
import router from '@adonisjs/core/services/router'
import { SessionCollection } from '@adonisjs/session'

router.post('/logout-other-devices', async ({ auth, session, response }) => {
  const user = auth.user!
  const sessionCollection = await app.container.make(SessionCollection)

  const sessions = await sessionCollection.tagged(String(user.id))

  for (const s of sessions) {
    if (s.id !== session.sessionId) {
      await sessionCollection.destroy(s.id)
    }
  }

  return response.redirect().back()
})
import app from '@adonisjs/core/services/app'
import router from '@adonisjs/core/services/router'
import { SessionCollection } from '@adonisjs/session'

router.post('/logout-other-devices', async ({ auth, session, response }) => {
  const user = auth.user!
  const sessionCollection = await app.container.make(SessionCollection)

  const sessions = await sessionCollection.tagged(String(user.id))

  for (const s of sessions) {
    if (s.id !== session.sessionId) {
      await sessionCollection.destroy(s.id)
    }
  }

  return response.redirect().back()
})
092
AdonisJS Framework @adonisjs.com · 12/05/2025
Want to learn AdonisJS 6 but don't know where to start? @adocasts.com has you covered with their free course: "Let's Learn AdonisJS 6". You'll get hands-on with most of the core framework features. Start here 👉 adocasts.com/series/lets-...
The “Let’s Learn AdonisJS 6” course on Adocasts. The course is marked as Beginner level, with 113 lessons totaling 14 hours and 11 minutes. Description mentions learning AdonisJS 6 step-by-step, covering routing, controllers, services, EdgeJS, Lucid ORM, forms, filtering, authentication, etc. Hashtags include #vite, #markdown, #redis. Buttons for “Start Series”, “Repository”, and “YouTube” are displayed. A sidebar lists modules: Introduction, Fundamentals, EdgeJS views, Database & Lucid ORM, ORM Relationships, Forms, Authentication, Filtering & Pagination, User Watchlist, User Profiles, Admin Panel.
073
AdonisJS Framework @adonisjs.com · 02/05/2025
After a year of uncertainty, the TypeScript team has officially confirmed that spec-compliant decorators will not support emitting type metadata. Since decorators are used sparingly in AdonisJS, migrating away from the experimental syntax will mostly affect Dependency Injection.
RyanCavanaugh writting : "I don't think we're going to have decorator metadata in ES decorators. It's unlikely. Not impossible, but very unlikely. We are increasingly moving away from any type-based emit in all forms; it's slow, error-prone, impossible for third-party tools to replicate, and not standardized.

emitDecoratorMetadata is documented as experimental, and also requires you to set another flag with experimental in the name. Features don't stop becoming experimental due to the passage of time -- if we thought they were not experimental, we would have renamed them. They're still experimental, and it's still up to each developer to understand the consequences of taking dependencies on features that are not considered stable.

We tried for a very long time to align the TC39 decorator proposal with the experimental decorators that originated in TypeScript. The committee didn't land on something that exactly aligns with what we have, with one...."
191
AdonisJS Framework @adonisjs.com · 13/03/2025
Ever wanted to master InertiaJS? @adocasts.com offers a free series of 91 videos, totaling over 14 hours, guiding you through building an application with AdonisJS 6 and InertiaJS. Start learning today! 🎓 ▶️ adocasts.com/series/build...
A promotional banner for the 'Building with AdonisJS & Inertia' course on Adocasts. The course is labeled as 'Intermediate' and includes 91 lessons totaling 14 hours and 5 minutes. The description states that learners will use InertiaJS with AdonisJS 6 to build a full-featured application named PlotMyCourse, incorporating server-side rendering (SSR), Vue 3, and Shadcn-Vue. The course covers organizations, drag-and-drop features, and extensive form handling.
1111
AdonisJS Framework @adonisjs.com · 02/03/2025
This global where clause can bite you if there are `or where` conditions in your query. To mitigate that, we are removing the top-level `orWhere` method from the query builder, and you will be forced to always define a `orWhereGroup` to write or where conditions.
Code example showing that we removed the top-level "where" method since it may cause issue with automatically added where clause.
010
AdonisJS Framework @adonisjs.com · 02/03/2025
All other parts of your application using DI will receive the same QueryClient instance during the current HTTP request. For example, here I am fetching all the posts for a given tenant without remembering to always add this clause.
Code example showing that now, any query made by the Query Building will have the added constraint automatically added.
110
AdonisJS Framework @adonisjs.com · 02/03/2025
1. Define a middleware that creates an instance of QueryClient and auto adds the `where tenant_id clause` to all the queries. 2. Bind this instance of the QueryClient to the container.
Code example showing the creation of a new QueryClient instance, forcing a query constraint on all query and then binding the new instance to our Dependency Injection Container.
110
AdonisJS Framework @adonisjs.com · 14/12/2024
We've updated our @vite.dev and Inertia packages to support the latest versions: Vite 6.0 and Inertia 2.0. Upgrading your application to these releases is quick and easy. There's only a small breaking change in the Inertia adapter, which can be resolved with a simple find & replace!
npm i @adonisjs/inertia@latest # and your inertia adapter
npm i @adonisjs/vite@latest vite@latest
1468
AdonisJS Framework @adonisjs.com · 23/11/2024
🎉 We are now 7,000 members strong on Discord and have reached 17,000 GitHub Stars. It took us close to a decade to get these numbers. 📈 But we are enjoying this slow growth and craftsmanship. Not everything is built to take over the world. 🙌
A card with the AdonisJS core repository's description and a picture of all core contributors
2224
AdonisJS Framework @adonisjs.com · 22/11/2024
The State of JavaScript 2024 survey is live! The annual survey of the JavaScript ecosystem for this year is now open. Don't forget to vote for us in the "Other Tools" > "Backend Frameworks" section if you’re using our framework! ▶️ stateofjs.com/en-US
The state of JS 2024 logo
0164
AdonisJS Framework @adonisjs.com · 21/11/2024
Great to see steady growth since the release of AdonisJS 6 (almost a year ago). Let’s keep pushing the @nodejs.org ecosystem forward!
npm downloads chart showing a great increase since AdonisJS 6 release
0296
AdonisJS Framework @adonisjs.com · 11/11/2024
@vite.dev is the default asset bundler in every AdonisJS app. Not only does it bundle your frontend assets, but its API also enables server-side rendering of your #InertiaJS codebase, making your app even more powerful. We're excited to be featured on their website today! 🙌
ViteJS website showcasing all frameworks that use it, with AdonisJS featured among them
1435
AdonisJS Framework @adonisjs.com · 11/11/2024
Heard some of you are into #GraphQL? Thanks to @martin-paucot.fr, you can now compose your Object Type from our Lucid Model and perform CRUD operations on it! 🔗 friendsofadonis.com/docs/graphql
import { BaseModel, column } from "@adonisjs/lucid/orm";
import { ObjectType, Field } from "@foadonis/graphql/decorators"; 
import { DateTime } from "luxon";
 
@ObjectType() 
export default class Recipe extends BaseModel {
  @column({ isPrimary: true })
  @Field((type) => ID) 
  declare id: string;
 
  @column()
  @Field() 
  declare title: string;
 
  @column()
  @Field({ nullable: true }) 
  declare description: string | null;
 
  @column()
  @Field(() => [String]) 
  declare ingredients: string[];
}import Recipe from "#models/recipe";
import { Arg, Args, Int, Mutation, Query, Resolver } from "type-graphql";
 
@Resolver(Recipe)
export default class RecipeResolver {
  @Query(() => Recipe)
  recipe(@Arg("id") id: number) {
    return Recipe.findOrFail(id);
  }
 
  @Query(() => [Recipe])
  recipes(@Args() { page, perPage }: RecipeArgs) {
    return Recipe.query().paginate(page, perPage);
  }
 
  @Mutation(() => Recipe)
  addRecipe(@Arg("newRecipeData") newRecipeData: NewRecipeInput) {
    return Recipe.create(newRecipeData);
  }
 
  @Mutation(() => Boolean)
  async removeRecipe(@Arg("id") id: number) {
    const recipe = await Recipe.find(id);
 
    if (!recipe) {
      return false;
    }
 
    await recipe.delete();
    return true;
  }
}
183
AdonisJS Framework @adonisjs.com · 10/11/2024
Any OpenAPI enthusiasts here? @martin-paucot.fr has released another package to generate OpenAPI v3-compliant specifications using TypeScript decorators. 🙌 ➡️ friendsofadonis.com/docs/openapi
import { ApiProperty, ApiOptionalProperty } from "@foadonis/openapi";
 
export default class Post {
  @ApiProperty()
  id: number;
 
  @ApiProperty()
  title: string;
 
  @ApiOptionalProperty()
  content?: string;
}
0154
AdonisJS Framework @adonisjs.com · 09/11/2024
One of our community member (@paucotmartin.bsky.social) keeps delivering amazing packages! 🙌 Today, check out Shopkeeper—offering a smooth, fluent interface for Stripe's subscription billing services. ➡️ friendsofadonis.github.io/docs/shopkee...
export class BillingController {

  async checkout({ auth, request, view }: HttpContext) {
    const user = auth.getUserOrFail()
    
    const checkout = await user
      .newSubscription()
      .price('price_tshirt')
      .quantity(5)
      .checkout()

    return view.render('pages/checkout', {
      checkout
    })
  }

}
0183
AdonisJS Framework @adonisjs.com · 03/11/2024
AdonisJS makes rate limiting a breeze. Set flexible rules tailored to different contexts and authenticated users, all with just a few lines of code. 😍 You don’t need any third-party tools to make it happen. 🙌 📚 docs.adonisjs.com/guides/secur...
Code example that shows how simple it is to setup dynamic rate-limiting rules with AdonisJS
083
AdonisJS Framework @adonisjs.com · 30/10/2024
Transmit is now highlighted in the Server-Sent Events documentation on MDN! ➡️ developer.mozilla.org/en-US/docs/W...
021
AdonisJS Framework @adonisjs.com · 04/10/2024
Want to dive into AdonisJS but don't know where to begin? 🧐 Check out the complete, free "Let's Learn AdonisJS 6" series on @adocasts.com! ▶️ adocasts.com/series/lets-...
043