Getting Started

Create your first PEST.js project in under a minute.

Prerequisites

  • Node.js 18 or higher
  • npm, pnpm, or yarn

Create a project

Run the CLI

Terminal
npx pest-js-app

You'll be asked to configure your project:

  1. Project name (kebab-case, e.g. my-api)
  2. Description
  3. Author (pulled from your git config)
  4. Database ORM (Prisma, Drizzle, TypeORM, or None)
  5. Database provider (PostgreSQL, MySQL, or SQLite)
  6. Docker support
  7. Package manager (npm, pnpm, or yarn)
  8. Git init
  9. Install dependencies

Start the dev server

Terminal
cd my-api
npm run dev
Terminal
cd my-api
pnpm dev
Terminal
cd my-api
yarn dev

Your API is now running at http://localhost:3000 with hot reload via tsx watch.

Build for production

Terminal
npm run build
npm start
Terminal
pnpm build
pnpm start
Terminal
yarn build
yarn start

Default routes

Every project ships with these endpoints:

RouteMethodDescription
/GETWelcome message with API version and environment
/healthGETHealth check (status, timestamp, uptime)
/api/examplesGETList all examples
/api/examplesPOSTCreate an example (validated with Zod)
/api/examples/:idPUTUpdate an example
/api/examples/:idDELETEDelete an example

Next steps