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
npx pest-js-appYou'll be asked to configure your project:
- Project name (kebab-case, e.g.
my-api) - Description
- Author (pulled from your git config)
- Database ORM (Prisma, Drizzle, TypeORM, or None)
- Database provider (PostgreSQL, MySQL, or SQLite)
- Docker support
- Package manager (npm, pnpm, or yarn)
- Git init
- Install dependencies
Start the dev server
cd my-api
npm run devcd my-api
pnpm devcd my-api
yarn devYour API is now running at http://localhost:3000 with hot reload via tsx watch.
Build for production
npm run build
npm startpnpm build
pnpm startyarn build
yarn startDefault routes
Every project ships with these endpoints:
| Route | Method | Description |
|---|---|---|
/ | GET | Welcome message with API version and environment |
/health | GET | Health check (status, timestamp, uptime) |
/api/examples | GET | List all examples |
/api/examples | POST | Create an example (validated with Zod) |
/api/examples/:id | PUT | Update an example |
/api/examples/:id | DELETE | Delete an example |
Next steps
- Project Structure to understand what was generated
- Environment Variables to configure your app
- Testing to run and write tests
- Database if you selected an ORM
- Deployment when you're ready to ship