yourOC: Private AI Companion Platform

Solo project, React 19 + Electron, local LLM inference
An AI companion app exploring character AI, conversational pacing, and proactive messaging. Local-first: all user data on the user's machine, inference runs locally, no cloud.

Stack
React 19, Vite 8, plain JS
Electron wrapper bundling llama.cpp as a child process for single-installer distribution
llama-server (llama.cpp) for local inference
SQLite via better-sqlite3, fully client-side

Architecture
Five strict layers, each only importing from below: foundation, stateful core, UI primitives, domain features, app shell. Cross-feature imports forbidden. Features communicate only through context.

Electron Wrapper
Bundles llama.cpp as a child process, picks a free port, polls until reachable, then opens the renderer. Renderer never assumes Electron. All Electron APIs read with optional chaining and degrade to PWA behavior when absent. One codebase, two distribution paths.
The frameless title bar syncs with the active character's theme: HSL accent converted to hex, symbol contrast picked by lightness, native Windows title bar overlay updated on every theme change.

Chat Engine
A custom useChat hook owns sessions, streaming, edit/refresh/rewind, and a two-tier memory system: keyword-gated extracted facts plus a rolling auto-summary. When messages fall out of the active context window, side calls run in the background to update memory without blocking the chat stream.

Per-Character Theming
Each character has their own accent color and visual identity propagating through the UI via CSS variables. Active theme is derived state from themes + activeCharacter.

Status
Active development. Designed for desktop distribution via Electron, mobile companion app planned (Capacitor).