Skip to content

Migrate to SvelteKit remote functions#38

Open
nevthereal wants to merge 2 commits into
mainfrom
rpc-migration-3-lol
Open

Migrate to SvelteKit remote functions#38
nevthereal wants to merge 2 commits into
mainfrom
rpc-migration-3-lol

Conversation

@nevthereal
Copy link
Copy Markdown
Owner

@nevthereal nevthereal commented Apr 5, 2026

Summary

  • Migrates the app from +page.server.ts actions/load flows to SvelteKit remote functions with server-driven refreshes.
  • Refactors the challenge, club, profile, and session features to use the new remote data layer and updated UI components.
  • Updates supporting auth, form, and shared UI modules to match the new SvelteKit/Better Auth setup.
  • Refreshes package versions and build/config files, including the DB push workflow and lockfile.

Testing

  • Not run
  • Suggested checks: run the app locally and verify sign-in, club creation/join flows, challenge creation/editing, and profile updates.
  • Suggested checks: run the relevant test suite and confirm the DB push workflow still succeeds with bun db:push --force.

Summary by CodeRabbit

  • Documentation

    • Added guidance for AI coding agents on referencing internal dependency source code.
  • Chores

    • Reorganized database schema migration files and metadata snapshots.
    • Updated project configuration files.

- Replace page/server actions with remote modules
- Update SvelteKit and related dependencies
- Remove obsolete drizzle migration files and form helpers
- Remove client-side `.updates(...)` calls in favor of remote refreshes
- Move club join handling into a server load route and use 303 redirects
- Update challenge navigation to use resolved paths
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 5, 2026

📝 Walkthrough

Walkthrough

This pull request removes all database migration files and schema snapshots from the drizzle/ directory while adding a new AGENTS.md documentation file and updating .gitignore to exclude the opensrc/ directory. The migration cleanup eliminates 24 sequential migration steps and corresponding metadata artifacts.

Changes

