Development
Build and Run
Production Build
For the production build, debug-flow
uses a cargo-based build flow. To build the backend application which bundles the frontend application, run
cargo build --release
The build.rs
script will automatically install the frontend dependencies, build the web-frontend application and bundle it with the backend application.
Run the application from ./target/release/debug-flow
.
Development Build
For development purposes the frontend is served from a vite
development server to benefit from features such as hot module reloading.
Install frontend dependencies
Before starting development, install the frontend dependencies using
npm clean-install
Run the Development Server
Run the frontend development server by executing
npm run dev
In the development build of the backend application, the requests for the frontend are proxied to the development server. To run the backend, run
cargo run -- serve
This will serve the application on port 8000. See cargo run -- serve --help
for more command line flags.
API
The API is defined in the backend application and documented through utoipa
. This generates an OpenAPI schema to use with the server.
Dump the OpenAPI schema
To dump the OpenAPI schema to JSON run
cargo run --bin dump-openapi-schema
For more options for dumping the schema, run cargo run --bin dump-openapi-schema -- --help
.
Recreate OpenAPI types for Frontend
The Frontend re-uses the generated OpenAPI schema to generate type definitions for the API and an API client. Re-create the API types for the Frontend using:
npm run api:create