Development
Build and Run
Production Build
When running in production mode, the debug-flow application bundles the static files generated as part of the frontend build in the binary and serves them.
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 --releaseThe 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-installRun the Development Server
Run the frontend development server by executing
npm run devIn the development build of the backend application, the requests for the frontend are proxied to the development server. To run the backend, run
cargo runThis will serve the application on port 8000. See cargo run -- --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-schemaFor 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:createDocumentation
The documentation is built using VitePress. The development server for the documentation can be started using
npm run docs:devThe release version of the documentation is build using
npm run docs:build