diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..6e008a1 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,21 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "command": "bun run dev", + "name": "Run development server", + "request": "launch", + "type": "node-terminal" + }, + { + "type": "chrome", + "request": "launch", + "name": "Launch Chrome against localhost", + "url": "http://localhost:5173", + "webRoot": "${workspaceFolder}" + } + ] +} diff --git a/bun.lockb b/bun.lockb index 8b3679c..b74f1da 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/bunfig.toml b/bunfig.toml new file mode 100644 index 0000000..986e271 --- /dev/null +++ b/bunfig.toml @@ -0,0 +1,2 @@ +[test] +preload = "./happydom.ts" \ No newline at end of file diff --git a/essays/setup/1. google-auth.md b/essays/setup/1. google-auth.md index e010901..cc4d25b 100644 --- a/essays/setup/1. google-auth.md +++ b/essays/setup/1. google-auth.md @@ -3,3 +3,7 @@ 1. [Google oauth screen](https://console.cloud.google.com/apis/credentials/oauthclient/866296044896-9eb9a2762g9m1kcuqbevqppc4ukdbnbn.apps.googleusercontent.com?project=read-to-remember) 2. [update env variables](https://vercel.com/sanyam-jains-projects-1b330221/remfo/settings/domains) + +3. update REDIRECT_URI + +4. [check domains preview/production setting](https://vercel.com/sanyam-jains-projects-1b330221/remfo/settings/domains) \ No newline at end of file diff --git a/essays/things-you-will-learn.md b/essays/things-you-will-learn.md new file mode 100644 index 0000000..669458b --- /dev/null +++ b/essays/things-you-will-learn.md @@ -0,0 +1,17 @@ +## Frontend + +- svelte + +## Backend + +- designing RESTful APIs +- working with databases + +## System Design + +## DSA + +## Programming + +- best practices +- testing & code-quality diff --git a/happydom.ts b/happydom.ts new file mode 100644 index 0000000..7f712d0 --- /dev/null +++ b/happydom.ts @@ -0,0 +1,3 @@ +import { GlobalRegistrator } from "@happy-dom/global-registrator"; + +GlobalRegistrator.register(); diff --git a/package.json b/package.json index d6e8c6b..d9b0b59 100644 --- a/package.json +++ b/package.json @@ -4,64 +4,78 @@ "private": true, "scripts": { "dev": "vite dev", - "build": "vite build", + "build": "bun run test && vite build", "preview": "vite preview", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", - "test": "vitest", + "test": "vitest run", + "test:ui": "vitest --ui", + "test:watch": "vitest", "lint": "prettier --check . && eslint .", "format": "prettier --write .", "generate": "npx drizzle-kit generate", "migrate": "npx drizzle-kit migrate" }, "devDependencies": { - "@iconify/json": "^2.2.214", + "@happy-dom/global-registrator": "^14.12.3", + "@iconify/json": "^2.2.230", "@iconify/types": "^2.0.0", - "@libsql/client": "0.6.0", + "@libsql/client": "0.7.0", "@lucia-auth/adapter-postgresql": "3.1.2", - "@lucia-auth/adapter-sqlite": "3.0.1", - "@sveltejs/adapter-auto": "3.2.1", - "@sveltejs/adapter-vercel": "5.3.0", - "@sveltejs/enhanced-img": "^0.2.1", - "@sveltejs/kit": "2.5.10", - "@sveltejs/vite-plugin-svelte": "3.1.0", + "@lucia-auth/adapter-sqlite": "3.0.2", + "@sveltejs/adapter-auto": "3.2.2", + "@sveltejs/adapter-vercel": "5.4.1", + "@sveltejs/enhanced-img": "^0.3.0", + "@sveltejs/kit": "2.5.18", + "@sveltejs/vite-plugin-svelte": "3.1.1", "@tailwindcss/typography": "0.5.13", - "@types/eslint": "8.56.10", - "@typescript-eslint/eslint-plugin": "7.10.0", - "@typescript-eslint/parser": "7.10.0", + "@testing-library/jest-dom": "^6.4.7", + "@testing-library/svelte": "^5.2.0", + "@types/eslint": "9.6.0", + "@typescript-eslint/eslint-plugin": "7.17.0", + "@typescript-eslint/parser": "7.17.0", "@vercel/analytics": "^1.3.1", - "@vite-pwa/sveltekit": "^0.5.0", - "arctic": "1.9.0", + "@vite-pwa/sveltekit": "^0.6.0", + "@vitest/coverage-v8": "^2.0.4", + "@vitest/ui": "^2.0.4", + "@zerodevx/svelte-toast": "^0.9.5", + "arctic": "1.9.2", "autoprefixer": "10.4.19", "cal-heatmap": "^4.2.4", - "cypress": "^13.12.0", + "cypress": "^13.13.1", "date-fns": "3.6.0", "dotenv": "16.4.5", - "drizzle-kit": "0.21.4", - "drizzle-orm": "0.30.10", - "eslint": "8.57.0", + "drizzle-kit": "0.23.0", + "drizzle-orm": "0.32.0", + "eslint": "9.7.0", "eslint-config-prettier": "9.1.0", - "eslint-plugin-svelte": "2.39.0", + "eslint-plugin-svelte": "2.43.0", "lucia": "3.2.0", - "openai": "4.47.1", - "postcss": "8.4.38", + "msw": "^2.3.5", + "openai": "4.53.0", + "postcss": "8.4.39", "postgres": "3.4.4", - "posthog-js": "^1.141.4", - "prettier": "3.2.5", - "prettier-plugin-svelte": "3.2.3", - "prettier-plugin-tailwindcss": "0.5.14", - "svelte": "5.0.0-next.142", - "svelte-check": "3.7.1", - "sveltekit-device-detector": "^1.1.2", - "sveltekit-superforms": "2.14.0", - "tailwindcss": "3.4.3", - "tslib": "2.6.2", - "typescript": "5.4.5", + "posthog-js": "^1.148.2", + "prettier": "3.3.3", + "prettier-plugin-svelte": "3.2.6", + "prettier-plugin-tailwindcss": "0.6.5", + "svelte": "5.0.0-next.195", + "svelte-check": "3.8.4", + "sveltekit-device-detector": "^1.1.3", + "sveltekit-superforms": "2.16.1", + "tailwindcss": "3.4.6", + "tslib": "2.6.3", + "typescript": "5.5.4", "unplugin-icons": "^0.19.0", - "vite": "5.2.11", + "vite": "5.3.4", "vite-plugin-pwa": "^0.20.0", "vitest": "1.6.0", "zod": "3.23.8" }, - "type": "module" + "type": "module", + "msw": { + "workerDirectory": [ + "static" + ] + } } \ No newline at end of file diff --git a/src/lib/components/Cards/Card.svelte b/src/lib/components/Cards/Card.svelte new file mode 100644 index 0000000..dd281f9 --- /dev/null +++ b/src/lib/components/Cards/Card.svelte @@ -0,0 +1,56 @@ + + +
+
+
+
+ {card.front} +
+
+ +
+
+ + +
+
+ {card.back} +
+
+
+ +
+
+
+
+ added {formatDistanceToNow(card.createdAt)} ago +
diff --git a/src/lib/components/Cards/CardGroup.svelte b/src/lib/components/Cards/CardGroup.svelte new file mode 100644 index 0000000..f7e2d26 --- /dev/null +++ b/src/lib/components/Cards/CardGroup.svelte @@ -0,0 +1,26 @@ + + +
+
+ {humanReadableDate(cards[0].nextPractice)} +
+
+ {#each cards as card (card.id)} +
+ +
+ {/each} +
diff --git a/src/lib/components/Cards/CardReview.svelte b/src/lib/components/Cards/CardReview.svelte new file mode 100644 index 0000000..88d59c8 --- /dev/null +++ b/src/lib/components/Cards/CardReview.svelte @@ -0,0 +1,71 @@ + + +
+ + +
+ {#if cards.length > 0} + {#each dates as date (date)} + + {/each} + {/if} +
+
diff --git a/src/lib/components/Cards/ReviewOptions.svelte b/src/lib/components/Cards/ReviewOptions.svelte new file mode 100644 index 0000000..56a2826 --- /dev/null +++ b/src/lib/components/Cards/ReviewOptions.svelte @@ -0,0 +1,30 @@ + + +
+ +
+ {#each options as { value, text } (value)} + + {/each} +
+
diff --git a/src/lib/components/Cards/ReviewProgress.svelte b/src/lib/components/Cards/ReviewProgress.svelte new file mode 100644 index 0000000..f25d2d6 --- /dev/null +++ b/src/lib/components/Cards/ReviewProgress.svelte @@ -0,0 +1,22 @@ + + +{#if remainingCards.length === 0} +
+ You have revised all the cards. Go to Record to create more +
+{:else if revisedCards.length > 0 && revisedCards.length % reviseCards === 0} +
+ Hurray. You revised {revisedCards.length} cards. Take a break or keep going. +
+{:else} +
+ cards reviewed: {revisedCards.length}/{cards.length} +
+{/if} diff --git a/src/lib/components/Cards/Structure.drawio b/src/lib/components/Cards/Structure.drawio new file mode 100644 index 0000000..dfef129 --- /dev/null +++ b/src/lib/components/Cards/Structure.drawio @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/lib/components/PrimaryNav.svelte b/src/lib/components/PrimaryNav.svelte index 52d0f80..52c4d47 100644 --- a/src/lib/components/PrimaryNav.svelte +++ b/src/lib/components/PrimaryNav.svelte @@ -44,7 +44,7 @@