Skip to content

API Generation

API generation reads a compiled manifest and produces REST API endpoints. Each entity in the manifest drives a set of CRUD routes.

Packages

text
@ikary/generator-nest : NestJS module, controller, and service generator (in progress)
text
ikary-manifest-fastapi : FastAPI route generator (planned)

What it generates

Given an entity in the manifest, the generator produces five endpoints per resource:

MethodPathAction
GET/resourceList with filtering and pagination
GET/resource/:idFetch a single record
POST/resourceCreate a record
PATCH/resource/:idUpdate a record
DELETE/resource/:idDelete a record

Role scopes from the manifest apply to each endpoint. A role with actions: [read] on an entity gets access to the GET endpoints only.

Routes follow the API Conventions.

Install

bash
pnpm add @ikary/generator-nest
PythonPython support for this section is coming soon.

Node.js: NestJS generator

The NestJS generator reads a compiled manifest and produces NestJS modules, controllers, and services. It is in active development.

typescript
// Usage will be documented as the package stabilises.
import { generateNestApp } from '@ikary/generator-nest';

Python: FastAPI generator

The FastAPI generator is planned. It will consume the same compiled manifest and produce FastAPI route definitions.