# Expense-log: a Page Lemon website template

> An app template: a small studio’s own expense claims app. Staff sign in with their email, photograph a receipt on their phone and claim it in under a minute, follow each claim from Submitted to Approved to Paid, answer the office manager’s questions, and see what they are owed and their monthly totals. The office manager approves and replies in the Dashboard. A public page, six member screens under /app (Home, Add, Claims, Months, Policy, Account) and a privacy notice with blanks.

You are reading this because the user wants their own website made from the Expense-log template and published with Page Lemon (PageLemon.com). They may have pasted only "Use template pagelemon.com/tp/Expense-log": 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: "expense-log"` 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:** Architect’s drawing sheet: cyanotype blue on drafting white with a trace grid, IBM Plex Sans Condensed with Plex Mono figures; a title block holds the month’s totals, receipts pinned to the sheet, queries in red pen (light, bold, modern)
- **Pages:** Home (`index.html`): The public page: what the expense app does for Holbeck Yard Architects’ staff, the three steps, the claim rules in short, payday and the way in; Home (app) (`app/index.html`): The staff member’s home: what they are owed, this month’s total, a question from the office manager to answer first, recent claims with their status, quick actions; Add (`app/add.html`): Claim an expense: the receipt photo first, then date, merchant, amount, currency, category, who paid and a note, with the rules next to the fields; Claims (`app/claims.html`): Every claim newest first, with its status timeline (Submitted, Approved, Paid) and the office manager’s reply; Months (`app/months.html`): Totals per month and per category, and this month’s count; Reply (`app/reply.html`): Answer the office manager’s query on a claim (which claim, the answer, the missing document) and see the replies sent; Policy (`app/policy.html`): What staff can claim, the limits, the deadline, what a good receipt photo shows and when claims are paid; Account (`app/account.html`): The account block (email, devices, leaving), the first name the office manager sees, and help; Privacy (`privacy.html`): The privacy notice, with blanks the Workspace Owner fills in
- **Fonts:** IBM Plex Sans Condensed, IBM Plex Mono (Google Fonts)
- **Live demo:** https://try-expense-log.pagelemon.dev/ (a working copy with sample data; people opening https://pagelemon.com/tp/Expense-log in a browser land there). The template's own files: https://pagelemon.com/templates/expense-log/; the page about it: https://pagelemon.com/tp/Expense-log/use
- **Manifest:** https://pagelemon.com/templates/expense-log/template.json (machine-readable: files, customise, facts, interview)

## Files

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

- https://pagelemon.com/templates/expense-log/index.html
- https://pagelemon.com/templates/expense-log/app/index.html
- https://pagelemon.com/templates/expense-log/app/add.html
- https://pagelemon.com/templates/expense-log/app/claims.html
- https://pagelemon.com/templates/expense-log/app/months.html
- https://pagelemon.com/templates/expense-log/app/policy.html
- https://pagelemon.com/templates/expense-log/app.js
- https://pagelemon.com/templates/expense-log/app/reply.html
- https://pagelemon.com/templates/expense-log/app/account.html
- https://pagelemon.com/templates/expense-log/privacy.html
- https://pagelemon.com/templates/expense-log/styles.css
- https://pagelemon.com/templates/expense-log/kit.css
- https://pagelemon.com/templates/expense-log/kit.js
- https://pagelemon.com/templates/expense-log/kit-icons.svg
- https://pagelemon.com/templates/expense-log/site.webmanifest
- https://pagelemon.com/templates/expense-log/favicon.svg
- https://pagelemon.com/templates/expense-log/art/snap.svg
- https://pagelemon.com/templates/expense-log/art/receipt-rail.svg
- https://pagelemon.com/templates/expense-log/art/receipt-cafe.svg
- https://pagelemon.com/templates/expense-log/art/receipt-hotel.svg
- https://pagelemon.com/templates/expense-log/art/receipt-shop.svg
- https://pagelemon.com/templates/expense-log/art/receipt-ryman.svg
- https://pagelemon.com/templates/expense-log/art/receipt-book.svg
- https://pagelemon.com/templates/expense-log/art/receipt-taxi.svg
- https://pagelemon.com/templates/expense-log/art/receipt-invoice.svg
- https://pagelemon.com/templates/expense-log/art/red-ring.svg
- https://pagelemon.com/templates/expense-log/art/stamp-checked.svg
- https://pagelemon.com/templates/expense-log/art/stamp-approved.svg
- https://pagelemon.com/templates/expense-log/art/empty-sheet.svg
- https://pagelemon.com/templates/expense-log/apple-touch-icon.png
- https://pagelemon.com/templates/expense-log/icon-192.png
- https://pagelemon.com/templates/expense-log/icon-512.png
- https://pagelemon.com/templates/expense-log/icon-512-maskable.png
- https://pagelemon.com/templates/expense-log/og.png

## Notes for Expense-log (its `customise` rules)

- Holbeck Yard Architects, its address, phone, email and office manager in the header, footer, titles and copy: replace every data-pl-fill fact with the owner’s own. Replace the name in site.webmanifest.name too; keep short_name as Expenses unless the owner chooses another.
- Fill in every highlighted blank on privacy.html with the Workspace Owner before staff use the site (not legal advice: https://pagelemon.com/agents/member-app-legal)
- setup_app with template expense-log and signup invite makes the expenses list; then save_app_list for expenses exactly as memberApp.lists says, with its status_options and reply on, so staff see Submitted, Approved, Query, Paid, Recorded (company card, nothing to pay back) or Rejected and the office manager’s reply. Invite staff with invite_users. Make the answers list the same way: staff reply to a Query with it, and the office manager reads it in the Dashboard.
- Categories, currencies and the rules are the owner’s: change the choice options with save_app_list and the add form on app/add.html together, and the limits on app/policy.html, app/add.html and index.html together. Never add medical or health categories.
- Keep the help text "Cover the long card number before you take the photo." next to the receipt field on app/add.html.
- The office manager approves in the Dashboard (Apps → Expenses): set the status and, for a question, a reply. Staff with only View users can read; Edit users can approve.
- **Colours:** Edit the brand tokens at the top of styles.css; the dark scheme follows the device.
- **Fonts:** IBM Plex Sans Condensed and IBM Plex Mono, loaded from Google Fonts on every page; your AI can self-host them on request.
- **Sections:** The app pages live under /app on the shared app kit (kit.css, kit.js, kit-icons.svg; never edit the copies). app/add.html holds the add form for expenses (names match the list’s fields exactly). app/index.html, app/claims.html and app/months.html show the user’s own expenses, statuses, replies and totals (data-pl-view="numbers"). app/policy.html is plain text the owner edits. app/account.html holds the account block. index.html holds no member blocks, only links to /app. The sample summary on app/months.html, headed “October in one paragraph”, is example text: the AI replaces it with a summary of the user’s own months or removes it.
- **Images:** Drawn SVG art: art/snap.svg (a phone photographing a hotel receipt, 880 by 1100) and art/receipt-*.svg (the sample receipts, 400 by 560, used only by the gallery’s sample rows), art/stamp-approved.svg (the red-pen stamp on approved claims) and art/red-ring.svg (the red-pen circle on the total of a query). favicon.svg is the receipt mark; the PNG icons and manifest 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 Workspace 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 Workspace 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"}],"display_field":"name","path":"/app"}
  ```

