Skip to content

Add SSR-safe SvelteKit todo example#5

Open
ayushsri-dev wants to merge 1 commit into
arpitkhandelwal12:mainfrom
ayushsri-dev:final-sveltekit-example
Open

Add SSR-safe SvelteKit todo example#5
ayushsri-dev wants to merge 1 commit into
arpitkhandelwal12:mainfrom
ayushsri-dev:final-sveltekit-example

Conversation

@ayushsri-dev
Copy link
Copy Markdown

This PR adds a robust SvelteKit + ZerithDB example application demonstrating browser-safe database initialization, SSR-safe SDK loading, IndexedDB persistence, and reactive CRUD operations.

Issue #83

The example showcases the recommended integration pattern for using ZerithDB inside SvelteKit applications, including:

  • browser-only initialization using SvelteKit's browser environment checks
  • dynamic SDK imports to avoid SSR runtime issues
  • lightweight browser polyfills required by ZerithDB networking dependencies
  • a clean service-layer abstraction for CRUD operations
  • scoped and global styling separation
  • a documented local-first todo application example

Fixes #


Type of change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🚀 Performance improvement

Checklist

  • My code follows the style guidelines of this project (pnpm format:check, pnpm lint)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works (pnpm test)
  • New and existing unit tests pass locally with my changes
  • I have run pnpm changeset if my change affects published packages

Additional Context

This example was designed to serve as a reference implementation for integrating ZerithDB with SvelteKit while maintaining SSR compatibility and local-first persistence behavior.

The app demonstrates:

  • task creation
  • task updates
  • task deletion
  • IndexedDB persistence across refreshes
  • reactive UI state with Svelte 5 runes

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