`runique start`
The runique start command is the entry point of the admin workflow.
Detecting the admin in `main.rs`
On startup, runique start reads src/main.rs and looks for the presence of .with_admin(:
// src/main.rs
RuniqueApp::builder(config)
.with_admin(|a| a.routes(admins::routes("/admin")))
// ...
Detection is done by simple string search in the source file.
It works even if the line is commented out (// .with_admin(...)).
| Detection result | Behaviour |
|---|---|
.with_admin( found | Daemon + cargo run launched |
| Absent | Info message, clean exit |
The path to
main.rsis configurable:runique start --main src/main.rs
What happens when `.with_admin(` is detected
runique start launches two processes simultaneously:
- The admin daemon — a separate thread that watches
src/admin.rsand regeneratessrc/admins/on every change cargo run— launches the application server (blocking until program exit)
runique start
├── daemon thread → watch(src/admin.rs) [immediate initial generation]
└── cargo run → HTTP server (blocking)
The daemon performs an initial generation on startup — there is no need to modify src/admin.rs for code to be produced.
Related sections
| Section | Description |
|---|---|
| Daemon & generation | Watcher, generated files |
Macro admin! | Declaring administrable resources |