Adocasts
Master AdonisJS and NodeJS with expert video lessons on Adocasts. Explore topics like authentication, Edge templating, Lucid ORM, and more to build robust web applications.

#20 | CRUD Basics - AdonisJS 7
This chapter covers moving from in-memory CRUD to actual database interactions for the Challenge model, including creating records using the model’s static create method and handling not-null foreign keys (creatorId) by adding related user and role records. It demonstrates querying and updating via find or fail and merge/update patterns, explores deleting with proper cascade behavior across pivot tables, and finishes by using a Ripple session to quickly seed data (roles and users) and render database-backed results. Finally, it touches on replacing in-memory arrays with real database lists and hints at using query builders for more complex filtering later in the course.

#21 | Factories & Seeders - AdonisJS 7
The lesson demonstrates using Cedars to seed initial data (roles, users) and how to gate these seeds by environment. It covers defining enums for fixed IDs, updating imports, running seeds via interactive or automatic modes, and extending seeds with factories to generate related data (profiles, challenges) for development while avoiding production issues.

#18 | Database Migrations - AdonisJS 7
The video explains database migrations in AdonisJS/Lucid, showing how migrations act as versioned, orderly changes to a project's database schema with up and down methods for applying and undoing changes. It covers how migrations are organized, how to create tables and foreign keys, how to handle batch execution and rollback, and how to manage related tables (roles, users, profiles, challenges) with proper naming conventions, relationships, and safeguards like SQL parameterization and development-time logging.

#19 | Models, Schema Classes, & Relationships - AdonisJS 7
The video explains how schema classes in AdonisJS Lucid ORM (version 7) map database tables to TypeScript, highlighting autogenerated schema/migration details and how properties are marked as mapped or not. It covers the relationship between schemas and models, the distinction between schemas (autogenerated layer) and models (code-facing representation), and how to define one-to-many, many-to-many, and other relationships using decorators. It also discusses model hooks, computed properties, and the practical workflow of creating models, migrations, and related extensions in the ACE CLI, with examples like user, role, profile, and challenge entities.

#16 | Middleware & Grouping Routes - AdonisJS 7
The video explains middleware in AdonisJS, showing how server-, router-, and named-middleware intercept requests, modify data, and pass control via the next function. It covers registering and moving middleware at different levels (server, router, named), using route groups and resources to apply middleware cleanly, logging request details, and even early-bail logic to stop a request before reaching a route handler.

#17 | Sessions & Flashing Messages - AdonisJS 7
The chapter explains session management and flash messages in AdonisJS. It covers creating and persisting a session, using session.put/get/forget, and implementing flash messages for one-time notifications, including how flash integrates with the layout and partials, and the concept of reflash for persisting messages across requests.

#15 | Route Names & Type-Safe Route Generation - AdonisJS 7
The video explains moving from hard-coded route paths to named routes in AdonisJS, leveraging the as method and type-safe route definitions. It covers how to reference routes by name, use the URL/route builders, handle route params (like IDs), and replace manual hrefs/forms with a reusable form component that builds URLs and handles CSRF, including updates for edits and redirects.

#12 | Components, Layouts, & Partials - AdonisJS 7
The video explains the difference between partials and components in Edge.js, showing how to extract reusable markup into partials or build components with isolated state and slots. It covers including partials, self-closing component tags, slot content and scopes, and techniques to pass data via props, injected state, and slot scopes to create clean, reusable UI structures.

#14 | Validation & Flash Storage - AdonisJS 7
The lesson covers implementing validation with VineJS in AdonisJS to defensively handle user input. It walks through creating a validator for a challenge, using request.validate for store/update, handling errors via flash messages, and rendering those errors on the form with helper components for a better UX.

#13 | Form Basics, Method Spoofing, & CSRF - AdonisJS 7
The chapter walks through extending a challenges system with create and edit functionality. It covers setting up pages, routes, and forms (with CSRF protection and proper HTTP verbs), handling in-memory data updates, and adding edit flows (including IDs, rendering defaults, and method spoofing) to support updating existing challenges.
Get daily AI recaps from
Adocasts in your inbox
Get AI-powered summaries delivered to your inbox. Save hours every week while staying fully informed.