Runique Admin

`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 resultBehaviour
.with_admin( foundDaemon + cargo run launched
AbsentInfo message, clean exit

The path to main.rs is configurable: runique start --main src/main.rs


What happens when `.with_admin(` is detected

runique start launches two processes simultaneously:

  1. The admin daemon β€” a separate thread that watches src/admin.rs and regenerates src/admins/ on every change
  2. 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.


SectionDescription
Daemon & generationWatcher, generated files
Macro admin!Declaring administrable resources