Skip to content

Examples ​

Each example is a small, complete app that you can read top to bottom and run.

ExampleShowsStyle
basic-apiThe smallest app: routes, a service, errorsExplicit
modular-apiThe modular layout: feature modules, controllers, servicesDecorators
crud-apiFull CRUD with validation, paging, filters, a swappable repository and testsDecorators
auth-apiSign-in, guards, roles, a request-scoped current user, CORS and security headersExplicit
prisma-apiPrisma ORM 7 with SQLite: a managed client, relations, Prisma errors as HTTP errorsDecorators

The first four are part of the workspace and run in CI (pnpm examples). From the repository root:

sh
pnpm install
pnpm build
pnpm --filter @avijs/example-crud-api start

prisma-api is a standalone app that installs Avi.js from npm; see its README.

Released under the MIT License.