# Casebook: a Page Lemon website template

> An app template for a small bookkeeping practice: each client signs in to send receipts, invoices and letters from their phone, answer the bookkeeper's questions, and see where their next VAT return or tax deadline stands. A public page with the two monthly packages, six member screens under /app and a privacy notice with blanks.

You are reading this because the user wants their own website made from the Casebook template and published with Page Lemon (PageLemon.com). They may have pasted only "Use template pagelemon.com/tp/Casebook": that is the whole request, so start now. In short: ask them a few questions about their business, get the template's files (with the Page Lemon connector, `deploy` with `template: "casebook"` copies them for you), make the site theirs (their name, words, details and pictures; no sample content left), then publish it with Page Lemon and give them the link. The steps below say exactly how. The full publishing guide is at https://pagelemon.com/agents.

## About this template

- **Look:** Manila accordion file with index tabs, tear-off deadline pages and red-ink stamps on typed slips (light, calm, classic)
- **Pages:** Home (`index.html`): The public page: what clients do in the app, the three steps, the two monthly packages with prices, the practice and its hours, and a link to sign in; Home (`app/index.html`): Signed out: a welcome with the drawn accordion file and sign-in. Signed in: how many questions are waiting, the next deadline as a tear-off calendar page with its figures and stage, the questions as red-ink slips, the latest papers in the manila folder, and send buttons; Send a paper (`app/upload.html`): The core action: choose what it is, take a photo or pick a PDF, who it is from, the amount and month, and a note; saved papers show in Papers; Papers (`app/papers.html`): Everything the client has sent, newest first, behind manila tabs by kind, each a typed slip with a thumbnail, the bookkeeper’s status as a rubber stamp (Received, Checked, Query, Filed) and reply; Questions (`app/questions.html`): The bookkeeper’s questions waiting on the client with an answer form (prefilled from the question), then the sorted questions and the client’s answers with the bookkeeper’s reply; Deadlines (`app/deadlines.html`): Each filing (VAT return, Self Assessment) with its period, due date, a four-step stage timeline, a note and a link to the figures; Package (`app/package.html`): The client’s monthly package, what it covers and how to change it; join buttons for clients without one; Account (`app/account.html`): Page Lemon’s account block (sign-in, profile, package renewal, billing, devices, leaving) and how to reach the practice; Privacy (`privacy.html`): The privacy notice, with blanks the Site Owner fills in
- **Fonts:** Libre Franklin, Courier Prime (Google Fonts)
- **Live demo:** https://try-casebook.pagelemon.dev/ (a working copy with sample data; people opening https://pagelemon.com/tp/Casebook in a browser land there). The template's own files: https://pagelemon.com/templates/casebook/; the page about it: https://pagelemon.com/tp/Casebook/use
- **Manifest:** https://pagelemon.com/templates/casebook/template.json (machine-readable: files, customise, facts, interview)

## Files

With the Page Lemon connector you don't need to fetch these: `deploy` with `template: "casebook"` copies them all (step 2). Otherwise fetch each file from https://pagelemon.com/templates/casebook/ and save it with the same relative path (including `art/`). Fetch nothing else: templates have no external images or scripts.

- https://pagelemon.com/templates/casebook/index.html
- https://pagelemon.com/templates/casebook/privacy.html
- https://pagelemon.com/templates/casebook/app/index.html
- https://pagelemon.com/templates/casebook/app/upload.html
- https://pagelemon.com/templates/casebook/app/papers.html
- https://pagelemon.com/templates/casebook/app/questions.html
- https://pagelemon.com/templates/casebook/app/deadlines.html
- https://pagelemon.com/templates/casebook/app/package.html
- https://pagelemon.com/templates/casebook/app/account.html
- https://pagelemon.com/templates/casebook/styles.css
- https://pagelemon.com/templates/casebook/app.js
- https://pagelemon.com/templates/casebook/kit.css
- https://pagelemon.com/templates/casebook/kit.js
- https://pagelemon.com/templates/casebook/kit-icons.svg
- https://pagelemon.com/templates/casebook/site.webmanifest
- https://pagelemon.com/templates/casebook/favicon.svg
- https://pagelemon.com/templates/casebook/art/icons.svg
- https://pagelemon.com/templates/casebook/art/doc-fuel.svg
- https://pagelemon.com/templates/casebook/art/doc-courier.svg
- https://pagelemon.com/templates/casebook/art/doc-kiln.svg
- https://pagelemon.com/templates/casebook/art/doc-invoice.svg
- https://pagelemon.com/templates/casebook/art/doc-rent.svg
- https://pagelemon.com/templates/casebook/art/doc-rates.svg
- https://pagelemon.com/templates/casebook/art/doc-clay.svg
- https://pagelemon.com/templates/casebook/og.png
- https://pagelemon.com/templates/casebook/apple-touch-icon.png
- https://pagelemon.com/templates/casebook/icon-192.png
- https://pagelemon.com/templates/casebook/icon-512.png
- https://pagelemon.com/templates/casebook/icon-512-maskable.png

