prosolis 9576340391 Phase 14: bedtime nag + night mode (dark theme + falling stars)
Companion warmth:
- ENCOURAGEMENTS grown 5->10; new BEDTIME lines (warm/playful, zh-first)
- useCompanion heartbeat gains a bedtime branch (>=11pm, while actively
  writing) gated by a 30min cooldown; new 'bedtime' BubbleTone paces it

Night mode (auto at ~11pm, local clock):
- lib/night.ts centralizes isBedtime() + the window, shared with the nag
- useNightMode toggles a `petal-night` class on <html>; index.css re-points
  only the palette tokens, so every Tailwind color utility flips via var()
  with no component edits (600ms dusk fade; print stays white)
- PetalFall gains a `night` prop: chunky cartoon power stars (makeCartoonStar,
  5 candy colors) mixed ~70/30 with twinkle sparkles; each star spins at its
  own rate (~0.5-2.2 rad/s, random direction), falls straight down, shimmers

Verified: go vet/test, tsc, vitest 51/51, vite build; real-browser
screenshots/video (clock mocked to 23:30).

Claude-Session: https://claude.ai/code/session_016Yr6jELuRc7hyzYLccQKZd
2026-06-26 15:10:36 -07:00
2026-06-25 20:20:04 -07:00
2026-06-25 20:20:04 -07:00

🌸 Petal

A self-hosted, privacy-first writing editor with warm bubbly design, auto-save, and local-LLM grammar/ESL suggestions. See petal-spec.md for the full design spec and BUILD_PLAN.md for build progress.

Stack

Go + chi backend · SQLite (modernc, pure Go) · React + Vite + Tiptap + Tailwind v4 frontend · local vLLM/Ollama for AI suggestions. Single-binary deployment (frontend embedded via go:embed).

Local development

Two processes during development:

# 1. Backend (serves /api on :8080)
go run ./cmd/server

# 2. Frontend dev server (HMR on :5173, proxies /api → :8080)
cd web && npm install && npm run dev

Open http://localhost:5173 while developing.

Production build (single binary)

cd web && npm run build      # emits web/dist (embedded by the Go binary)
cd .. && go build -o petal ./cmd/server
./petal                      # serves UI + API on :8080

Configuration is via environment variables — copy .env.example to .env.

Status

Early build, multi-session. Auth (Authentik), Copyleaks plagiarism, and Docker/Traefik deployment are deferred — see BUILD_PLAN.md.

Description
Petal is a self-hosted, privacy-first writing editor for an ESL user. It replaces Grammarly with a warm, bubbly web app that combines Tiptap rich text editing, auto-save cloud storage, and periodic AI-powered grammar/ESL suggestions backed by a local vLLM inference endpoint.
Readme 14 MiB
Languages
TypeScript 54.8%
Go 39.8%
CSS 3.1%
Python 2%
Shell 0.2%
Other 0.1%