ethanniser / the-beth-stack Goto Github PK
View Code? Open in Web Editor NEWAn opinionated hypermedia-driven architecture for building web apps
License: MIT License
An opinionated hypermedia-driven architecture for building web apps
License: MIT License
bun version: 1.0.0
platform: arch linux 6.5.2-arch1-1 (btw)
steps to reproduce:
git clone https://github.com/ethanniser/the-beth-stack.git
bun install
echo "DATABASE_URL=file:test.db" > .env
bun run dev
the-beth-stack % bun run dev
$ concurrently "bun run --watch src/index.tsx" "bun run tw:dev"
[1] $ bunx tailwindcss -i ./src/styles.css -o ./tailwind-gen/styles.css --watch
[0] [0.01ms] ".env"
[0] 121 | throw e;
[0] 122 | }
[0] 123 | }
[0] 124 | }
[0] 125 |
[0] 126 | err = new Error(
[0] ^
[0] error: Could not locate the bindings file. Tried:
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/build/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/build/Debug/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/build/Release/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/out/Debug/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/Debug/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/out/Release/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/Release/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/build/default/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/compiled/18.15.0/linux/x64/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/addon-build/release/install-root/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/addon-build/debug/install-root/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/addon-build/default/install-root/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/lib/binding/node-v108-linux-x64/better_sqlite3.node
[0] at bindings (/home/caleb/prog/the-beth-stack/node_modules/bindings/bindings.js:126:8)
[0] at new Database (/home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/lib/database.js:48:28)
[0] at _createClient (/home/caleb/prog/the-beth-stack/node_modules/@libsql/client/lib-esm/sqlite3.js:34:15)
[0] at /home/caleb/prog/the-beth-stack/src/db/index.ts:5:15
[0] 121 | throw e;
[0] 122 | }
[0] 123 | }
[0] 124 | }
[0] 125 |
[0] 126 | err = new Error(
[0] ^
[0] error: Could not locate the bindings file. Tried:
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/build/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/build/Debug/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/build/Release/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/out/Debug/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/Debug/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/out/Release/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/Release/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/build/default/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/compiled/18.15.0/linux/x64/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/addon-build/release/install-root/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/addon-build/debug/install-root/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/addon-build/default/install-root/better_sqlite3.node
[0] → /home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/lib/binding/node-v108-linux-x64/better_sqlite3.node
[0] at bindings (/home/caleb/prog/the-beth-stack/node_modules/bindings/bindings.js:126:8)
[0] at new Database (/home/caleb/prog/the-beth-stack/node_modules/better-sqlite3/lib/database.js:48:28)
[0] at _createClient (/home/caleb/prog/the-beth-stack/node_modules/@libsql/client/lib-esm/sqlite3.js:34:15)
[0] at /home/caleb/prog/the-beth-stack/src/db/index.ts:5:15
[1]
[1] Rebuilding...
[1]
[1] Done in 176ms.
fwiw, I'm not encountering this issue when running on node instead of bun.
I'm trying to start a new project using the create-beth-app CLI. When I use bunx create-beth-app@latest
I get an error as below, this error also occurs when providing a name for the project, such as bunx create-beth-app@latest myproject
:
fatal: destination path '.' already exists and is not an empty directory.
error: undefined
I installed bun using npm & I'm using WSL2.
When I try to run the script, it says "bunx: command not found."
This itself is workaroundable, just use "bun x," so, "bun x drizzle-kit push:sqlite," but this itself leads to:
[5.18ms] ".env"
No config path provided, using default 'drizzle.config.ts'
Reading config file '/mnt/c/Users/Roman/code/beth-stack/drizzle.config.ts'
drizzle-kit: v0.19.9
drizzle-orm: v0.27.2
43219 | code;
43220 | constructor(message, code, cause) {
43221 | if (code !== void 0) {
43222 | message = `${code}: ${message}`;
43223 | }
43224 | super(message, { cause });
^
LibsqlError: HRANA_WEBSOCKET_ERROR: Unexpected server response: 401
code: "HRANA_WEBSOCKET_ERROR"
at new LibsqlError (/mnt/c/Users/Roman/code/beth-stack/node_modules/drizzle-kit/index.cjs:43224:8)
at mapHranaError (/mnt/c/Users/Roman/code/beth-stack/node_modules/drizzle-kit/index.cjs:48336:11)
at /mnt/c/Users/Roman/code/beth-stack/node_modules/drizzle-kit/index.cjs:48470:16
turso db show beth-stack-db
Name: beth-stack-db
URL: libsql://beth-stack-db-romanadavis.turso.io
ID: 96a9f76f-2718-11ee-b4f9-e6df71830bc6
Locations: fra
Size: 12 kB
Database Instances:
NAME TYPE LOCATION
possible-starfire primary fra
and
turso db tokens create beth-stack-db
eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2ODk5MjU1MzMsImlkIjoiOTZhOWY3NmYtMjcxOC0xMWVlLWI0ZjktZTZkZjcxODMwYmM2In0.-NgC4fK_WXVMHFm5t94MU_qgI8im6tRLtrQPHRDorwMNAdAnoPwDauuQVGSwQZRbqhODuOnnc3nBJJHQ0kmaCg
give me
DATABASE_URL="libsql://beth-stack-db-romanadavis.turso.io"
DATABASE_AUTH_TOKEN="eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2ODk5MjU1MzMsImlkIjoiOTZhOWY3NmYtMjcxOC0xMWVlLWI0ZjktZTZkZjcxODMwYmM2In0.-NgC4fK_WXVMHFm5t94MU_qgI8im6tRLtrQPHRDorwMNAdAnoPwDauuQVGSwQZRbqhODuOnnc3nBJJHQ0kmaCg"
I've tried with and without quotes. Any ideas?
I don't know if this is replicable, but I tried doing in a parallel project, and cloning your repository, and this happened:
code/beth_stack [main●] » bun run src/index.tsx
error: Could not resolve: "react". Maybe you need to "bun install"?
import { Elysia, t } from "elysia";
^
code/beth_stack/src/index.tsx:1:1
Is there any way to get around this?
bun: 0.6.2
node: 18.17.1
os: linux
i got that error when i try bunx create-beth-app@latest beth
error: Cannot find package "commander" from "/tmp/create-beth-app@latest--bunx/node_modules/create-beth-app/src/commander.ts"
Turso just released a new integration with Drizzle Studio, so there's no need for drizzle-studio as a project dependency.
I think that right now we have to create databases under an organization.
In the API wrapper, in the create
method, the path is /v1/databases
, but that doesn't exist, the path is /v1/organizations/:org_slug/databases
First, nice app, enjoyed it as my introduction to the BETH stack, as well as your video.
Second, just starting a discussion about a vulnerability on the app: when inputing a JS script (e.g. `<script>alert(1)</script>) it gets executed. Is there some remediation to that? How is it done on the BETH stack?
$ bunx drizzle-kit push:sqlite
No config path provided, using default path
Reading config file '/home/[email protected]/Desktop/projects/the-beth-stack/drizzle.config.ts'
drizzle-kit: v0.19.13
drizzle-orm: v0.27.2
/home/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:48441
return new LibsqlError(e.message, code, e);
^
LibsqlError: HRANA_WEBSOCKET_ERROR: unable to verify the first certificate
at mapHranaError (/home/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:48441:12)
at #openStream (/home/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:48575:17)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async HranaClient.execute (/home/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:48474:29)
at async TursoSqlite.query (/home/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:42938:21)
at async fromDatabase3 (/home/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:12938:23)
at async sqlitePushIntrospect (/home/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:51949:19)
at async Command.<anonymous> (/home/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:53436:31) {
code: 'HRANA_WEBSOCKET_ERROR',
[cause]: WebSocketError: unable to verify the first certificate
at #onSocketError (/home/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:48099:25)
at _WebSocket.<anonymous> (/home/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:48022:78)
at callListener (/home/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:45693:18)
at _WebSocket.onError (/home/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:45647:13)
at _WebSocket.emit (node:events:514:28)
at emitErrorAndClose (/home/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:46607:17)
at ClientRequest.<anonymous> (/home/[email protected]/Desktop/projects/the-beth-stack/node_modules/drizzle-kit/index.cjs:46504:9)
at ClientRequest.emit (node:events:514:28)
at TLSSocket.socketErrorListener (node:_http_client:501:9)
at TLSSocket.emit (node:events:514:28)
}
Node.js v18.17.1
error: "drizzle-kit" exited with code 1 (SIGHUP)
error: script "db:push" exited with code 1 (SIGHUP)
Anyone knows how to fix?
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.