Core System API defined using TypeSpec
flowchart TD
A[pnpm clean<br/>Clean Generated Files]
B[Write TypeSpec]
C[pnpm format<br/>Prettier Formatting]
D[compile:openapi<br/>Generate OpenAPI]
E[patch-openapi.js<br/>Fix Type / Description]
F[Official OpenAPI Spec]
%% From TypeSpec to OpenAPI
A --> B --> C --> D --> E --> F
%% Mock
F --> M[Prism Mock Server<br/>pnpm start:mock]
%% Docs generation from OpenAPI
F --> S[Swagger UI]
F --> T[Scala]
F --> Y[Yaak Collection<br/>build:yaak]
F --> R[Redocly<br/>build:redocly]
%% SDK generation
F --> O[orval Generate SDK<br/>build:sdk]
O --> CSDK[pnpm compile:sdk]
CSDK --> NPM[Publish to npm]
NPM --> FE[Frontend Repo<br/>Install Usage]
%% SDK docs
O --> TDOC[TypeDoc<br/>SDK Documentation build:typedoc]
%% Deploy
R --> GH[GitHub Pages]
S --> GH
T --> GH
TDOC --> GH
Please install Node.js and pnpm first.
pnpm installation:
npm install --global corepack@latest
corepack enable pnpmpnpm i --devIf you wanna build website and sdk, use
pnpm iinstead.
pnpm formatFormats all TypeSpec (.tsp) files in the project.
pnpm compile:openapiCompiles TypeSpec files to OpenAPI specification and applies patches. Output will be in tsp-output/schema/openapi.1.0.0.yaml.
pnpm build:yaakGenerates Yaak API collection from the OpenAPI specification.
Note: You must run
pnpm compile:openapibefore building Yaak collection.
pnpm build:sdkGenerates the SDK client code from the OpenAPI specification using Orval.
Note: You must run
pnpm compile:openapiand install withpnpm ibefore building the SDK.
pnpm compile:sdkCompiles the SDK TypeScript package (@nycu-sdc/core-system-sdk).
Note: You must run
pnpm build:sdkand install withpnpm ibefore compiling the SDK package.
To build the SDK from scratch, run these commands in order:
pnpm compile:openapi
pnpm build:sdk
pnpm compile:sdkpnpm start:mockStarts a Prism mock server on http://0.0.0.0:4010 using the compiled OpenAPI specification.
Note: You must run
pnpm compile:openapiand install withpnpm ibefore starting the mock server.
pnpm build:redoclyBuilds static HTML documentation using Redocly. Output will be in website/index.html.
Note: You must run
pnpm compile:openapiand install withpnpm ibefore building documentation.
pnpm build:typedocGenerates TypeDoc documentation for the SDK. Output will be in website/sdk.
Note: You must run
pnpm compile:sdkand install withpnpm ibefore building TypeDoc.
pnpm cleanRemoves all generated files including tsp-output, yaak, and SDK generated code.
The compiled OpenAPI specification will be in tsp-output/schema/openapi.1.0.0.yaml.
- Scalar - Open website/index.html in your browser
- Swagger UI - Open website/swagger.html in your browser
- Redoc - Open website/sdk/index.html in your browser
- Prism Mock Server - Run
pnpm start:mockand visit http://localhost:4010 - Yaak - Import the
yaakfolder into Yaak
The SDK is published as @nycu-sdc/core-system-sdk and located in packages/sdk.
git checkout main
git pull
git tag v1.0.0
git push origin v1.0.0Publishing is handled automatically via CI/CD when a new tag is pushed.