🚧 AvleonJs is in active development and not ready for production use.

Installation

Avleon installation

Avleon requires Node.js 20 or newer.

Using Cli

If you already installed @avleon/cli globally then run the following command:

avleon new myapi

else you can install using npx:

npm
pnpm
yarn
npx @avleon/cli new myapi

The CLI asks which package manager to use and which features to include — OpenAPI docs, CORS, TypeORM, Knex and Scalar UI — then scaffolds the project and installs its dependencies.

cd myapi
npm run start:dev

The app starts on http://localhost:4000, and with OpenAPI enabled the docs are served at /docs.

What you get

myapi/
├── src/
│   ├── controllers/     # Route controllers
│   ├── services/        # Business logic
│   ├── config/          # App configuration
│   ├── app.ts           # App setup
│   └── serve.ts         # Entry point
├── test/
├── tsconfig.json
└── package.json
ScriptDescription
start:devStart the dev server with hot reload
buildCompile TypeScript to JavaScript
startStart the production server
testRun unit tests

Manual

Go to your desired project directory and run the following commands:

Bash
Powershell
mkdir myapi && cd myapi &&  mkdir src
npm
pnpm
yarn
npm init -y
npm i @avleon/core
npm i --save-dev typescript @types/node
npx tsc --init

class-validator, class-transformer and reflect-metadata come with @avleon/core, so you do not need to install them separately.

Ensure experimentalDecorators and emitDecoratorMetadata are enabled in tsconfig.json — Avleon's decorators do not work without them.

tsconfig.json
    // "jsx": "preserve",  
    "experimentalDecorators": true,               
    "emitDecoratorMetadata": true,               
    // "jsxFactory": "",

Then add a minimal entry point:

src/app.ts
import { Avleon } from '@avleon/core';

const app = Avleon.createApplication();

app.mapGet('/', () => 'Welcome to Avleon.');

app.run();

You can still use the CLI's generators and dev server in a manually created project by installing it locally:

npm i -D @avleon/cli
npx avleon serve

Optional dependencies

Install these only for the features you use:

FeaturePackage
TypeORMtypeorm + a driver (pg, mysql2, sqlite3, …)
Knexknex + a driver
Queuesbullmq, ioredis
Websocketssocket.io
Kafka broadcastingkafkajs
Image handlingsharp