👷🏻 Auto-generate frontend client (#1320)
This commit is contained in:
@@ -4,7 +4,7 @@ The frontend is built with [Vite](https://vitejs.dev/), [React](https://reactjs.
|
||||
|
||||
## Frontend development
|
||||
|
||||
Before you begin, ensure that you have either the Node Version Manager (nvm) or Fast Node Manager (fnm) installed on your system.
|
||||
Before you begin, ensure that you have either the Node Version Manager (nvm) or Fast Node Manager (fnm) installed on your system.
|
||||
|
||||
* To install fnm follow the [official fnm guide](https://github.com/Schniz/fnm#installation). If you prefer nvm, you can install it using the [official nvm guide](https://github.com/nvm-sh/nvm#installing-and-updating).
|
||||
|
||||
@@ -27,7 +27,7 @@ nvm install
|
||||
|
||||
```bash
|
||||
# If using fnm
|
||||
fnm use
|
||||
fnm use
|
||||
|
||||
# If using nvm
|
||||
nvm use
|
||||
@@ -74,6 +74,19 @@ But it would be only to clean them up, leaving them won't really have any effect
|
||||
|
||||
## Generate Client
|
||||
|
||||
### Automatically
|
||||
|
||||
* Activate the backend virtual environment.
|
||||
* From the top level project directory, run the script:
|
||||
|
||||
```bash
|
||||
./scripts/generate-frontend-client.sh
|
||||
```
|
||||
|
||||
* Commit the changes.
|
||||
|
||||
### Manually
|
||||
|
||||
* Start the Docker Compose stack.
|
||||
|
||||
* Download the OpenAPI JSON file from `http://localhost/api/v1/openapi.json` and copy it to a new file `openapi.json` at the root of the `frontend` directory.
|
||||
|
Reference in New Issue
Block a user