Installation
Install MiiaJS and a server adapter for your runtime.
Scaffold with CLI (recommended)
The fastest way to start a new project is with the @miiajs/cli:
npx @miiajs/cli new my-app
cd my-app
The CLI will prompt you to choose a runtime (Bun, Deno, or Node.js), generate the project structure, install dependencies, and configure TypeScript — all in one step. Then run:
npm run dev
If you prefer to set things up manually, follow the steps below.
Manual setup
Core package
npm install @miiajs/core
yarn add @miiajs/core
pnpm add @miiajs/core
bun add @miiajs/core
Server adapters
MiiaJS exposes a standard fetch handler. Choose a server adapter for your runtime:
Bun & Deno
No additional package needed. app.listen() auto-detects the runtime.
Node.js
npm install @miiajs/node-server
uWebSockets.js
npm install @miiajs/uws-server
TypeScript configuration
MiiaJS requires ES2024 target for TC39 decorator support:
{
"compilerOptions": {
"target": "ES2024",
"module": "nodenext",
"moduleResolution": "nodenext",
"verbatimModuleSyntax": true
}
}
Optional packages
| Package | Install |
|---|---|
@miiajs/auth | Authentication with JWT and local strategies |
@miiajs/swagger | OpenAPI 3.1 spec and Swagger UI |
@miiajs/drizzle | Drizzle ORM integration |
@miiajs/papr | MongoDB integration via Papr |