Files
formulation/docs/local-application.md
T

1.3 KiB

Local recipe application

The local application uses SQLite as its canonical data store. YAML remains a portable import/export format, but normal application saves do not modify it. Derived nutrition and cost are still calculated rather than stored.

Create the initial database from the current portable dataset with Node 22 or newer, then run the site and application:

npm run db:reset
npm run dev:site
npm run dev:app

npm run site:project writes generated/site-projection.json. Site development, checks, and builds run it automatically. Successful application edits refresh the same file, allowing the local Astro site to hot-reload database changes while remaining read-only.

The database is written to var/recipe-book.sqlite and is intentionally ignored by Git. migrations/001_initial.sql defines the complete relational schema. The application does not support upgrading databases from older schemas: rebuild from portable data with npm run db:reset. Recipe edits are transactional and a private save token prevents stale browser tabs from overwriting newer changes. There is no recipe revision history.

npm run db:import:yaml and npm run db:reset both replace the database from portable data and are intended for initial setup or an explicit restore.