oskar-gmerek / surreal-sveltekit Goto Github PK
View Code? Open in Web Editor NEWA Starter Kit with SurrealDB and Svelte [ SvelteKit ], featuring Authentication and CRUD Operations + Realtime
License: MIT License
A Starter Kit with SurrealDB and Svelte [ SvelteKit ], featuring Authentication and CRUD Operations + Realtime
License: MIT License
I'm learning Sveltekit to build a Tauri app and I believe Surrealdb is a good choice for my use case. However, I've not found yet an example of an app that uses these three stacks together. Have you ever tried this before? Would you consider creating a version of your app using Tauri?
npm run multitaskum:developum
> [email protected] multitaskum:developum
> docker compose up -d && vite dev --host
[+] Running 1/0
✔ Container database Started 0.0s
VITE v4.5.1 ready in 902 ms
➜ Local: http://localhost:5173/
➜ Network: http://10.0.0.243:5173/
➜ Network: http://10.0.0.234:5173/
➜ Network: http://172.19.0.1:5173/
➜ press h to show help
I go to http://localhost:5173/ in the browser and see the following:
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^
Error: connect ECONNREFUSED 127.0.0.1:8000
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 8000
}
Node.js v18.18.0
BTW, I am on Ubuntu 22.04.3 LTS
It would be useful to have providers for auth stuff, mostly because people can abuse create user functionality, and spam the DB with them. It's also the standard for most apps to have those.
If using realtime, when on the clientside, will the token, user, password, database url be exposed?
const posts = createStore('my_posts', data.my_posts);
$: $posts;
observeLive('post', posts);
After installing the app with pnpm i
and making sure that my database was running, I ran pnpm dev
.
It says that it is an issue:
> vite dev
▲ [WARNING] Cannot find base config file "./.svelte-kit/tsconfig.json" [tsconfig.json]
tsconfig.json:2:12:
2 │ "extends": "./.svelte-kit/tsconfig.json",
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Forced re-optimization of dependencies
VITE v5.0.12 ready in 1605 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h + enter to show help
11:01:40 PM [vite] Error when evaluating SSR module /src/master.css.ts: failed to import "@master/css"
|- Error: Cannot find module '@master/css' imported from '/home/vlada/projects/surreal-sveltekit/src/master.css.ts'
at nodeImport (file:///home/vlada/projects/surreal-sveltekit/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:50892:25)
at ssrImport (file:///home/vlada/projects/surreal-sveltekit/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:50799:30)
at eval (/home/vlada/projects/surreal-sveltekit/src/master.css.ts:3:50)
at instantiateModule (file:///home/vlada/projects/surreal-sveltekit/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:50861:15)
11:01:40 PM [vite] Error when evaluating SSR module /src/hooks.server.ts: failed to import "/src/master.css.ts"
|- Error: Cannot find module '@master/css' imported from '/home/vlada/projects/surreal-sveltekit/src/master.css.ts'
at nodeImport (file:///home/vlada/projects/surreal-sveltekit/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:50892:25)
at ssrImport (file:///home/vlada/projects/surreal-sveltekit/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:50799:30)
at eval (/home/vlada/projects/surreal-sveltekit/src/master.css.ts:3:50)
at instantiateModule (file:///home/vlada/projects/surreal-sveltekit/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:50861:15)
Error: Cannot find module '@master/css' imported from '/home/vlada/projects/surreal-sveltekit/src/master.css.ts'
at nodeImport (file:///home/vlada/projects/surreal-sveltekit/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:50892:25)
at ssrImport (file:///home/vlada/projects/surreal-sveltekit/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:50799:30)
at eval (/home/vlada/projects/surreal-sveltekit/src/master.css.ts:3:50)
at instantiateModule (file:///home/vlada/projects/surreal-sveltekit/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:50861:15) {
code: 'ERR_MODULE_NOT_FOUND'
}
It seems like sveltekit 2.0 is not cool with master/css
library, but still, this is easy to reproduce and to test with a fresh clone.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.