Personal AI-native journal & life-tracker. Its core idea: an MCP server that lets any AI agent connect and read meaningful slices of your data — without flooding the agent's context window.
Work in progress, dogfooded daily. The MCP layer (the centerpiece) is now built; next is the read-time companion and charts.
You write free-text journal entries and track a few numeric metrics over time. A background LLM pipeline turns each entry into structure — a short summary, the people / projects / habits / events it mentions, and any numeric values stated in the text. Retrieval afterwards is then cheap, exact SQL, not a "magic search". An AI agent connects over MCP and gets a compact, navigable view of months of data instead of a wall of text.
- Intelligence at write time, not read time. The LLM extracts structure when an entry is saved; reading is plain SQL. The agent is the semantic layer — it reasons over a small, well-built index (summaries, per-entity digests), so there is no vector database and no context bloat.
- Index-first for AI. MCP tools return summaries + metadata (small, paginated responses); full text is a separate call. The briefing stays a constant size whether you have a month or five years of data.
- Exact numbers from SQL, not the LLM. Aggregations are computed by the database; the agent receives ready figures.
- Multi-tenancy from day one. Tenant = user; a
user_idfilter is mandatory on every query (enforced by a Nest guard), and tenant isolation is covered by tests. - Application-level encryption. Sensitive fields are encrypted with AES-256-GCM; the key lives in the server env, never in the database or backups. A single
EncryptionServiceis the only place that touches crypto. - English code, localized UI. All code is in English; UI strings come from locale dictionaries (
react-i18next).
- Language: TypeScript everywhere (strict mode).
- Backend: NestJS · Prisma · PostgreSQL 16.
- Frontend: React 19 · Vite · TanStack Query · Tailwind CSS + shadcn/ui.
- Auth: JWT access tokens, argon2 password hashing.
- Tests: Vitest (unit) · Supertest (API).
- MCP: official TypeScript SDK, Streamable HTTP transport, per-user Bearer (JWT) tokens.
- Tooling: pnpm workspaces · ESLint + Prettier · Docker Compose.
apps/api — NestJS backend (REST API + AI analysis + MCP server; worker next)
apps/web — React frontend
packages/shared — shared types & zod schemas (the extraction-JSON contract)
Prerequisites: Node 24, pnpm, Docker.
# 1. Start Postgres
docker compose up -d
# 2. Install dependencies
pnpm install
# 3. Environment — copy the example and fill in secrets
cp apps/api/.env.example apps/api/.env
# generate JWT_SECRET / ENCRYPTION_KEY with: openssl rand -hex 32
# 4. Database — sync the schema and seed dev data
# (development uses `prisma db push`; a baseline migration comes before deploy)
pnpm --filter @prism/api exec prisma db push
pnpm --filter @prism/api exec prisma db seed
# 5. Run everything (Postgres in Docker + API + web, one command)
pnpm dev # API → http://localhost:3000, web → http://localhost:5173Then sign in with a seeded dev account (see apps/api/prisma/seed.ts).
The full stack — Postgres, the API, and the web app behind Caddy — can run in Docker, the same shape as the future VPS deploy:
pnpm prod:up # docker compose --profile app up -d --build --wait
# open http://localhost:8080 (Caddy serves the SPA, proxies /api/* and /mcp)
pnpm prod:logs # follow logs
pnpm prod:down # stopNotes:
- It reuses the same
dbservice and volume as dev — same data, sameapps/api/.envsecrets (ENCRYPTION_KEYmust match or nothing decrypts). - AI analysis inside the container needs a
claudeCLI token: runclaude setup-tokenon the host once and put the result intoapps/api/.envasCLAUDE_CODE_OAUTH_TOKEN(macOS keeps the interactive login in the Keychain, which containers cannot reach). - Set
TZinapps/api/.envso nightly scheduled jobs run in your night, not UTC's.
pnpm --filter @prism/api testAPI tests boot the real app and run against a dedicated prism_test database — they assert the connected database name as a safety guard, so they never touch the dev/prod data.
- ✅ Backend foundation — schema, JWT auth + tenant guard, field-level encryption, CRUD for journal entries / entities / numeric metrics, per-account settings.
- ✅ Frontend — login, the day editor (two sides — pros / cons — + metric chips), journal, Context (people & topics), CBT cards, settings.
- ✅ AI analysis — entries are parsed into structure (summary, metrics, entities, intents) by Claude behind an
LlmRunnerport; interactive multi-round clarification; suggest-confirm for entities (never silently created); per-user "coach pack" tuning; entity@handletagging. - ✅ MCP server — per-user, read-mostly tools the analysis (and any external agent) can call: look up an entity profile, find entries mentioning it, fetch entries by date / range, and write back a learned fact to an entity's dossier. Streamable HTTP + Bearer JWT; every call audit-logged.
- ⏳ Next — the read-time companion (a coaching "message of the day") and the dashboard / charts.