Runique Admin

Daemon & code generation

Generated structure

src/admins/
  ├── README.md       ← warning: do not edit manually
  ├── mod.rs          ← exposes `routes` and `admin_state`
  └── admin_panel.rs  ← main file: DynForm wrappers + admin_register()

admin_panel.rs

Contains for each resource declared in admin!:

  • A DynForm wrapper around the concrete Runique form
  • The closures list_fn, get_fn, create_fn, update_fn, delete_fn, count_fn
  • The admin_register() function that builds the HashMap<String, ResourceEntry> loaded at boot

mod.rs

Re-exports routes and admin_state from admin_panel.


The trade-off: automatic overwriting

runique start deletes and fully regenerates src/admins/ on every change to src/admin.rs.

Any manual modifications inside this folder will be lost on the next regeneration.

When to switch to `cargo run`

If manual changes to the generated code are needed (specific business logic, custom handler), you must stop runique start and switch to a standard workflow:

cargo run

In this mode, src/admins/ is no longer watched or overwritten. Changes persist.

The README.md generated inside src/admins/ reminds you of this behaviour directly in the repository.

SectionDescription
CLIHow runique start works
Macro admin!Declaring administrable resources