Used https://github.com/openfun/joanie as boilerplate, ran a few transformations with ChapGPT and adapted models and endpoints to fit to my current vision of the project.
737 B
737 B
Api client TypeScript
The backend application can automatically create a TypeScript client to be used in frontend applications. It is used in the People front application itself.
This client is made with openapi-typescript-codegen and People's backend OpenAPI schema (available here if you have the backend running).
Requirements
We'll need the online OpenAPI schema generated by swagger. Therefore you will first need to install the backend application.
Install openApiClientJs
$ cd src/tsclient
$ yarn install
Generate the client
yarn generate:api:client:local <output_path_for_generated_client>