- **Expenses** (`expenses`): users add these rows themselves on the pages.

  ```json
  {"site":"<site>","list":"expenses","label":"Expenses","fields":[{"name":"merchant","type":"text","label":"Merchant","required":true},{"name":"amount","type":"number","label":"Amount","required":true},{"name":"date","type":"date","label":"Date","required":true},{"name":"category","type":"choice","label":"Category","options":["Travel","Meals","Accommodation","Office supplies","Equipment","Software","Phone and internet","Training","Other"]},{"name":"currency","type":"choice","label":"Currency","options":["GBP","EUR","USD"],"required":true},{"name":"paid_by","type":"choice","label":"Paid by","options":["Me","Company card"]},{"name":"memo","type":"long_text","label":"Note"},{"name":"claim_ref","type":"text","label":"Claim reference"},{"name":"receipt","type":"photo","label":"Receipt photo","required":true}],"status_options":["Submitted","Approved","Query","Paid","Recorded","Rejected"],"reply":true}
  ```

- **Replies to queries** (`answers`): users add these rows themselves on the pages.

  ```json
  {"site":"<site>","list":"answers","label":"Replies to queries","fields":[{"name":"merchant","type":"text","label":"Which claim (merchant)","required":true},{"name":"message","type":"long_text","label":"Your answer","required":true},{"name":"attachment","type":"photo","label":"The missing document"},{"name":"claim_ref","type":"text","label":"Claim reference"}]}
  ```

## 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 (business name, address, contact email, phone, office manager’s name, payday, claim deadline, spending limits per category, privacy contact and address). If they can't answer one, remove that element rather than inventing it.
   - What is your business called, and where is it?
   - Who approves expenses, and which email should staff use for questions?
   - When do you pay expenses back (for example with the monthly payroll), and what is the deadline to claim?
   - Which categories do you use, and what are your limits (meals per day, hotel per night, rail class)?
   - Which currencies do staff spend in?
   - Who should be able to sign in: invite each member of staff by email?
   - 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: "expense-log"` (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 Workspace 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: every plan;
   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 (`booking_service_save` `action=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, the approve link to the Workspace 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 `site_publish` 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.
