Nad ·
Nad, pronounced [næd],is taken from the initals of Not a Document. This is not an API documentation tools! If what you need is API documentation, use the famous Swagger or something similar.
Simply put, Nad is a solution that bridges language boundaries. It extracts the data model and interface methods from the backend code and generates the corresponding frontend code.
Before using it, make sure the backend API is based on the standard Spring Web approach.
<dependency>
<groupId>cn.lalaframework</groupId>
<artifactId>nad-sdk</artifactId>
<version>1.0.1-RELEASE</version>
</dependency>
nad.enable=true
npm install @huolala-tech/nad-cli --save
After the backend provides the root URL of the API, the following commands can be used to generate the corresponding ts file based on the URL.
For example, if the backend service is started locally and the interface URL is http://localhost:8080
,
and you want to the generated file to be written to src/api.ts
, then execute the following command
npx nad http://localhost:8080 -o src/api.ts
You can use the IDE to open src/api.ts
to see the interface definition,
and then import the corresponding module in the business code to use it.
If the backend code has enough detailed annotaitons, the generated code is theoretically protected from all details.
Module | Type | Description |
---|---|---|
packages/builder | TS | The core of code builder |
packages/cli | TS | Command-Line tools |
packages/runtime | TS | Frontend network library |
packages/ui | React | UI for rendering api list |
packages/home | React | Intruduction website |
nad-java-core | Java | The core of the SDK |
nad-java-skd | Java | Java SDK |