---
name: Storage file paths
type: architecture-map-page
slice: 05-core-storage-hotkey-build
last_verified: 2026/05/09
---

# Storage file paths

> **Where you are:** [Architecture map](../README.md) → [Core, Storage, Hotkey, Build](README.md) → Storage file paths

**Plain English summary.** Thin re-export layer. `lumotia-storage::file_storage` proxies the `lumotia-core::paths::AppPaths` accessors so callers that already depend on `lumotia-storage` do not need to add an explicit `lumotia-core` import to reach the database path.

## At a glance

- File: `crates/storage/src/file_storage.rs` (28 LOC).
- External deps: standard library only. Forwards into `lumotia_core::paths`.
- Public surface: `app_data_dir`, `database_path`, `recordings_dir`, `crashes_dir`, `logs_dir`. Re-exported from `crates/storage/src/lib.rs:23`.
- Consumers: slice 2 startup; the diagnostic-report bundler; the live-session recorder writing audio to `recordings_dir`.

## What's in here

Every function is a one-liner forwarding into the core path API:

```rust
pub fn app_data_dir() -> PathBuf {
    lumotia_core::paths::app_paths().app_data_dir()
}
pub fn database_path() -> PathBuf {
    lumotia_core::paths::app_paths().database_path()
}
pub fn recordings_dir() -> PathBuf {
    lumotia_core::paths::app_paths().recordings_dir()
}
pub fn crashes_dir() -> PathBuf {
    lumotia_core::paths::app_paths().crashes_dir()
}
pub fn logs_dir() -> PathBuf {
    lumotia_core::paths::app_paths().logs_dir()
}
```

## Notes per directory

- **`database_path`** — `<app_data>/lumotia.db`. Where `lumotia_storage::init` creates / opens the SQLite database. Absent on first run; created with `create_if_missing(true)`.
- **`recordings_dir`** — `<app_data>/recordings/`. Audio captures live here. The transcription command (slice 2) writes WAV files; their relative path is stamped onto `transcripts.audio_path`.
- **`crashes_dir`** — `<app_data>/crashes/`. The Rust panic hook writes `<unix-ts>-<short-id>.crash` files here. Read by the diagnostic-report bundler in Settings → About.
- **`logs_dir`** — `<app_data>/logs/`. Rolling log file (`lumotia.log`, rotated `lumotia.log.1`, etc). The `tracing-subscriber` set up in slice 2 startup (`src-tauri/src/lib.rs`) writes here.

The model directories (`models_dir`, `speech_model_dir`, `llm_models_dir`) are **not re-exported here**. Callers reach them directly via `lumotia_core::paths::AppPaths` — those calls live in slices 3 (speech models) and 4 (LLM models).

## Watch-outs

- **No directory-creation side effects.** These functions return paths only. Callers that need the directory to exist are responsible for `std::fs::create_dir_all`. The storage `init` function does this for the database parent (`crates/storage/src/database.rs:10`); other consumers should follow.
- **Repeated calls re-resolve env vars.** Each invocation rebuilds `AppPaths` from scratch. Cheap, but noisy. Slice 2 caches a `OnceLock<AppPaths>` for the app lifetime.

## See also

- [Core app paths](core-paths.md) — the underlying `AppPaths` type.
- [Storage overview](storage-overview.md)
