| app | ||
| .dockerignore | ||
| .env.example | ||
| docker-compose.yml | ||
| Dockerfile | ||
| pb_schema.json | ||
| README.md | ||
Massage Studio Website CMS
A full-stack SvelteKit CMS for a single-operator massage studio. PocketBase provides auth, database records, and image storage. The public site is warm and minimal; the admin UI uses DaisyUI components.
Stack
- SvelteKit + SSR
- PocketBase REST API via the
pocketbaseSDK - Tailwind CSS v4 + DaisyUI
- Docker Compose with two services:
appandpocketbase
Local development
- Install Node.js
22.xor another version accepted by SvelteKit's Vite plugin. - Copy the app env file:
cp app/.env.example app/.env - Start PocketBase on port
8090. With Docker:docker compose up pocketbase - In another terminal:
cd app npm install npm run dev - Visit
http://localhost:5173.
Docker Compose
Run the full stack:
docker compose up --build
If dependency installation is slow on the first build, enable BuildKit explicitly:
DOCKER_BUILDKIT=1 docker compose build --progress=plain app
docker compose up
Subsequent builds reuse the npm cache declared in the Dockerfile.
- Public SvelteKit app:
http://localhost:3000 - PocketBase admin UI:
http://localhost:8090/_/
The app container uses two PocketBase URLs:
POCKETBASE_INTERNAL_URL=http://pocketbase:80for server-side SvelteKit calls from the app container when using the includedspectado/pocketbaseimage.PUBLIC_POCKETBASE_URL=http://localhost:8090for browser-side admin uploads and public file URLs during local Docker development.
In production, set PUBLIC_POCKETBASE_URL to the browser-accessible PocketBase URL, or to the reverse-proxied PocketBase path/origin you expose publicly.
PocketBase setup
- Open
http://localhost:8090/_/. - Create the first PocketBase admin user when prompted.
- Import
pb_schema.jsonfrom the PocketBase admin UI collection settings/import flow. This file uses the newer PocketBasefieldsschema format; if PocketBase still reportsInvalid collections configuration, create the three collections manually using the fields below. - Create starter records:
pages: slughome, titleHome,published: true, and a blocks JSON array.globals: keyheader, data matching the header JSON in the project prompt.globals: keyfooter, data matching the footer JSON in the project prompt.
If the globals records do not exist, the app falls back to safe defaults and the admin globals page will create them.
Manual collection fields fallback
If schema import fails because of a PocketBase version mismatch, create these collections manually:
pagesslug: text, required, uniquetitle: text, requiredblocks: jsonpublished: bool
globalskey: text, required, uniquedata: json
mediafile: file, required, max select1, image mime typesalt: text
Authentication
Admin routes live under /admin. Login accepts either:
- a PocketBase admin account, or
- a record from a
usersauth collection if you create one.
All /admin routes except /admin/login are guarded in src/hooks.server.ts.
CMS routes
/admin/login— sign in/admin/pages— list/create pages/admin/pages/[slug]— block editor with draft preview/admin/globals— header/footer editor
Public routes
/renderspages.slug = "home"/[slug]renders any other published page- Unpublished pages return
404
Notes
- Admin image uploads create records in the
mediacollection and store PocketBase file URLs in block JSON. - Draft preview writes current blocks to
sessionStorageand opens/previewin an iframe. - The page editor includes draggable reordering using native HTML drag events for compatibility; the requested DnD packages are installed and can be swapped in later if desired.