Skip to content

Developers

OpenCode GH-4 Candidate edited this page Dec 2, 2026 · 4 revisions

Developers

The Kitchen Codex is an MIT-licensed, local-first application. This page is the map for contributors: how the repository is organized, how to build and test it, and which boundaries must not be weakened.

Repository

https://github.com/kryptek2000/The-Kitchen-Codex

Item Value
License MIT
Package manager Bun (bun.lock is canonical)
Frontend React 19 + Vite + TypeScript
Backend Express 5 + TypeScript
Desktop Electron shell in desktop/
Tests Vitest
Published release v0.9.0
Next flagship objective v1.0.0 — Signature Edition, planned, no date

Architecture at a glance

React UI
  -> platform-neutral application layer
  -> server API (Express 5)
  -> AI provider abstraction / USDA catalog / Vault adapters

Electron shell
  -> loopback server
  -> context-isolated preload
  -> descriptor-relative native Vault helper

Important boundaries:

  • Obsidian is optional. The product is standalone; do not assume an Obsidian install.
  • Markdown and YAML are the source of truth. Vault writes go through the canonical parse/serialize path.
  • The Canonical Schema boundary stays active. Recipe data is normalized at the boundary rather than passed around as unvalidated shapes.
  • AI is provider-neutral. The Gemini SDK is confined to infrastructure; live consumers use the server/ai/* abstraction.
  • Provider keys are server-side or in protected native storage. Never expose them to the renderer or write them into a Vault.
  • SSRF protection is mandatory. Web import and image fetch paths use DNS pinning, private/loopback/metadata blocking and redirect validation.
  • Explicit saves by default. Normal recipe and image writes are explicit. Nutrition is manual by default; the scoped standing nutrition authorization is the only standing write exception. When enabled, eligible analyzed nutrition can be applied and persisted without a separate per-result Apply or Save, subject to validation, unresolved-choice, conflict, stale-state, revocation and do-not-save constraints. In the current development build, Advanced Nutrition can operate on a shared working copy, so pending ingredient edits may accompany the standing save. The write is not filtered to nutrition fields.
  • Zero fabrication. Do not invent servings, times, nutrition, images, ingredients or instructions when source data is absent.

Setup

git clone https://github.com/kryptek2000/The-Kitchen-Codex.git
cd The-Kitchen-Codex
bun install --frozen-lockfile
cp .env.example .env    # optional
bun run dev

Open http://localhost:3000.

Core commands

bun run lint                 # TypeScript typecheck
bun run test                 # full Vitest suite
bun run build                # client + production server
bun run start                # run the production server after build
bun run test:prod            # production serving verification
bun run build:plugin         # experimental Obsidian plugin shell

Focused development commands:

bun run test:focus:shiso
bun run test:focus:nutrition
bun run test:focus:providers
bun run test:focus:images
bun run test:focus:vault

Focused commands are shortcuts. Comprehensive CI remains authoritative.

Native desktop build

Native packaging is a development workflow, not a public installer. The verified CI-equivalent prerequisites and full setup sequence are in Getting Started. The important runtime rule is that Bun's explicit trusted-dependency list does not include Electron, so the Electron binary may be absent after install. Do not broaden that list or change package.json; install the pinned runtime explicitly when it is missing.

Packaging success does not prove a sandboxed launch. On Ubuntu 24.04, confirm the administrator-managed sandbox prerequisite in Launch with the sandbox intact. If the required sandbox configuration is unavailable, stop; do not launch with --no-sandbox or run the application as root.

bun install --frozen-lockfile

if [ ! -x node_modules/electron/dist/electron ]; then
  node node_modules/electron/install.js
fi
test -x node_modules/electron/dist/electron

bun run build
node scripts/build-desktop-native.mjs
test -f desktop/native/tkc_vault.node
npm run desktop:package
./desktop-dist/TheKitchenCodex-linux-x64/TheKitchenCodex

The native build requires a Node executable (Node 22 is the verified CI baseline), N-API headers containing node_api.h, Linux headers containing openat2.h, a C++17 compiler, and the Electron Linux runtime libraries. See desktop/README.md for the security model.

Tests and CI

The repository uses Vitest and a grouped CI plan covering fast tests, heavy nutrition/SHISO tests, security tests and native/desktop tests.

CI workflows include:

  • Build — typecheck, tests and production build.
  • Linux Desktop — native packaging verification.
  • CodeQL Analysis Gate — fail-closed static analysis verification on qualifying pull requests.

Before submitting a change:

bun run lint
bun run test
bun run build
git diff --check

Add focused regression tests for behavior changes. Security-sensitive changes should include explicit negative cases, not only the happy path.

Documentation map

Start with the repository's canonical index:

Architecture and status records:

Historical phase documents are retained for audit evidence. Their status preambles identify them as records, not current release commitments.

Contributing

  • Check existing issues and pull requests first.
  • Open an issue for larger changes before implementing.
  • Keep one pull request focused on one coherent change.
  • Preserve user data, local-first storage and the standalone product.
  • Do not add a competing lockfile.
  • Do not weaken security boundaries to make a test pass.

See CONTRIBUTING.md for the full workflow and issue templates.

Security

Do not report vulnerabilities in a public issue. Use the private advisory flow:

https://github.com/kryptek2000/The-Kitchen-Codex/security/advisories/new

Include the affected version or commit, runtime mode, operating system, reproduction steps and impact. Do not include real credentials, private recipes or Vault contents.

Release authority

Implementation is led by the development team, the Principal Architect reviews the design, Luna provides independent audit, and the Product Owner holds final product and release authority.

Current main is not a release. The published release is v0.9.0. v1.0.0 is a planned objective, not an announced date or downloadable installer.


Related: Roadmap · Kitchen Intelligence · FAQ

Clone this wiki locally