Learn ADONISJS with Real Code Examples
Updated Nov 27, 2025
Installation Setup
Install Node.js and npm/yarn
Create a new project: `npm init adonis-ts-app my-app`
Install dependencies via `npm install`
Configure `.env` for environment variables
Start development server using `node ace serve --watch`
Environment Setup
Install Node.js and npm/yarn
Install AdonisJS CLI globally
Create new AdonisJS project
Configure database and environment
Start development server and verify
Config Files
.env - environment variables
config/app.ts - application config
config/database.ts - database connections
start/routes.ts - route definitions
app/ - controllers, models, middleware
Cli Commands
node ace new my-app - create project
node ace serve --watch - run dev server
node ace make:controller - create controller
node ace make:model - create model
node ace migration:run - run migrations
Internationalization
Use third-party i18n libraries
UTF-8 encoding supported by default
Locale management handled in controllers
Messages externalized for translation
Integrate with community i18n plugins if needed
Accessibility
Follow web standards in Edge templates
ARIA attributes can be included in templates
Supports CORS for cross-origin requests
CSRF protection for forms
Validation messages accessible to users
Ui Styling
Views rendered via Edge template engine
Supports HTML, CSS, and JS assets
Integrates with frontend frameworks (React/Vue/Angular)
Static files served via public directory
Responsive and accessible HTML templates
State Management
Stateless HTTP requests by default
Sessions managed via server-side storage
Cache layer for temporary data
WebSocket channels manage real-time state
Queues for async task processing
Data Management
Lucid ORM for relational databases
Migrations and seeds for schema and data
Validation and sanitization for input data
Relationships between models
External services integrated via HTTP or SDKs