## Notes for Casebook (its `customise` rules)

- Wenlock Pirie Bookkeeping, its address, phone, email and hours: replace every data-pl-fill fact with the owner’s own, and the names Morwenna and Ruairi on index.html and the app pages. Replace the name in site.webmanifest.name too; keep short_name as Casebook unless the owner chooses another app name.
- Fill in every highlighted blank on privacy.html with the Site Owner before clients use the site (not legal advice: https://pagelemon.com/agents/member-app-legal).
- setup_app with signup invite (the practice invites each client), profile_fields and display_field as memberApp.setup says; then save_app_list for documents, questions, answers and deadlines exactly as memberApp.lists says, so the field names match the pages.
- The owner’s path: Dashboard, Apps, Entries. Open a new paper, set its status (Received, Checked, Query, Filed) and write a short reply; the client sees both on Papers and Home. Ask a question by adding a questions row assigned to the client with stage Waiting on you; set it to Sorted once their answer is in. Keep each deadline row’s stage current.
- Set the plans with save_plan: essentials (£45 a month) and vat (Essentials + VAT, £95 a month). Change the prices on index.html and app/package.html together.
- Stage names are the choice options of questions.stage and deadlines.stage; if you rename them, change data-cb-stage on the pages too so the timeline and badges follow.
- Paperwork only: never add fields that ask clients for card, bank account, ID or tax reference numbers, passwords or anything about their health. Keep the line “Cover the long card number before you take the photo.” next to the photo field.
- **Colours:** Edit the --cb-* and --k-* tokens at the top of styles.css: Manila #F2D58A for the folder and tabs, Ledger Green #1F5B45 for actions, Red Ink #B3261E for deadlines, money owed and queries, Carbon #1C1F1D text on white. The dark scheme (a dark desk where the folder and paper keep their colours) follows the device.
- **Fonts:** Libre Franklin (headings and buttons) with Courier Prime (every amount, reference, date and typed label), from one Google Fonts link in each page head; to self-host, swap that link for local files and keep the --cb-sans and --cb-type stacks in styles.css
- **Sections:** Member pages live under /app and use the shared app kit (kit.css, kit.js, kit-icons.svg; never edit those copies). app/upload.html holds the documents add form; app/questions.html the answers add form (?question= prefills it); app/index.html, papers.html, questions.html and deadlines.html show the lists; app/package.html the join buttons; app/account.html the account block. app.js turns each stage into the stamp and timeline, counts the days to a deadline (and to 31 January on index.html), counts the questions still waiting for the headings, runs the folder tabs on Papers (?kind=Receipt opens that tab) and fills this month on the send form.
- **Images:** No photos: paper and type only. art/doc-*.svg are the sample client’s papers (drawn, no real data). The accordion file on index.html and the signed-out Home, the tear-off calendar pages, paper clips and rubber stamps are drawn in HTML and CSS (pb-*, cb-acc, cb-tear, cb-clip, cb-stamp in styles.css). art/icons.svg adds the file, upload, folder and message icons. favicon.svg is the manila folder mark; the PNG icons are made from it.

## Set up the app

This is an app template: the home page and privacy notice are public, and the pages under `/app` are for signed-in users, each seeing only their own entries and the entries the Site Owner assigns to them. Users sign in with a code sent to their email. The full guide is https://pagelemon.com/agents/member-app; read it before you set this up, and its legal notes at https://pagelemon.com/agents/member-app-legal.

- **Needs:** a kept site on App or above, and the Site Owner signed in to Page Lemon with two-step sign-in (they turn the app on themselves, at the approve link `setup_app` returns).
- **Never:** health, mood or therapy records, accounts for children, or fields for card, bank or ID numbers (Acceptable Use: https://pagelemon.com/acceptable-use#member-app). Users pay through Stripe.
- **Then:** `setup_app` with these settings, the join questions and note in the user's own words, then `save_app_list` once for each list below, exactly as written, so the field names match the pages.

  ```json
  {"site":"<site>","signup":"invite","profile_fields":[{"name":"name","type":"text","label":"First name"},{"name":"business","type":"text","label":"Business name"}],"display_field":"name","path":"/app"}
  ```

- **Papers** (`documents`): users add these rows themselves on the pages.

  ```json
  {"site":"<site>","list":"documents","label":"Papers","fields":[{"name":"kind","type":"choice","label":"What is it?","required":true,"options":["Receipt","Sales invoice","Bill","Letter","Other"]},{"name":"file","type":"photo","label":"Photo or PDF","required":true},{"name":"title","type":"text","label":"Who from, or what for","required":true},{"name":"amount","type":"number","label":"Amount (£)"},{"name":"period","type":"text","label":"Which month?"},{"name":"memo","type":"long_text","label":"Anything we should know"}],"status_options":["Received","Checked","Query","Filed"],"reply":true}
  ```

- **Questions for the client** (`questions`): the Site Owner adds these rows in the Page Lemon Dashboard (Apps tab) and assigns each to one user, who only reads it.

  ```json
  {"site":"<site>","list":"questions","label":"Questions for the client","fields":[{"name":"question","type":"text","label":"Question","required":true},{"name":"stage","type":"choice","label":"Stage","required":true,"options":["Waiting on you","Sorted"]},{"name":"due","type":"date","label":"Answer by"},{"name":"detail","type":"long_text","label":"What we need"},{"name":"asked_by","type":"text","label":"Asked by"}]}
  ```

- **Answers and notes** (`answers`): users add these rows themselves on the pages.

  ```json
  {"site":"<site>","list":"answers","label":"Answers and notes","fields":[{"name":"about","type":"choice","label":"What is this?","required":true,"options":["Something else","Question","Approval"]},{"name":"question","type":"text","label":"Which question or filing?","required":true},{"name":"answer","type":"long_text","label":"Your answer","required":true},{"name":"file","type":"photo","label":"Add a photo or PDF"}],"status_options":["Received","Sorted"],"reply":true}
  ```

- **Deadlines** (`deadlines`): the Site Owner adds these rows in the Page Lemon Dashboard (Apps tab) and assigns each to one user, who only reads it.

  ```json
  {"site":"<site>","list":"deadlines","label":"Deadlines","fields":[{"name":"filing","type":"text","label":"Filing","required":true},{"name":"period","type":"text","label":"Period"},{"name":"due","type":"date","label":"Due","required":true},{"name":"stage","type":"choice","label":"Stage","required":true,"options":["Gathering papers","Being prepared","Ready for you to approve","Filed"]},{"name":"sales","type":"number","label":"Sales (£)"},{"name":"vat_sales","type":"number","label":"VAT on sales (£)"},{"name":"vat_costs","type":"number","label":"VAT on costs (£)"},{"name":"to_pay","type":"number","label":"To pay (£)"},{"name":"memo","type":"long_text","label":"Note"},{"name":"link","type":"text","label":"Link to the working papers"}]}
  ```

- **Plans** (`save_plan`; the pages use `data-pl-if="plan:<id>"` and join buttons): `essentials` "Essentials" (paid, sample price 45.00 GBP a month; ask the user for theirs); `vat` "Essentials + VAT" (paid, sample price 95.00 GBP a month; ask the user for theirs). Paid plans need Starter or Scale and the Site Owner's Stripe account connected; `save_plan` returns the onboarding link if it isn't.

## Build the site, step by step

1. **Interview first.** Ask the user these questions, a few at a time, in plain words, and collect every fact the site needs (practice name, address, contact email, phone number, opening hours, the bookkeepers’ names, package prices, privacy contact and address). If they can't answer one, remove that element rather than inventing it.
   - What is your practice called, where is it, and who in it looks after clients?
   - Who are your clients (sole traders, small companies, landlords), and which filings do you do for them?
   - What packages do you offer, what does each cover, and what do they cost a month?
   - Which papers do clients send most, and how soon do you check them?
   - How quickly do you answer a client, and on which days and hours?
   - Which email address and phone number should clients use?
   - What address and privacy contact should the privacy notice show?
2. **Get the files.** If you have the Page Lemon tool (the MCP connector with a `deploy` tool; https://pagelemon.com/docs/connect sets it up), call `deploy` with `template: "casebook"` (no files): Page Lemon copies every file above on its side and returns `site`, `revision` and, without an account, `site_token`. Read each page you will change with `get_site` and `path`, make the changes below, then publish only the changed files with `deploy`, `site`, `base_revision` (that revision) and `patch: true`; show the link only after that. Without the tool, fetch the files listed above. If you cannot fetch files either, ask the user for what you need and rebuild the pages from the live demo as closely as you can.
3. **Make it the user's site.** Follow `customise` in `template.json`:
   - Replace every element marked `data-pl-fill` (names, phone, email, address, hours, prices, people, dates, links, stats) on every page, then remove the attributes. **Never ship a `data-pl-fill` default.** The sample town, street and people's names also appear in ordinary sentences, `aria-label`s and image `alt` text: replace them there too. Name, address and phone must match exactly in the footer, the visit or contact page and the JSON-LD.
   - Sample reviews (`data-pl-fill="review"`) are fictional: delete them unless the user gives you real ones. Delete each whole review, with its name or caption, and the section and its nav link when none is left. Never invent reviews, numbers or awards.
   - Update each page's `<title>`, meta description, canonical, `og:url` and `og:image` to the user's real address, and the JSON-LD block on the home page (type, name, address, `geo` coordinates (delete them unless you have the real ones), hours, phone, `url`).
   - Photos: this template is drawn art, not photos. If the user wants their own photos, add them where they fit (compressed, WebP or JPEG under about 300 KB, real `alt`). Ask for photos; never hot-link.
   - Make a new `og.png` (1200×630) of the new home page if you can, with its `og:image` tags; otherwise delete the sample one and its `og:image` tags (a template deploy has already left both out). Change colours only through the `:root` tokens in `styles.css`, fonts through the font tokens and the `<link>` that loads them. Google Fonts is fine, but it sends each visitor's IP address to Google, so the privacy-friendly choice is to self-host the font files (woff2) in the site folder with `@font-face`, or use system fonts.
   - Delete pages or sections the user doesn't need (and their nav links) rather than leaving them generic. Keep the layout, type scale and signature interaction: they are what makes it look designed.
   - Remove the `<!-- Page Lemon template ... -->` comment.
4. **Forms and bookings.** Templates have no fake forms. Each `data-pl-slot` shows a fallback that works today (call, email, or the Site Owner's own booking or payment link: ask for it). The designed form sits next to it in an inert `<template data-pl-slot-form="<id>">`; `template.json.slots` says which page has which. When the user wants the real thing (Forms and Booking: any paid plan; staff and rooms only on some, and each plan has a limit of online bookings a day), set the form up as a list (`save_list`) or the service (`save_service`), put the matching markup in the slot (reuse the template's form classes so it matches), delete the fallback and the `<template>`, and copy the paragraph from `<template data-pl-privacy="forms">` into `privacy.html`.
5. **Check before publishing:**
   - Search every file for `data-pl-fill`, the template's fictional business name and its sample phone, email and street, in links too (`tel:` and `mailto:` hrefs, and map links, where the street is written like `18+Linden+Walk`): none left.
   - All links between pages work; nav and footer are the same on every page.
   - Body text contrast at least 4.5:1, large text and buttons 3:1, after any colour change.
   - No horizontal scroll at 320 px; headlines still fit on a phone after copy changes.
   - One `h1` per page, a unique `<title>` and meta description per page, alt text on meaningful images.
   - Copy sounds like the user, not like an AI (see https://pagelemon.com/guides/website-copy-that-doesnt-sound-like-ai).
6. **Publish with Page Lemon** (below; with the tool, the patch deploy from step 2 is the publish), then tell the user which template you used and that they can keep changing the site, or add bookings and forms, by asking.
7. **Turn on the app** as "Set up the app" above says: `setup_app`, then `save_app_list` for each list, `save_plan` for each plan, the approve link to the Site Owner, `invite_users`, a test with `preview_as_user` and `get_app` with `check: true` before you say it's ready.

## Publish with Page Lemon

Pick the first route you can use:

1. **You can run shell commands:** build if needed, then upload only the folder with `index.html` (`dist/`, `build/`, `out/`…). Never upload source code, `.env` files or keys: everything you upload becomes public.
   (at most 100 files and 1 MB in all, `index.html` at the root):
   ```bash
   node -e 'const fs=require("fs"),p=require("path"),d=process.argv[1],files=[];(function w(x){for(const e of fs.readdirSync(x,{withFileTypes:true})){const f=p.join(x,e.name);e.isDirectory()?w(f):files.push({path:p.relative(d,f).split(p.sep).join("/"),content_base64:fs.readFileSync(f).toString("base64")})}})(d);console.log(JSON.stringify({files}))' <dir> \
     | curl -sS --fail-with-body -H "Content-Type: application/json" --data-binary @- https://api.pagelemon.com/v2/anonymous-sites
   ```
   If the user gave you an API key (`plak_…`) or `~/.config/pagelemon/credentials` exists, publish into their account instead (see "Updating a site" in https://pagelemon.com/agents). If `.pagelemon.json` exists, the site is already published: see "Updating a site" in https://pagelemon.com/agents.
2. **You have the Page Lemon MCP connector** (`https://mcp.pagelemon.com/mcp`): call its `publish_site` tool with every file. See "No shell: the MCP connector" in https://pagelemon.com/agents.
3. **Neither (a chat app without the Page Lemon connector):** say once that they can connect Page Lemon to this AI app (steps at https://pagelemon.com/docs/connect) so you can publish and change the site for them. In the Gemini app or Grok (free plan included) it takes about a minute: Gemini at gemini.google.com/customize/connectors (**Custom**), Grok at grok.com/connectors (**New Connector**, **Custom**), with the link `https://mcp.pagelemon.com/mcp`; then they sign in and click **Allow**. Give those steps in plain words. If they can't or would rather not (for example ChatGPT's free plan), don't ask them to save or upload files. Put the whole site in ONE complete page: CSS and JavaScript inline, images as https links or small data URIs, from `<!DOCTYPE html>` to `</html>`. Show it as one code block, then tell them: "Tap Copy on the code, open pagelemon.com/publish, tap Paste and publish." Only if you can really give them a downloadable .zip (a file they tap to download, not code to save): "Download this zip, open pagelemon.com/publish, tap Drop or choose a file." They get a live link with no account, online for 72 hours unless they tap **Keep it free**. Don't say you can't help.

Then:

- **Pass on `agent_message` from the response in full**, success or failure, in the user's language and your own words. It has the link, the expiry time, the private keep link and the terms line: copy every link, code, number, date and domain exactly, and never drop a link, deadline or the terms line (keep both its links). If it asks a question, ask it and wait. Times in it are UTC; `*_at` fields have them in ISO, so you can give the user's local time.
- **On success, save `.pagelemon.json`** in the project folder and add it to `.gitignore` (see https://pagelemon.com/agents).
- **Offer to help keep the site** (see "Keeping the site" in https://pagelemon.com/agents). Sites published without an account go offline after 72 hours unless the user keeps them with a free account.

By publishing, the user agrees to the Terms (https://pagelemon.com/terms) and Privacy Policy (https://pagelemon.com/privacy). The `agent_message` includes this line; keep it.

More: https://pagelemon.com/agents (full guide: updating a site, keeping it, custom domains, plugins). All templates: https://pagelemon.com/templates/index.json.
