System Requirements
Before installing the AdonisJS Starter Kit, ensure your system meets these requirements:Node.js
Version 20 or higherCheck your version:
pnpm
Version 10.18.0 or higherCheck your version:
Docker
Docker Desktop or Docker EngineFor database services
Git
Latest versionFor version control
Installing Prerequisites
Install Node.js
Install pnpm
Install pnpm globally using npm:Or use alternative installation methods:Verify installation:
The starter kit specifies pnpm as the package manager in
package.json for optimal monorepo performance.Install Docker
Install Docker Desktop for your operating system:Verify installation:
- macOS
- Windows
- Linux
Creating a New Project
Scaffold from Template
Use the AdonisJS CLI to create a new project from the starter kit:The CLI will prompt you for:
The
-K flag specifies the GitHub repository to use as a template. This clones the starter kit with its complete structure.- Project name: Enter your application name (e.g.,
my-app) - Package manager: Select
pnpm(recommended) - Additional configuration: Follow prompts as needed
Environment Configuration
Create Environment File
Copy the example environment file:The
.env.example file includes all necessary configuration options with sensible defaults for development.Generate Application Key
Generate a cryptographically secure key for session encryption and other security features:This command generates a secure key and automatically updates the
APP_KEY variable in your .env file.Configure Database
The starter kit uses PostgreSQL. Configure your database connection:For production, use strong credentials and consider using connection pooling:
.env
These defaults match the Docker Compose configuration provided in the starter kit.
.env (Production)
Configure Email (Optional)
For local development, the starter kit uses Mailpit for email testing:For production, configure a real email service like Resend:
.env
Mailpit captures all outgoing emails during development. Access the interface at
http://localhost:8025 after starting Docker services.Configure Social Authentication (Optional)
The starter kit supports social authentication via Leave these blank for now if you don’t need social authentication immediately.
@adonisjs/ally. Configure providers as needed:To set up OAuth providers:
- Create OAuth applications in Google Cloud Console or GitHub Developer Settings
- Set callback URLs to
http://localhost:3333/auth/[provider]/callback - Copy client ID and secret to your
.envfile
Database Setup
Start Docker Services
The starter kit includes Docker Compose configuration for all required services:This starts three containers:Verify services are running:Expected output:
- PostgreSQL
- PgAdmin
- Mailpit
Container:
{PROJECT_NAME}_pgsql- Port: 5432
- Database: Configured via
DB_DATABASEin.env - Initialization: Auto-creates
adonis_appdatabase via init script
Run Migrations
Create database tables by running migrations:This executes migrations from the users module:
The
--filter web flag tells pnpm to run the command in the apps/web workspace.create_roles_table.ts- User roles (admin, user, etc.)create_users_table.ts- User accountscreate_reset_password_tokens_table.ts- Password recoverycreate_access_tokens_table.ts- API tokenscreate_rate_limits_table.ts- Rate limiting
Each feature module can have its own migrations in
app/{module}/database/migrations/.Seed Database
Populate the database with initial data:The default seeder (
apps/web/app/users/database/seeders/user_seeder.ts) creates:- Default user roles
- Admin and test user accounts
- Sample data for development
Verify Database
Access PgAdmin to verify your database setup:
- Open http://localhost:5050
- Login with:
- Email:
[email protected] - Password:
secret
- Email:
- Expand Servers → PostgreSQL → Databases → app
- Check Schemas → public → Tables
Installing Dependencies
Install All Dependencies
Install dependencies for all workspaces in the monorepo:This creates:
pnpm automatically handles the monorepo structure defined in
pnpm-workspace.yaml, installing dependencies for:- Root workspace
apps/web/packages/ui/packages/eslint-config/packages/typescript-config/
node_modules/in each workspacepnpm-lock.yamllockfile- Symlinks for workspace dependencies (e.g.,
@workspace/ui)
Building for Production
Build All Packages
Build all packages in the monorepo:TurboRepo orchestrates the build process:
- Builds shared packages (
@workspace/ui, configs) - Builds the web application
- Compiles TypeScript and bundles frontend assets
- Generates production-ready files in
apps/web/build/
TurboRepo caches build outputs for faster subsequent builds. The cache is stored in
node_modules/.cache/turbo.Development Workflow
Start Development Server
Launch the development server with hot module reloading:This starts:Open http://localhost:3333 to view your application.
- AdonisJS server with hot reloading (port 3333)
- Vite dev server for frontend assets (port 5173)
- File watchers for automatic reload on changes
The
hot-hook package enables hot reloading for controllers and middleware without full server restart.Adding UI Components
The starter kit uses ShadCN for UI components. Add components to your project:Components are installed to
packages/ui/src/components/ui/ and can be used across the entire application.Creating Feature Modules
The starter kit supports modular architecture using@adonisjs-community/modules:
Create a Module
Generate a new feature module:This creates:And adds an import alias to
package.json:Troubleshooting
Docker services won't start
Docker services won't start
Port conflicts:Check if ports are already in use:Stop conflicting services or change ports in
docker-compose.yaml.Docker daemon not running:Start Docker Desktop or the Docker daemon:Migration errors
Migration errors
Connection refused:Ensure PostgreSQL is running and credentials match:Migration already exists:Check migration status:Rollback if needed:
Module resolution errors
Module resolution errors
Cannot find module ‘#users/*’:Ensure imports are defined in Restart your development server after adding imports.TypeScript errors:Update
apps/web/package.json:tsconfig.json paths if needed:Build failures
Build failures
Turbo cache issues:Clear TurboRepo cache:Dependency issues:Remove all node_modules and reinstall:
Frontend not loading
Frontend not loading
Vite connection error:Ensure Assets not found:Check Vite config and ensure dev server is running:
VITE_API_URL in .env matches your server:Next Steps
Quick Start Guide
Follow the quick start guide for a streamlined setup
AdonisJS Documentation
Learn more about AdonisJS framework features
ShadCN Components
Browse available UI components
Inertia.js Guide
Understand Inertia.js for building SPAs