Skip to content

ntfnd/secr

Repository files navigation

Daynote (gpui-base-template)

Native desktop daily-notes app built with GPUI and gpui-component. Use it as a starter template or as the Daynote app itself.

Binary: Daynote · Crate: gpui-base-template

Features

  • Sidebar navigation with calendar (Daily, Notes, Settings, About)
  • Markdown daily note editor with live preview and formatting toolbar
  • Notes list with search, date-range filter, and pagination (31 items per page)
  • Copy / export daily notes (Markdown or plain text) and export all notes as ZIP
  • Encrypted at rest — notes and images stored with AES-256-GCM; master key in OS secure store
  • Light / dark theme and English / Indonesian locale
  • Privacy policy in About (EN / ID)
  • macOS-native sidebar materials (light mode)
  • Release bundles for macOS, Linux, and Windows (~8 MB release .app on macOS)

Prerequisites

  • Rust (stable toolchain)
  • macOS for native .app bundling (Linux/Windows builds supported via cross-compile or host)

Optional:

  • cargo-watch — used by make dev for auto-rebuild
  • python3 — guard/loop spacing formatter (scripts/format-rust-guard-spacing.py)

Quick start

cargo build
cargo run

Or with Make:

make run          # debug binary on host OS
make dev          # watch + rebuild + restart
make build-release
make bundle       # release bundle for host OS
make bundle-macos # dist/Daynote.app

Run make help for all targets (per-OS build, bundle, archive, dev).

Project layout

src/
  router/                 # Thin dispatch
  layouts/default/        # App shell (sidebar, titlebar, shared state)
  components/
    pages/                # Screens: notes, daily_note, settings, about
    atoms/ molecules/ organisms/
  constant/{domain}/{name}/   # Enums & IDs
  i18n/{page}/                # Typed i18n keys
  toolkit/                    # Locale, theme, vault, daily note, export, preview
  style/                      # Theme tokens, materials, icon sizing
assets/icons/                 # App-local SVG icons
content/locales/app.yml       # UI copy (en, id)
scripts/                      # Bundle scripts per OS
packaging/                    # Shared bundle metadata

Each page follows view + action + style:

File Role
view.rs Markup only — calls action getters/handlers
action.rs Labels, flags, event handlers
style.rs Layout constants (spacing, widths)

Data & preferences

App data directory:

OS Path
macOS / Linux ~/.daynote/
Windows %USERPROFILE%\.daynote\
Path Contents
notes/ Daily note files (YYYY-MM-DD.md) — encrypted on disk
images/ Embedded images per date — encrypted on disk
locale Language preference (plain text)

Notes are not readable outside the app as plain Markdown or image files. Daynote decrypts them in memory when you edit, preview, or export.

Master key storage (cross-platform):

OS Secure store
macOS Keychain
Windows Credential Manager
Linux Secret Service (e.g. GNOME Keyring, KWallet via D-Bus)

Export (single note or all notes) writes decrypted Markdown, text, or ZIP files to a folder you choose. See About → Privacy Policy for full details (English / Indonesian).

Legacy plaintext notes from older builds are migrated to encrypted storage automatically on startup or first read.

Development

# After structural changes
cargo build

# Guard / loop spacing
python3 scripts/format-rust-guard-spacing.py --check
python3 scripts/format-rust-guard-spacing.py

# GPUI nested-entity-update guard (also runs in pre-commit when hooks are installed)
python3 scripts/check-gpui-render-updates.py

# One-time: enable repo git hooks (pre-commit)
./scripts/install-githooks.sh

When changing storage, encryption, or export behavior, update content/locales/app.yml (about.privacy_body) and AGENTS.md (Encrypted storage section).

Release profile uses size-optimized settings (opt-level = "z", LTO, strip) — see Cargo.toml.

CI / releases

GitHub Actions workflows in .github/workflows/:

Workflow Trigger Output
CI Push / PR to main Release build on macOS, Linux, Windows + GPUI render guard + guard-spacing check
Release Push tag v* (e.g. v1.0.0) GitHub Release with platform archives

Release archives

Platform Artifact
macOS dist/Daynote-macos-{aarch64|x86_64}.zip (.app bundle)
Linux dist/Daynote-linux-x86_64.tar.gz
Windows dist/Daynote-windows-x86_64.zip

Create a release:

git tag v1.0.0
git push origin v1.0.0

Local packaging (same scripts as CI):

./scripts/ci/build-release-artifact.sh macos
./scripts/ci/build-release-artifact.sh linux
./scripts/ci/build-release-artifact.sh windows

Documentation

Document Purpose
ARCHITECTURE.md Layer model, conventions, porting guide
AGENTS.md Contributor & agent rules (spacing, action.rs, i18n)

Related links

About

Secure sign file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors