Journal
A native macOS journal with a Metal-rendered mood selector and rich-text entries.
- Swift
- AppKit
- Metal
- SwiftUI
- Swift Charts
- SQLite
- FTS5
- TextKit
Log how you feel with an animated shape that morphs from a spiky star to a blooming flower, then write in a rich-text editor with lists, checklists, tables and photos. Entries are stored in SQLite with full-text search, and mood is charted over time.
Journal is a native macOS app written in AppKit, with SwiftUI where it fits. Logging a mood is meant to feel good in itself, so it's the centrepiece of the app.
The mood selector
The shape in the middle is drawn by a Metal fragment shader (MoodShaders.metal). It morphs
continuously as the slider moves, from a violet star at Very Unpleasant, through calm blue rings
at Neutral, to a gold flower at Very Pleasant. Its motion was measured frame by frame from
screen recordings of Apple's State of Mind logger:
- The coloured core stays still, and only changes when the mood does.
- Translucent glass layers are emitted from under the core every ~1.035 s. Each grows outwards on an ease-out curve over 2.9 s and fades out over its last 0.65 s, so about three are visible at once.
- For unpleasant moods, each layer starts a little out of line and keeps turning as it grows. The pleasant flowers don't rotate.
- When the mood changes, the core morphs first and the layers follow, the oldest lagging most.
The animation logic (MoodAnimator) has no Metal dependency, so it is unit tested on its own.
Writing
- A rich-text editor built on TextKit, with bulleted, dashed, numbered and checklist lists, tables and inline photos.
- Writing prompts matched to the mood you logged, to get past a blank page.
- Tags, pinning, an icon per entry, and search over titles, summaries and text.
- An optional daily reminder, through
UserNotifications. - Export any entry as PDF, or one entry or all of them as Markdown (with photos saved alongside).
Storage
Entries live in a SQLite database inside the app's sandbox. The rich text is stored as RTFD,
with a plain-text copy kept in an FTS5 full-text index by triggers. The schema is versioned
with PRAGMA user_version migrations. Edits mark an entry as dirty and are saved after a short
debounce, so typing doesn't write to disk on every keystroke.