Generated Rust code
Find your Axum handlers, request types, business logic and SQLx queries in the generated project.
▶ Watch the demoOn this page
One directory per resource
src/
├── main.rs # Server startup
├── lib.rs # Shared state and route assembly
├── config.rs # Environment configuration
├── database.rs # SQL pool and migrations
├── error.rs # Error responses
├── patch.rs # Omitted / NULL / value
└── resources/
├── mod.rs # Registry managed by Miblo
└── user/
├── mod.rs # User routes
├── handlers.rs # HTTP extraction and responses
├── model.rs # Data structures
├── requests.rs # Request types and validation
├── service.rs # Business rules
└── repository.rs # SQL and transactionsSQL migrations live in migrations/. Additional routes live in src/resources/custom_routes/. The generated French README explains configuration, files and requests.
Where to write your logic
| Change | File |
|---|---|
| Business rule | service.rs |
| Request validation | requests.rs |
| SQL query | repository.rs |
| HTTP extraction and response | handlers.rs |
| Manually registered routes | src/lib.rs, outside managed registries |
A write follows handler → service → repository. Code is formatted with rustfmt and includes focused comments.
An independent project
cargo check
cargo test
cargo runThe API runs without Miblo. SQLx queries run at runtime: building does not need a live database or .sqlx directory. A lockfile pins dependencies.
The scaffold includes health, PATCH deserialization and request-validation tests in the current architecture. Add tests for your own business logic.
Files managed by Miblo
Commit miblo.yaml and .miblo/state.json alongside your source. They retain definitions, pinned templates and merge baselines.
src/resources/mod.rs and custom_routes/mod.rs are managed registries. Business code there can block additions. Customize resource files or route assembly in src/lib.rs.