This is a monorepo containing a frontend project demonstrating an automated OpenAPI workflow.
Structure:
- Frontend: Consumer of the API, dependant on the mocking server and auto-generated sdk
- Mock: Scripts to run an automated API mocking server, based on Prism, dependant on the OpenAPI doc.
- OpenAPI: OpenAPI specification for the API + OpenAPI linting based on Spectral and a documentation generation based on Elements
- SDK: SDK for the API, generated through openapi-typescript-codegen OpenAPI doc.
npm ci
By running the following command, the system will first build the SDK, based on the /openapi/petstore.yml
OpenAPI document, then, in parallel, start the mock server on port 4010
, the frontend on port 3000
and the OpenAPI documentation website on port 8080
.
npm run dev
Open the documentation on http://localhost:8080 by running,
npm run docs
Lint the OpenAPI document using Spectral by running the following command, to enforce our chosen OpenAPI style guide.
npm run lint