Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spinspire/surrealdb-sveltekit-starter
A starter-kit project from which to create your SvelteKit + SurrealDB projects
https://github.com/spinspire/surrealdb-sveltekit-starter
Last synced: 11 days ago
JSON representation
A starter-kit project from which to create your SvelteKit + SurrealDB projects
- Host: GitHub
- URL: https://github.com/spinspire/surrealdb-sveltekit-starter
- Owner: spinspire
- Created: 2022-12-26T03:56:29.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2022-12-26T04:03:44.000Z (almost 2 years ago)
- Last Synced: 2024-11-08T19:43:14.584Z (about 1 month ago)
- Language: Svelte
- Size: 47.9 KB
- Stars: 21
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-surreal - SurrealDB + SvelteKit Starter - Jitesh Doshi. (Starter Kits)
README
A starter-kit project from which to create your SvelteKit + SurrealDB projects
# SurrealDB + SvelteKit Demo
- Run SurrealDB in Docker `docker compose up -d`
- Run SurrealDB client ... `docker compose exec db /surreal sql -c http://localhost:8000 --db test --ns test -u root -p root` and then copy-paste the contents of `db-init/schema.sql` (there should be a better way)
- Run SvelteKit app: `pnpm install; npm run dev`
- Visit http://localhost:5173 and "Sign Up" as a new user (also signs you in)![Sign In / Sign Up](./static/screenshot-signin.png)
- CRUD some todo's.
![CRUD todo's](./static/screenshot-todos.png)
- Sign Out and Sign Up / Sign In as a different user. You should see a completely different list of todo's.
- The above separation of todo records is achived by the following line in `schema.sql` -- `DEFINE FIELD user ON todo TYPE record(user) VALUE $session.sd ASSERT $value != null;`
See https://github.com/surrealdb/surrealdb/discussions/1298#discussioncomment-4495145## Developing & Building
The usual SvelteKit stuff applies.