| 10 |
10 |
|
crates/
|
| 11 |
11 |
|
core/ # Domain models, business logic, repository traits
|
| 12 |
12 |
|
db-sqlite/ # SQLite repository implementations
|
| 13 |
|
- |
plugin-runtime/ # Rhai plugin system
|
| 14 |
13 |
|
src-tauri/
|
| 15 |
14 |
|
src/
|
| 16 |
15 |
|
main.rs # Tauri setup, command registration, background services
|
| 20 |
19 |
|
frontend/
|
| 21 |
20 |
|
js/ # JavaScript modules (IIFE pattern)
|
| 22 |
21 |
|
css/ # Styles (edit styles.css, never styles.min.css)
|
| 23 |
|
- |
build-css.sh # CSS minification script
|
|
22 |
+ |
build-css.js # CSS minification script (run by tauri.conf beforeBuildCommand)
|
| 24 |
23 |
|
tauri.conf.json # Tauri configuration
|
| 25 |
24 |
|
```
|
| 26 |
25 |
|
|
| 30 |
29 |
|
|-------|------|---------------|
|
| 31 |
30 |
|
| `core` | Models, validation, urgency, recurrence, repository traits | Nothing internal |
|
| 32 |
31 |
|
| `db-sqlite` | SQLite implementations of repository traits | `core` |
|
| 33 |
|
- |
| `plugin-runtime` | Rhai plugin system | `core` |
|
| 34 |
32 |
|
| `src-tauri` | Tauri app, commands, state | All crates |
|
| 35 |
33 |
|
|
| 36 |
34 |
|
**Strict rule:** Business logic lives in `core`. Repository implementations in `db-sqlite`. Commands in `src-tauri` are thin wrappers. JavaScript never duplicates logic that exists in Rust.
|
| 84 |
82 |
|
|
| 85 |
83 |
|
When adding new features, always ask: can this be computed once in Rust instead of repeatedly in JavaScript?
|
| 86 |
84 |
|
|
| 87 |
|
- |
## Plugin Style
|
| 88 |
|
- |
|
| 89 |
|
- |
Import plugins in `plugins/` follow the cross-project Rhai style guide. Run `_meta/scripts/lint-rhai.sh` to check formatting. Key points: 4-space indent, `snake_case` functions, `UPPER_CASE` constants, header comment block, host functions via `goingson::` namespace.
|
| 90 |
|
- |
|
| 91 |
85 |
|
## Tauri Commands
|
| 92 |
86 |
|
|
| 93 |
87 |
|
Commands are thin wrappers in `src-tauri/src/commands/`. They extract parameters, call repository methods, and map to response types:
|
| 237 |
231 |
|
## CSS Workflow
|
| 238 |
232 |
|
|
| 239 |
233 |
|
- **Edit:** `src-tauri/frontend/css/styles.css`
|
| 240 |
|
- |
- **Build:** Run `src-tauri/frontend/build-css.sh` to generate `styles.min.css`
|
|
234 |
+ |
- **Build:** Run `node src-tauri/frontend/build-css.js` to generate `styles.min.css` (Tauri runs this automatically via `beforeBuildCommand`)
|
| 241 |
235 |
|
- **Never** edit `styles.min.css` directly — it's auto-generated via clean-css-cli
|
| 242 |
236 |
|
- The HTML loads `styles.min.css`
|
| 243 |
237 |
|
|