This is a very simple template for SvelteKit and PocketBase that only does client side authentication (CSR/SPA). This is based on Gani Georgiev's recommendation which makes sense to me.
I couldn't find many PocketBase/SvelteKit CSR examples on Github. The ones I did find, seemed more complicated than necessary. I'm trying to keep this one as simple as possible so that beginners (eg. me!) can easily understand how it works.
Improvements and suggestions welcome.
Requires a working PocketBase installation with at least one user in the users
table.
.env.example
to .env
PUBLIC_POCKETBASE_URL
pnpm i
pnpm dev
/app/+layout.ts
to force authentication for all routes beneath /app
. I'm not sure that this is safe, but it seems to work? It seems like it would be better to use hooks, but I'm not sure if that's possible with +hooks.client.ts
.