Skip to main content
Glama
Recetario
by igna-io
README.md
# Recetario

A small, private recipe book that gets better every time you cook. Collect a family recipe or something you found online, keep its sources, and leave kitchen notes about what worked and what to try next.

Recetario is a Next.js website and a five-tool MCP server backed by Supabase. Each household runs its own installation. Open-source code does not make anyone's cookbook public.

## Try the design

Use Node 24 (`nvm use` if you use nvm):

```sh
npm ci
npm run dev
```

Open [the fictional demo](http://127.0.0.1:3050/demo). No credentials, database, or model API key are needed. Demo writes are disabled; its sample recipes and people are fictional.

## Run your own local book

Install Docker and Node 24. With Docker running:

```sh
npm ci
npm run setup:local
cp members.example.json .private/members.json
```

Edit `.private/members.json` with the names and addresses you want to use, or keep the fictional examples for a local trial. Then provision those accounts and start the app:

```sh
node --env-file=.env.local scripts/provision-household.mjs --members-file=.private/members.json
npm run dev
```

Provisioning writes private single-use password setup links to `.private/household-setup.json`; open each link and choose a password of at least twelve characters. No email is sent. Start with the website or connect an agent that can reach your installation.

The local app runs on port **3050**, Supabase API on **56521**, and Postgres on **56522**. The project/container namespace is `recetario`. Setup generates its own ignored signing key and environment file, applies pending migrations, and preserves existing data on reruns. It refuses cloud-linked workspaces, cloud environment files, and conflicting settings instead of overwriting them. Do not copy another installation's `.env`, `.private`, or `supabase/.temp` directories.

The Supabase CLI and required service versions are pinned in the repository. Use the bundled CLI through `npm run supabase --`; a global CLI may behave differently. Setup can take several minutes on the first image download. It never resets a database or stops another project.

## Cook, annotate, refine

- The collection shows descriptions, clickable tags, and who added and last edited each recipe.
- A recipe's **Kitchen notes**, **Sources & inspiration**, and **History** open alongside it on landscape tablets and desktops, or in a sheet on smaller screens.
- Notes record the cooking date when known, the author, and the saved date. Adding a note does not alter the recipe or its last editor.
- Deliberate recipe edits create new versions. Earlier versions keep their original source text and citations.
- Recipes can combine several sources. Each has a stable ID, name, optional URL, explanation of its contribution, and optional saved original text.

Use **Insert reference** in the editor, or write `[Dough method][dough-source]` with a matching source ID. Source definitions are generated automatically. `[Successful batch](#note-NOTE_UUID)` opens a saved cooking note, including notes outside the first page. Notes retain their own source snapshots.

## Connect your agent

Deploy a reachable installation using the [hosting guide](docs/HOSTING.md). In ChatGPT, Claude, or another compatible MCP client:

1. Add your installation's `https://YOUR_APP_DOMAIN/api/mcp` URL.
2. Choose OAuth; leave optional client ID and client secret blank for automatic registration.
3. Sign in to your own cookbook account and approve read-only or read/write access.

Every member connects independently. Disconnecting a connection revokes that person's access for that client, including already-issued tokens. Anonymous client registration alone grants no cookbook access.

The tools are `search_recipes`, `get_recipe`, `save_recipe`, `add_cooking_note`, and `get_recipe_history`. The [MCP guide](docs/MCP.md) covers source snapshots, descriptions, pagination, and safe edits. Your chat agent extracts online or family material; the application does not fetch arbitrary source URLs, run OCR, or call a language model.

## Configuration

`.env.example` lists placeholders only. Setup writes local values to ignored `.env.local`; cloud administration belongs in an ignored `.private/instance.env` in a separate deployment checkout.

Runtime requires `NEXT_PUBLIC_SUPABASE_URL`, `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY`, and `APP_ORIGIN`. **Never add a Supabase admin/service-role key to Vercel runtime variables.** It is needed only for local setup/provisioning tools.

Optional settings:

| Setting | Default | Purpose |
| --- | --- | --- |
| `NEXT_PUBLIC_BOOK_NAME` | `Recetario` | Website and connector display name |
| `NEXT_PUBLIC_BOOK_MARK` | `R` | Short header mark; empty hides it |
| `NEXT_PUBLIC_BOOK_TIMEZONE` | `UTC` | Display timezone for timestamps; cooking dates remain exact dates |
| `MCP_CLIENT_IDS` | empty | Restrict clients at application endpoints; see security notes |
| `ENABLE_EMAIL_RECOVERY` | `false` | Enable recovery emails only after configuring and testing delivery |

Public settings are bundled at build time; rebuild after changing them. One installation supports one household with explicitly provisioned members, all with equal cookbook rights.

## Develop and contribute

```sh
npm run check
npm run test:db
npm run test:integration:server
npm run test:provision
```

Database and integration tests require `npm run setup:local`. Integration tests use synthetic records in the isolated local stack. The server helper starts and stops its own app process; it refuses to take over an occupied port. No test in CI connects to cloud databases. See [CONTRIBUTING.md](CONTRIBUTING.md) for the fork-and-pull-request workflow, and [the upgrade guide](docs/UPGRADING.md) for importing releases into a private deployment.

## Privacy and backups

Keep `.private`, environment files, signing keys, setup links, real cookbook screenshots, and exports out of Git and shared CI artifacts. The website's authenticated JSON download includes all recipe versions and saved source/note material. Keep exports somewhere private. It is not a full account backup and there is no JSON import tool yet; account/grant recovery also needs database and hosted-auth configuration backups.

See [SECURITY.md](SECURITY.md) for access boundaries and private vulnerability reporting. Keep public previews fictional and contributor environments separate from personal production data.

## License

Recetario's original code and fictional demo are MIT licensed. Dependency and adapted-component terms remain intact; see [LICENSE](LICENSE) and [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).