{
  "slug": "google-sheets",
  "name": "Google Sheets (content only)",
  "summary": "No back office at all: the owner edits the menu, prices, hours and closures in a Google Sheet, and the website reads it.",
  "audience": [
    "builders"
  ],
  "bestFor": "Owners who only need to change the menu, prices and opening hours, and take bookings through a booking service.",
  "cost": "Free.",
  "rank": 8,
  "covers": "content",
  "docs": [
    {
      "label": "Publish a sheet to the web",
      "href": "https://support.google.com/docs/answer/183965"
    }
  ],
  "body": "## What this covers — and doesn't\n\nThis recipe replaces the menu editor and the hours screen with a spreadsheet the owner already knows how to use. It's for **public content only**: bookings, orders, enquiries and customer details must never go in a published sheet, because anyone with the link can read it. For those, use a booking service's own dashboard, or one of the database recipes.\n\n## 1. Make the sheet\n\nOne Google Sheet with tabs named exactly like the data model:\n- `menu_items`: section, name, description, price (e.g. `11.50`), tags (comma-separated), available (`TRUE`/`FALSE`), position\n- `opening_hours`: day (`Monday` … `Sunday`), open, opens, closes\n- `closures`: starts_on, ends_on, note\n- `settings`: two columns, key and value (name, phone, email, address, instagram, booking_link)\n\n## 2. Publish it\n\nFile → Share → Publish to web → choose each tab → **CSV**. Copy each tab's CSV link.\n\n## 3. Read it from the site\n\nFetch each CSV when the site builds (static sites) or on the server with a short cache (for example revalidate every 5 minutes), parse it, and feed the public menu, footer, contact section and closed-notice banner. Fall back to the last good copy if the fetch fails, so a typo in the sheet can't take the site down. Don't fetch it from visitors' browsers on every page view.\n\n## 4. Hand it over\n\nGive the owner edit access to the sheet only, and a one-line note: \"Change it here; the website updates within five minutes.\"",
  "url": "https://copypasteui.dev/r/recipes/google-sheets.json",
  "prompt": "# Back office with Google Sheets (content only)\n\nThis recipe covers public content only (menu, prices, hours, closures, business details). Best for: Owners who only need to change the menu, prices and opening hours, and take bookings through a booking service. Cost: Free.\n\n## The back-office data model\n\nEvery recipe stores the same data with the same names, so the back-office screens (category \"admin\") work with any backend. Money is stored in pence/cents as whole numbers. Times are stored in UTC.\n\n| Table | Fields | Used by |\n| --- | --- | --- |\n| `staff_members` | user_id (the auth user), email, name, role (`owner` \\| `manager` \\| `staff`), status (`active` \\| `invited`) | admin-staff, every access check |\n| `settings` | one row: name, phone, email, address, instagram, booking_link, notify_bookings, notify_enquiries, notify_reviews, daily_summary | admin-settings, the public header/footer/contact |\n| `bookings` | id, starts_at, name, party, phone, email, table_label, note, status (`confirmed` \\| `arrived` \\| `no-show` \\| `cancelled`), created_at | admin-bookings, admin-overview |\n| `orders` | id, number, customer_name, placed_at, pickup_at, items (list of {name, qty}), total_pence, paid, stage (`new` \\| `preparing` \\| `ready` \\| `collected`) | admin-orders |\n| `enquiries` | id, name, email, phone, subject, message, received_at, status (`new` \\| `replied` \\| `archived`) | admin-enquiries |\n| `menu_sections` | id, name, position | admin-menu-editor, the public menu |\n| `menu_items` | id, section_id, name, description, price_pence, tags (list), available, position | admin-menu-editor, the public menu |\n| `customers` | id, name, email, phone, visits, last_visit, spend_pence, notes, marketing_opt_in | admin-customers |\n| `reviews` | id, source, author, rating (1–5), text, posted_at, reply | admin-reviews |\n| `opening_hours` | day (0 = Monday … 6 = Sunday), open, opens, closes | admin-hours, the public footer/contact |\n| `closures` | id, starts_on, ends_on, note | admin-hours, the closed-notice banner |\n\n## Who may do what\n\nThis is the security contract. Implement it in the database's own rules, not only in the interface — hiding a button doesn't stop anyone.\n\n| Data | Public visitors | Staff | Manager | Owner |\n| --- | --- | --- | --- | --- |\n| menu_sections, menu_items, opening_hours, closures | read | read | read, write | read, write |\n| settings | read (public fields only) | read | read | read, write |\n| bookings | create only (from the booking form), never read | read, change status | read, write | read, write |\n| orders | create only (from checkout), never read | read, change stage | read, write | read, write |\n| enquiries | create only (from the contact form), never read | — | read, write | read, write |\n| customers, reviews | — | — | read, write | read, write |\n| staff_members | — | read own row | read | read, write |\n\nRules that apply to every backend:\n- Every `/admin` page checks the session **on the server** and sends signed-out people to `/admin/sign-in`.\n- Secret keys (service-role keys, admin SDK credentials, API secrets) live only in server code and environment variables, never in the browser bundle.\n- Public forms may only insert, with fields limited to what the form sends; they can never read other people's rows.\n- `/admin` is left out of the navigation and the sitemap, and disallowed in robots.txt.\n- The first owner account is created by hand once (instructions in each recipe); everyone else is invited from admin-staff.\n\n# Google Sheets (content only): steps\n\n## What this covers — and doesn't\n\nThis recipe replaces the menu editor and the hours screen with a spreadsheet the owner already knows how to use. It's for **public content only**: bookings, orders, enquiries and customer details must never go in a published sheet, because anyone with the link can read it. For those, use a booking service's own dashboard, or one of the database recipes.\n\n## 1. Make the sheet\n\nOne Google Sheet with tabs named exactly like the data model:\n- `menu_items`: section, name, description, price (e.g. `11.50`), tags (comma-separated), available (`TRUE`/`FALSE`), position\n- `opening_hours`: day (`Monday` … `Sunday`), open, opens, closes\n- `closures`: starts_on, ends_on, note\n- `settings`: two columns, key and value (name, phone, email, address, instagram, booking_link)\n\n## 2. Publish it\n\nFile → Share → Publish to web → choose each tab → **CSV**. Copy each tab's CSV link.\n\n## 3. Read it from the site\n\nFetch each CSV when the site builds (static sites) or on the server with a short cache (for example revalidate every 5 minutes), parse it, and feed the public menu, footer, contact section and closed-notice banner. Fall back to the last good copy if the fetch fails, so a typo in the sheet can't take the site down. Don't fetch it from visitors' browsers on every page view.\n\n## 4. Hand it over\n\nGive the owner edit access to the sheet only, and a one-line note: \"Change it here; the website updates within five minutes.\"\n\nDocs to check before you start, since providers change their APIs: Publish a sheet to the web (https://support.google.com/docs/answer/183965).\n"
}
