Section 2 of 25
SLAT on one page
Contents
app ──► core ──► store ──► kit
│ └────► drivers ─► kit
└─ only app knows tauri only drivers/src/platform/ knows the operating system
core/<slice>/ model.rs logic.rs store.rs service.rs actor/ mod.rs
app/<slice>/ commands.rs dto.rs events.rs mod.rs
Query: UI ─invoke─► commands ─► service ─► store ─► DTO ─► UI
Command: UI ─invoke─► commands ─► service | Handle ─► (actor: Msg ─► update ─► Effect) ─► store/drivers
Event: actor/service ─► Snapshot | Event ─► app/events ─emit─► front-end store
Six sentences to remember:
- Only the
appcrate knows Tauri. Everything else compiles and is tested without a window. - A feature lives in one slice, and a slice has fixed files. Looking for chat? It is in
core/chat/andapp/chat/. - A Tauri command has at most 10 lines: deserialize, call one function of the slice, map the result to a DTO.
- Long-lived state has one owner: an actor. No
Mutex<Option<…>>orAtomicBoolin the application state, nostaticwith state inside slices. - Dependencies point down. A lower tier never imports a higher one, and the compiler enforces it.
- Only
drivers/src/platform/knows the operating system. The rest asks for concepts (process group, secret, data folder), never for system calls.