Cohort / File(s) Summary
Configuration
.gitignore
Added opensrc/ directory to ignore patterns.
Documentation
AGENTS.md
New file with instructions for AI coding agents to reference internal dependencies via opensrc/ using npx opensrc commands and opensrc/sources.json.
Database Migrations
drizzle/000[0-9]_*.sql, drizzle/001[0-9]_*.sql, drizzle/002[0-3]_*.sql
Removed 24 sequential SQL migration files (0000–0023) that progressively built and modified the database schema, including table definitions, column additions/modifications, constraint changes, and index creation across user, challenge, club, entry, discipline, code, and related junction tables.
Migration Metadata
drizzle/meta/000[0-9]_snapshot.json, drizzle/meta/001[0-9]_snapshot.json, drizzle/meta/002[0-3]_snapshot.json
Removed 24 Drizzle ORM schema snapshot JSON files (0000–0023) containing persisted PostgreSQL schema state including table definitions, column metadata, indexes, foreign keys, unique constraints, and enum definitions for public.role and public.gender.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A rabbit's note on schemas past,
Migrations swept away so fast,
Like carrots cleared from yesterday's feast,
The garden grows anew, at least!
Fresh paths await, no weight to bear,
For clean slates need the gentlest care. 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Migrate to SvelteKit remote functions' directly and clearly describes the primary objective of the changeset—migrating from traditional +page.server.ts patterns to SvelteKit remote functions, which is the main architectural change across the entire PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rpc-migration-3-lol
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch rpc-migration-3-lol

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@AGENTS.md`:
- Around line 9-11: Update AGENTS.md to clarify that the opensrc/ directory (and
opensrc/sources.json) may be missing in fresh clones and add a clear
bootstrap/fallback section instructing agents to (1) run the provided bootstrap
script or command (mention the repository's bootstrap script name if present,
e.g., bootstrap.sh or setup.sh) or (2) fetch the canonical sources.json from the
project’s upstream URL or create a minimal sources.json with required package
entries before proceeding; reference opensrc/ and opensrc/sources.json
explicitly and show the exact fallback commands/URLs or the minimal JSON
structure to use.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0230efae-6849-4a29-ae41-80502e66f393

📥 Commits

Reviewing files that changed from the base of the PR and between 5f9aaa2 and bf1db79.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (145)
  • .gitignore
  • AGENTS.md
  • drizzle/0000_luxuriant_the_hand.sql
  • drizzle/0001_nervous_talos.sql
  • drizzle/0002_gigantic_hawkeye.sql
  • drizzle/0003_late_vin_gonzales.sql
  • drizzle/0004_minor_toad.sql
  • drizzle/0005_even_doorman.sql
  • drizzle/0006_uneven_adam_warlock.sql
  • drizzle/0007_nebulous_flatman.sql
  • drizzle/0008_big_christian_walker.sql
  • drizzle/0009_low_mac_gargan.sql
  • drizzle/0010_normal_jigsaw.sql
  • drizzle/0011_wide_madame_masque.sql
  • drizzle/0012_fast_prima.sql
  • drizzle/0013_parched_rachel_grey.sql
  • drizzle/0014_parallel_christian_walker.sql
  • drizzle/0015_free_rattler.sql
  • drizzle/0016_secret_sir_ram.sql
  • drizzle/0017_yellow_synch.sql
  • drizzle/0018_absent_skaar.sql
  • drizzle/0019_premium_tomas.sql
  • drizzle/0020_young_skrulls.sql
  • drizzle/0021_fancy_midnight.sql
  • drizzle/0022_fixed_captain_cross.sql
  • drizzle/0023_faulty_the_hood.sql
  • drizzle/0024_exotic_madame_hydra.sql
  • drizzle/meta/0000_snapshot.json
  • drizzle/meta/0001_snapshot.json
  • drizzle/meta/0002_snapshot.json
  • drizzle/meta/0003_snapshot.json
  • drizzle/meta/0004_snapshot.json
  • drizzle/meta/0005_snapshot.json
  • drizzle/meta/0006_snapshot.json
  • drizzle/meta/0007_snapshot.json
  • drizzle/meta/0008_snapshot.json
  • drizzle/meta/0009_snapshot.json
  • drizzle/meta/0010_snapshot.json
  • drizzle/meta/0011_snapshot.json
  • drizzle/meta/0012_snapshot.json
  • drizzle/meta/0013_snapshot.json
  • drizzle/meta/0014_snapshot.json
  • drizzle/meta/0015_snapshot.json
  • drizzle/meta/0016_snapshot.json
  • drizzle/meta/0017_snapshot.json
  • drizzle/meta/0018_snapshot.json
  • drizzle/meta/0019_snapshot.json
  • drizzle/meta/0020_snapshot.json
  • drizzle/meta/0021_snapshot.json
  • drizzle/meta/0022_snapshot.json
  • drizzle/meta/0023_snapshot.json
  • drizzle/meta/0024_snapshot.json
  • drizzle/meta/_journal.json
  • e2e/demo.test.ts
  • package.json
  • src/app.css
  • src/lib/components/DisciplineForm.svelte
  • src/lib/components/EntryCard.svelte
  • src/lib/components/EntryForm.svelte
  • src/lib/components/Leaderboard.svelte
  • src/lib/components/ui/alert-dialog/index.ts
  • src/lib/components/ui/badge/index.ts
  • src/lib/components/ui/button/index.ts
  • src/lib/components/ui/calendar/index.ts
  • src/lib/components/ui/card/index.ts
  • src/lib/components/ui/chart/chart-container.svelte
  • src/lib/components/ui/chart/chart-utils.ts
  • src/lib/components/ui/chart/index.ts
  • src/lib/components/ui/command/index.ts
  • src/lib/components/ui/data-table/data-table.svelte.ts
  • src/lib/components/ui/data-table/index.ts
  • src/lib/components/ui/data-table/render-helpers.ts
  • src/lib/components/ui/dialog/index.ts
  • src/lib/components/ui/dropdown-menu/index.ts
  • src/lib/components/ui/field/field-description.svelte
  • src/lib/components/ui/field/field-error.svelte
  • src/lib/components/ui/field/field-group.svelte
  • src/lib/components/ui/field/field-label.svelte
  • src/lib/components/ui/field/field-legend.svelte
  • src/lib/components/ui/field/field-separator.svelte
  • src/lib/components/ui/field/field-set.svelte
  • src/lib/components/ui/field/field.svelte
  • src/lib/components/ui/field/index.ts
  • src/lib/components/ui/form/form-button.svelte
  • src/lib/components/ui/form/form-description.svelte
  • src/lib/components/ui/form/form-element-field.svelte
  • src/lib/components/ui/form/form-field-errors.svelte
  • src/lib/components/ui/form/form-field.svelte
  • src/lib/components/ui/form/form-fieldset.svelte
  • src/lib/components/ui/form/form-label.svelte
  • src/lib/components/ui/form/form-legend.svelte
  • src/lib/components/ui/form/index.ts
  • src/lib/components/ui/input-otp/index.ts
  • src/lib/components/ui/input/index.ts
  • src/lib/components/ui/label/index.ts
  • src/lib/components/ui/popover/index.ts
  • src/lib/components/ui/range-calendar/index.ts
  • src/lib/components/ui/select/index.ts
  • src/lib/components/ui/separator/index.ts
  • src/lib/components/ui/sheet/index.ts
  • src/lib/components/ui/skeleton/index.ts
  • src/lib/components/ui/sonner/index.ts
  • src/lib/components/ui/sonner/sonner.svelte
  • src/lib/components/ui/spinner/index.ts
  • src/lib/components/ui/table/index.ts
  • src/lib/components/ui/tabs/index.ts
  • src/lib/components/ui/tooltip/index.ts
  • src/lib/remote/challenges.remote.ts
  • src/lib/remote/clubs.remote.ts
  • src/lib/remote/profile.remote.ts
  • src/lib/remote/session.remote.ts
  • src/lib/server/request-user.ts
  • src/lib/zod.ts
  • src/routes/+layout.server.ts
  • src/routes/+layout.svelte
  • src/routes/+page.server.ts
  • src/routes/+page.svelte
  • src/routes/clubs/+layout.server.ts
  • src/routes/clubs/+page.server.ts
  • src/routes/clubs/+page.svelte
  • src/routes/clubs/[clubId]/+page.server.ts
  • src/routes/clubs/[clubId]/+page.svelte
  • src/routes/clubs/[clubId]/challenge/[challengeId]/+layout.server.ts
  • src/routes/clubs/[clubId]/challenge/[challengeId]/+layout.svelte
  • src/routes/clubs/[clubId]/challenge/[challengeId]/+page.server.ts
  • src/routes/clubs/[clubId]/challenge/[challengeId]/+page.svelte
  • src/routes/clubs/[clubId]/challenge/[challengeId]/activity/+page.server.ts
  • src/routes/clubs/[clubId]/challenge/[challengeId]/activity/+page.svelte
  • src/routes/clubs/[clubId]/challenge/[challengeId]/disciplines/+page.server.ts
  • src/routes/clubs/[clubId]/challenge/[challengeId]/disciplines/+page.svelte
  • src/routes/clubs/[clubId]/challenge/[challengeId]/members/+page.server.ts
  • src/routes/clubs/[clubId]/challenge/[challengeId]/members/+page.svelte
  • src/routes/clubs/[clubId]/challenge/[challengeId]/members/[memberId]/+page.server.ts
  • src/routes/clubs/[clubId]/challenge/[challengeId]/members/[memberId]/+page.svelte
  • src/routes/clubs/create/+page.server.ts
  • src/routes/clubs/create/+page.svelte
  • src/routes/clubs/join/+page.server.ts
  • src/routes/clubs/join/+page.svelte
  • src/routes/clubs/join/[code]/+page.server.ts
  • src/routes/clubs/join/[code]/+page.svelte
  • src/routes/profile/+page.server.ts
  • src/routes/profile/+page.svelte
  • src/routes/profile/edit/+page.server.ts
  • src/routes/profile/edit/+page.svelte
  • svelte.config.js
💤 Files with no reviewable changes (49)
  • drizzle/0013_parched_rachel_grey.sql
  • drizzle/0004_minor_toad.sql
  • drizzle/0017_yellow_synch.sql
  • drizzle/0006_uneven_adam_warlock.sql
  • drizzle/0014_parallel_christian_walker.sql
  • drizzle/0003_late_vin_gonzales.sql
  • drizzle/0021_fancy_midnight.sql
  • drizzle/0009_low_mac_gargan.sql
  • drizzle/0023_faulty_the_hood.sql
  • drizzle/0024_exotic_madame_hydra.sql
  • drizzle/0018_absent_skaar.sql
  • drizzle/0001_nervous_talos.sql
  • drizzle/0005_even_doorman.sql
  • drizzle/0019_premium_tomas.sql
  • drizzle/0016_secret_sir_ram.sql
  • drizzle/meta/0000_snapshot.json
  • drizzle/0011_wide_madame_masque.sql
  • drizzle/0007_nebulous_flatman.sql
  • drizzle/meta/0007_snapshot.json
  • drizzle/meta/0001_snapshot.json
  • drizzle/meta/0015_snapshot.json
  • drizzle/0002_gigantic_hawkeye.sql
  • drizzle/meta/0003_snapshot.json
  • drizzle/0015_free_rattler.sql
  • drizzle/0008_big_christian_walker.sql
  • drizzle/meta/0006_snapshot.json
  • drizzle/meta/0019_snapshot.json
  • drizzle/meta/0005_snapshot.json
  • drizzle/meta/0004_snapshot.json
  • drizzle/meta/0022_snapshot.json
  • drizzle/meta/0018_snapshot.json
  • drizzle/meta/0011_snapshot.json
  • drizzle/0010_normal_jigsaw.sql
  • drizzle/meta/0017_snapshot.json
  • drizzle/0022_fixed_captain_cross.sql
  • drizzle/meta/0023_snapshot.json
  • drizzle/meta/0008_snapshot.json
  • drizzle/0000_luxuriant_the_hand.sql
  • drizzle/meta/0012_snapshot.json
  • drizzle/meta/0009_snapshot.json
  • drizzle/meta/0020_snapshot.json
  • drizzle/meta/0014_snapshot.json
  • drizzle/meta/0002_snapshot.json
  • drizzle/meta/0021_snapshot.json
  • drizzle/meta/0016_snapshot.json
  • drizzle/meta/0013_snapshot.json
  • drizzle/0020_young_skrulls.sql
  • drizzle/0012_fast_prima.sql
  • drizzle/meta/0010_snapshot.json

Comment thread AGENTS.md
Comment on lines +9 to +11
Source code for dependencies is available in `opensrc/` for deeper understanding of implementation details.

See `opensrc/sources.json` for the list of available packages and their versions.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Clarify that opensrc/ may be absent in fresh clones.

AGENTS.md currently reads as if opensrc/sources.json is always present, but opensrc/ is now gitignored. Add an explicit bootstrap/fallback step so agents know how to proceed when the directory is missing.

📝 Suggested doc adjustment
-Source code for dependencies is available in `opensrc/` for deeper understanding of implementation details.
-
-See `opensrc/sources.json` for the list of available packages and their versions.
+Source code for dependencies can be stored in `opensrc/` for deeper understanding of implementation details.
+
+If `opensrc/` is missing (e.g., fresh clone), fetch what you need with `npx opensrc ...`.
+When present, see `opensrc/sources.json` for the list of available packages and their versions.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Source code for dependencies is available in `opensrc/` for deeper understanding of implementation details.
See `opensrc/sources.json` for the list of available packages and their versions.
Source code for dependencies can be stored in `opensrc/` for deeper understanding of implementation details.
If `opensrc/` is missing (e.g., fresh clone), fetch what you need with `npx opensrc ...`.
When present, see `opensrc/sources.json` for the list of available packages and their versions.
🧰 Tools
🪛 LanguageTool

[style] ~9-~9: Consider a different adjective to strengthen your wording.
Context: ...ndencies is available in opensrc/ for deeper understanding of implementation details...

(DEEP_PROFOUND)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENTS.md` around lines 9 - 11, Update AGENTS.md to clarify that the opensrc/
directory (and opensrc/sources.json) may be missing in fresh clones and add a
clear bootstrap/fallback section instructing agents to (1) run the provided
bootstrap script or command (mention the repository's bootstrap script name if
present, e.g., bootstrap.sh or setup.sh) or (2) fetch the canonical sources.json
from the project’s upstream URL or create a minimal sources.json with required
package entries before proceeding; reference opensrc/ and opensrc/sources.json
explicitly and show the exact fallback commands/URLs or the minimal JSON
structure to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant