Commit graph

25 commits

Author SHA1 Message Date
5e2db31b5e PocketBase 0.40.6, JS SDK 0.28.2; fresh-install steps for the new dashboard
- docker-compose: elestio/pocketbase v0.40.6, digest-pinned (same port,
  user and layout as v0.23.12)
- pocketbase SDK ^0.28.2 in both apps and packages/shared (0.27/0.28
  are additions and pb.filter() fixes, nothing breaking)
- README: setup steps rewritten for the 0.40 dashboard: install link
  from the log, and tick "Merge with the existing collections" on
  schema import (the default deletes `users`); an upgrade section
  (back up first, data upgrade is one-way, what changed)
- AGENTS.md: versions; field settings go at the top level, not `options`

Compared with main (0.23.12 + SDK 0.26) on copies of real data: admin
and public page text, image upload, import of all three backups, the
shop flow via hooks, Stripe webhook signatures, and a fresh install
with pb_schema.json import all behave the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HA82gX7xH4zwYTr5vE7mf8
2026-11-03 09:43:49 +00:00
a6f9e6c6e3 Public site: smoother scrolling
Scrolling the home page dropped frames on a desktop-sized window. Measured
in Firefox and Chromium, the cost came from blocks fading in while scrolling
and from the blurred (frosted) header and calendar cards, which are redrawn
on every frame.

- Header and upcoming-calendar cards: nearly solid background, no blur.
- Fade-in animations are shorter (0.4s / 0.5s, a smaller slide).
- They are off for people whose device asks for reduced motion, and on
  devices that can't keep up: very few cores / little memory straight
  away, otherwise when more than 1 in 10 of the first scrolled frames run
  late (scrollReveal.ts adds `plain-motion` to <html>, remembered for
  the visit).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW
2026-10-27 08:36:03 +00:00
91f6705899 Site design → Style: fonts, corners, text size, shadows, page width
A new Style card in Site design (a `style` global) chooses the heading and
body fonts from 15 bundled ones, corners (sharp/soft/round), text size,
shadow strength and page width, with a live sample. The choices become
--site-* CSS variables that the @theme radius, shadow, container and font
tokens scale, so blocks keep using rounded-xl, shadow-sm, max-w-6xl and
follow the setting. Buttons and chips use rounded-button; the defaults
are the site's current look.

