Add optional user_id field to the progress collection. When a user is authenticated, progress is keyed by user_id instead of session_id, making it portable across devices and browsers. Anonymous reading still works via session_id as before. On login or registration, any progress accumulated under the anonymous session is merged into the user's account (most-recent timestamp wins), so chapters read before logging in are not lost. - scripts/pb-init.sh: add user_id field to progress collection schema - scraper/internal/storage/pocketbase.go: add user_id to EnsureCollections - ui/src/lib/server/pocketbase.ts: Progress interface gains user_id; getProgress/allProgress/setProgress accept optional userId and query/write by user_id when present; add mergeSessionProgress() helper - ui/src/routes/login/+page.server.ts: call mergeSessionProgress after successful login and registration (fire-and-forget, non-fatal) - ui/src/routes/api/progress/+server.ts: pass locals.user?.id to setProgress - ui/src/routes/books/+page.server.ts: pass locals.user?.id to allProgress - ui/src/routes/books/[slug]/+page.server.ts: pass locals.user?.id to getProgress
sv
Everything you need to build a Svelte project, powered by sv.
Creating a project
If you're seeing this, you've probably already done this step. Congrats!
# create a new project
npx sv create my-app
To recreate this project with the same configuration:
# recreate this project
npx sv@0.12.4 create --template minimal --types ts --install npm ui
Developing
Once you've created a project and installed dependencies with npm install (or pnpm install or yarn), start a development server:
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
Building
To create a production version of your app:
npm run build
You can preview the production build with npm run preview.
To deploy your app, you may need to install an adapter for your target environment.