summaryrefslogtreecommitdiff
path: root/README.md
blob: b63df65fd7fd96b9ac44f00a9d18225d1cdc7f6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Solstice

Minimalist Pomodoro timer desktop app. Stack: Tauri 2 + React 19 + TypeScript + Rust.

## Prereqs

- Node.js 20+
- Rust toolchain
- Tauri system deps for your OS

Install Tauri OS deps first if `npm run tauri dev` or `npm run tauri build` fails:

- https://v2.tauri.app/start/prerequisites/

## Clone And Install

```bash
git clone ssh://git@tylerhoang.xyz:46701/srv/git/solstice.git
cd solstice
npm install
```

## Run In Dev

Full desktop app with hot reload:

```bash
npm run tauri dev
```

What this does:

- starts Vite dev server on `http://localhost:1420`
- builds Rust side in dev mode
- opens native Tauri window

Frontend only in browser:

```bash
npm run dev
```

## Build

Frontend build + TypeScript check only:

```bash
npm run build
```

This writes static frontend files to `dist/`. It does **not** create runnable desktop app by itself.

Desktop app build:

```bash
npm run tauri build
```

This runs frontend build first, then builds packaged Tauri app.

## Run Built App

After `npm run tauri build`, look here:

- packaged outputs: `src-tauri/target/release/bundle/`
- raw release binary: `src-tauri/target/release/`

Typical local run on Linux:

```bash
./src-tauri/target/release/solstice
```

If exact filename differs on your OS, use installer/package inside `src-tauri/target/release/bundle/`.

## Audio Files

Ambient audio is user-supplied. Expected filenames:

- `rain.ogg`
- `cafe.ogg`
- `white_noise.ogg`

Lookup order:

1. app data audio dir
2. bundled `audio/` dir

### Easiest Dev Setup

Place OGG files in:

```text
src-tauri/audio/
```

This directory is also release source for bundled default sounds. `npm run tauri build` packages any expected `.ogg` files found there, and built app uses them when app-data audio is absent.

Example:

```bash
cp /path/to/rain.ogg src-tauri/audio/rain.ogg
cp /path/to/cafe.ogg src-tauri/audio/cafe.ogg
cp /path/to/white_noise.ogg src-tauri/audio/white_noise.ogg
```

Do not rename files. App looks for those exact names.

### App Data Audio Dir

On startup app creates `<app_data_dir>/audio` and prefers files there over bundled files.

Use this when you want custom audio without touching repo files. App state also persists under same app data dir as `data.json`.

## Useful Commands

```bash
npm run dev          # frontend only
npm run build        # TS check + frontend build
npm run tauri dev    # desktop app in dev mode
npm run tauri build  # desktop app release build
```

Rust side only:

```bash
cd src-tauri
cargo build
cargo test
```