Fonts are @fontsource-variable packages (replacing the static DM Sans and
Playfair ones): still served by the site, and a browser downloads only
the fonts a page uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW
2026-10-26 19:00:37 +00:00
4b50067a4a Merge pull request 'Use the Site design logo as the favicon (site and admin)' (#11) from logo-favicon into main
Reviewed-on: #11
2026-10-26 14:20:06 +01:00
d3d8910c3c Public site: the Site design logo is the favicon
A 300x300 thumbnail of it (PocketBase's existing media thumb size), also
as the phone home-screen icon. Without a logo the bundled icon stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW
2026-10-26 13:14:04 +00:00
f86c2251dc Visual text editor; Cards, FAQ and HTML blocks; block anchors
The text editor (Tiptap) only produces simple HTML: headings, bold,
italic, strikethrough, links, lists, pull quotes, lines. Layouts that
were hand-written HTML in text blocks get their own blocks (Cards with
pictures or numbered steps, FAQ), one-offs and embeds go in an HTML
block, and every block can have an anchor for #links. Text blocks get
alignment and a small (footnote) size.

Existing text blocks the editor can't represent become HTML blocks that
render exactly as before (migration, and backup import for old files);
text that is only centred becomes centred text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW
2026-10-26 12:58:15 +00:00
c3c10229b0 Site design: separate booking page and basket page
The header button, the basket indicator, the shop's "view basket" links,
hero buttons and the payment return page all pointed at a hard-coded
/book. Site design now has a Booking page (where the CTA leads) and a
Basket page (where the basket leads; empty = the booking page), and
warns when the page picked is unpublished or lacks its Shop / Checkout
block. On a basket page of its own, an empty basket links to the
booking page instead of saying "pick a service above".

Sites saved before this keep their links: the booking page falls back
to the CTA's old address, then /book.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW
2026-10-26 11:19:54 +00:00
e824f16e31 Shop and checkout: bundles, gift details, codes, confirm without paying
Bundle cards list what they contain and how long the code is valid. In
the basket a bundle can be marked as a gift (for / message). Checkout
takes a code: covered bookings show "Paid with your code" and cost 0,
with what the code has left; when nothing is left to pay the button is
Confirm booking and no Stripe step happens. The result page and the
confirmation email show bought codes and code-paid bookings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW
2026-10-25 21:39:51 +00:00
eac99b2abe Shop: duration slider on services, times fetched per service and length
Service cards step through their lengths with a slider and the price
follows. The time picker loads bookable times for the chosen length and
the months on screen from GET /api/slots (a proxy to the shop hook in each
app), and reloads when the basket's bookings change. Checkout, emails and
the basket show each booking's own length.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW
2026-10-25 20:12:46 +00:00
e29eaaa8e8 Show prices in the shop currency (STRIPE_CURRENCY), not hard-coded EUR
formatPrice always formatted EUR, so the public shop, checkout, basket
and order confirmation showed € even when Stripe charged another
currency. It now takes a currency; both apps pass STRIPE_CURRENCY to the
blocks as layout data `currency` (like `timezone`), so one setting drives
what Stripe charges and every price shown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qq6FzyGitv5gDZEcCHDGoo
2026-10-25 14:48:12 +00:00
5828d65a00 Privacy policy link in the footer and checkout, notes hint, and a policy draft
Site design → Footer picks the privacy policy page; it is linked from the footer and from a short notice above Pay. The notes field asks customers not to write health details (special-category data). 'Create a privacy policy draft' makes an unpublished page describing what this software does with customer data, with gaps for the studio to fill in. No consent checkbox: booking data is processed to perform the contract. Also adds the PrivacyGlobal type used by the retention settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaXE9U7AmW3dfD2w6cbLfk
2026-10-24 10:44:45 +00:00
73e8c5dc5d No third-party requests on page load: bundle the fonts, load Stripe.js at Pay
Google Fonts and Stripe.js (imported from @stripe/stripe-js, which injects the script on import) sent every visitor's IP address to Google and Stripe on every page. Fonts now come from @fontsource packages bundled into each app; Stripe.js loads from the 'pure' entry point, only when the customer presses Pay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaXE9U7AmW3dfD2w6cbLfk
2026-10-24 10:44:45 +00:00
021d06d3e4 Checkout: reservation countdown, 'keep it 10 more minutes', and a message when a hold runs out
Basket changes that free or take places reload the page data, so places
removed from the basket show up in the shop again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaXE9U7AmW3dfD2w6cbLfk
2026-10-24 09:32:56 +00:00
214db95186 Show dates, times and prices in a European format and the studio's timezone
Formatting with the default locale rendered US dates (MM/DD/YYYY, 12-hour)
on the server. Everything shown to people now uses DISPLAY_LOCALE (en-GB)
and booking times use SITE_TIMEZONE. The public layout reloads on every
navigation so places left are never stale.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaXE9U7AmW3dfD2w6cbLfk
2026-10-24 09:32:56 +00:00
d7765fe605 Shop: places per slot, and bookings block overlapping slots
Slots get a capacity (items.capacity is the service default). Booking
state is no longer stored on the slot: slotStates() in the shop hooks
counts places from paid order lines and live basket holds (heldUntil
moves to the basket line), and a slot with any place taken blocks every
overlapping slot of any service, including get-ready time.

GET /api/shop/slots lists bookable slots (public) or full detail for a
signed-in admin. add_slot takes seats and adds to an existing line;
group lines can change quantity. Checks and writes share one
transaction. Migration moves existing holds, drops the unique index and
slot status/heldUntil/order, and makes slots signed-in only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaXE9U7AmW3dfD2w6cbLfk
2026-10-24 08:26:37 +00:00
773fecc090 Shop: move commerce logic into PocketBase hooks; public app unprivileged
The public (internet-facing) app logged in as the PocketBase superuser and
held the Stripe secret key, so any bug in it could become full control of
the database. Baskets, slot holds, Stripe PaymentIntents, the webhook that
creates orders, and the payment-result lookup now run in PocketBase JS
hooks (pocketbase/pb_hooks/shop, routes under /api/shop/*, plus a cron
that releases expired holds every minute).

The public app's routes keep their URLs but only proxy to those routes and
manage the basket cookie; it has no PocketBase or Stripe secret. Booking
emails are still rendered and sent by the public app (same renderer as the
admin preview) from order data the webhook hook returns; it records the
outcome via a narrow endpoint guarded by INTERNAL_API_SECRET.

Also: slot add and order creation are now transactional; shop listings
load anonymously (already public via API rules); shop API errors always
reach the browser as JSON; the superuser client and stripe package are
removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
2026-10-06 12:34:58 +00:00
1f929c68ca Lock order_lines writes (they were public)
order_lines had empty create/update/delete rules, so anyone could forge,
edit or delete the line items of real orders through the REST API. Writes
are now superuser-only (migration + pb_schema.json).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
2026-10-06 12:34:51 +00:00
3308f2f85f Public site: readable text on brand-coloured buttons
Hero, Shop, Checkout, checkout-return and the header logo fallback used
white text on the site Primary; on a light Primary that was unreadable.
They now use primary-content (auto-contrast, see $shared/theme).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
2026-10-06 12:06:05 +00:00
cd66d61f6f Public pages: build slug filters with pb.filter
The URL slug was interpolated into the filter string, so a crafted URL
could rewrite the query (e.g. make any path serve a page). API rules
still limited it to published pages, so no drafts leaked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
2026-10-06 12:06:05 +00:00
91e3e916d8 Shop block: share item loading with the admin preview, never render blank
The admin preview never received items/slots/events, so Shop and Upcoming
calendar blocks were empty there. loadShopData() (shared) now feeds both
the public layout and a new /preview loader.

A Shop block with nothing to show (no active items, a filter matching
none, or commerce data unavailable because POCKETBASE_ADMIN_* is unset)
now says so instead of rendering an empty section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
2026-10-06 12:06:05 +00:00
fb2157bbe0 Public site: add a mobile menu (side drawer)
Below md the header hid its nav links with nothing in their place, so
phones had no way to navigate. A ☰ button now opens a drawer from the
right (native modal <dialog>: focus trap, Escape, inert page) with the
links, basket and booking button. It closes on backdrop tap, Escape and
navigation; the current page is marked in both menus.

The booking button now uses --color-primary-content, so a light brand
colour gets dark text instead of unreadable white.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
2026-10-06 11:45:44 +00:00
3399daf951 Theme: admin and site colours follow Site design, rendered server-side
- Admin primary/secondary now follow the site's Primary/Accent colours
  (owner's request), replacing the fixed admin sage. Text on them is picked
  automatically (white or dark, whichever contrasts more), which keeps the
  earlier low-contrast problem from coming back with light brand colours;
  brand colour is no longer used as text (active nav item, placeholders).
- New $shared/theme renders the colours as a <style> in <head> during
  SSR. The public site used to apply them in onMount, so every page load
  flashed the default colours first.
- DaisyUI `secondary` now maps to the site Accent everywhere — the
  button block's "Secondary" variant was DaisyUI's default pink.
- Colours are admin-entered text placed inside <style>, so only plain
  colour values are accepted (hex, named, rgb()/hsl()/oklch()…); anything
  else falls back to the default.
- Saving colours in Site design refreshes the admin theme immediately.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
2026-10-06 11:32:21 +00:00
Jakub Dorfman
96828994e1 added mailing through Brevo and node mailer, also a email editor, with
their custom blocks and renderers
2026-09-28 19:25:19 +02:00
Jakub Dorfman
478a5fd466 moved shared code to the shared package 2026-08-19 19:18:10 +02:00
Jakub Dorfman
1027da989e moved page rendering to a different service and access is now behind
admin.DOMAIN
www.DOMAIN
db.DOMAIN
2026-08-19 17:58:19 +02:00