From dfbcd20ab6d29031a9b7cb13d9a76fd46951db1c Mon Sep 17 00:00:00 2001 From: Stefan ATZLESBERGER Date: Thu, 16 Apr 2026 12:55:18 +0200 Subject: [PATCH] snapshot --- .cursor/.gitignore | 1 + .gitignore | 3 + bun.lock | 3 + package.json | 1 + src/APITester.tsx | 64 --------- src/App.tsx | 33 +---- src/components/NotesApp.tsx | 130 ++++++++++++++++++ src/components/SnippetCard.tsx | 198 ++++++++++++++++++++++++++++ src/index.css | 2 +- src/index.html | 2 +- src/index.ts | 115 +++++++++++++--- src/server/db.ts | 44 +++++++ src/server/snippets.ts | 234 +++++++++++++++++++++++++++++++++ src/types/snippet.ts | 9 ++ 14 files changed, 723 insertions(+), 116 deletions(-) create mode 100644 .cursor/.gitignore delete mode 100644 src/APITester.tsx create mode 100644 src/components/NotesApp.tsx create mode 100644 src/components/SnippetCard.tsx create mode 100644 src/server/db.ts create mode 100644 src/server/snippets.ts create mode 100644 src/types/snippet.ts diff --git a/.cursor/.gitignore b/.cursor/.gitignore new file mode 100644 index 0000000..8bf7cc2 --- /dev/null +++ b/.cursor/.gitignore @@ -0,0 +1 @@ +plans/ diff --git a/.gitignore b/.gitignore index a14702c..720dcd5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ # dependencies (bun install) node_modules +# local sqlite database +data/ + # output out dist diff --git a/bun.lock b/bun.lock index 41c2b43..c96619e 100644 --- a/bun.lock +++ b/bun.lock @@ -12,6 +12,7 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "lucide-react": "^0.545.0", + "marked": "^18.0.0", "react": "^19", "react-dom": "^19", "tailwind-merge": "^3.3.1", @@ -140,6 +141,8 @@ "lucide-react": ["lucide-react@0.545.0", "", { "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-7r1/yUuflQDSt4f1bpn5ZAocyIxcTyVyBBChSVtBKn5M+392cPmI5YJMWOJKk/HUWGm5wg83chlAZtCcGbEZtw=="], + "marked": ["marked@18.0.0", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-2e7Qiv/HJSXj8rDEpgTvGKsP8yYtI9xXHKDnrftrmnrJPaFNM7VRb2YCzWaX4BP1iCJ/XPduzDJZMFoqTCcIMA=="], + "react": ["react@19.2.5", "", {}, "sha512-llUJLzz1zTUBrskt2pwZgLq59AemifIftw4aB7JxOqf1HY2FDaGDxgwpAPVzHU1kdWabH7FauP4i1oEeer2WCA=="], "react-dom": ["react-dom@19.2.5", "", { "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { "react": "^19.2.5" } }, "sha512-J5bAZz+DXMMwW/wV3xzKke59Af6CHY7G4uYLN1OvBcKEsWOs4pQExj86BBKamxl/Ik5bx9whOrvBlSDfWzgSag=="], diff --git a/package.json b/package.json index 1082313..5de8ff4 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "lucide-react": "^0.545.0", + "marked": "^18.0.0", "react": "^19", "react-dom": "^19", "tailwind-merge": "^3.3.1" diff --git a/src/APITester.tsx b/src/APITester.tsx deleted file mode 100644 index a1f8fff..0000000 --- a/src/APITester.tsx +++ /dev/null @@ -1,64 +0,0 @@ -import { Button } from "@/components/ui/button"; -import { Input } from "@/components/ui/input"; -import { Label } from "@/components/ui/label"; -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; -import { Textarea } from "@/components/ui/textarea"; -import { useRef, type FormEvent } from "react"; - -export function APITester() { - const responseInputRef = useRef(null); - - const testEndpoint = async (e: FormEvent) => { - e.preventDefault(); - - try { - const form = e.currentTarget; - const formData = new FormData(form); - const endpoint = formData.get("endpoint") as string; - const url = new URL(endpoint, location.href); - const method = formData.get("method") as string; - const res = await fetch(url, { method }); - - const data = await res.json(); - responseInputRef.current!.value = JSON.stringify(data, null, 2); - } catch (error) { - responseInputRef.current!.value = String(error); - } - }; - - return ( -
-
- - - - - -
- -