setIsMobileMenuOpen(false)}
- />
- )}
-
{/* Mobile Menu */}
{/* Streak (Mobile) */}
diff --git a/data/flashcards.json b/data/flashcards.json
new file mode 100644
index 0000000..eee9084
--- /dev/null
+++ b/data/flashcards.json
@@ -0,0 +1,170 @@
+[
+ {
+ "id": 1,
+ "term": "Big-O Notation",
+ "explanation": "Mathematical notation that describes the limiting behavior of a function when the argument tends towards a particular value or infinity. It represents the upper bound of algorithmic complexity.",
+ "difficulty": "Basic",
+ "category": "Time Complexity"
+ },
+ {
+ "id": 2,
+ "term": "O(1) - Constant Time",
+ "explanation": "Algorithm takes the same amount of time regardless of input size. Examples: array access, hash table lookup, stack push/pop.",
+ "difficulty": "Basic",
+ "category": "Time Complexity"
+ },
+ {
+ "id": 3,
+ "term": "O(log n) - Logarithmic Time",
+ "explanation": "Time grows logarithmically with input size. Common in divide-and-conquer algorithms like binary search, balanced tree operations.",
+ "difficulty": "Basic",
+ "category": "Time Complexity"
+ },
+ {
+ "id": 4,
+ "term": "O(n) - Linear Time",
+ "explanation": "Time grows linearly with input size. Examples: single loop through array, linear search, traversing a linked list.",
+ "difficulty": "Basic",
+ "category": "Time Complexity"
+ },
+ {
+ "id": 5,
+ "term": "O(n²) - Quadratic Time",
+ "explanation": "Time grows quadratically with input size. Common in nested loops, bubble sort, selection sort, insertion sort.",
+ "difficulty": "Basic",
+ "category": "Time Complexity"
+ },
+ {
+ "id": 6,
+ "term": "DFS (Depth-First Search)",
+ "explanation": "Graph traversal algorithm that explores as far as possible along each branch before backtracking. Uses stack (recursion or explicit). Time: O(V+E), Space: O(V).",
+ "difficulty": "Intermediate",
+ "category": "Graph Traversals"
+ },
+ {
+ "id": 7,
+ "term": "BFS (Breadth-First Search)",
+ "explanation": "Graph traversal algorithm that explores all neighbors at current depth before moving to next depth level. Uses queue. Time: O(V+E), Space: O(V). Finds shortest path in unweighted graphs.",
+ "difficulty": "Intermediate",
+ "category": "Graph Traversals"
+ },
+ {
+ "id": 8,
+ "term": "Topological Sort",
+ "explanation": "Linear ordering of vertices in a directed acyclic graph (DAG) where for every directed edge (u,v), vertex u comes before v. Used in scheduling, dependency resolution.",
+ "difficulty": "Intermediate",
+ "category": "Graph Traversals"
+ },
+ {
+ "id": 9,
+ "term": "Merge Sort",
+ "explanation": "Divide-and-conquer stable sorting algorithm. Divides array into halves, recursively sorts them, then merges. Time: O(n log n), Space: O(n). Always O(n log n) regardless of input.",
+ "difficulty": "Intermediate",
+ "category": "Sorting"
+ },
+ {
+ "id": 10,
+ "term": "Quick Sort",
+ "explanation": "Divide-and-conquer sorting algorithm using pivot partitioning. Average: O(n log n), Worst: O(n²), Space: O(log n). In-place but not stable.",
+ "difficulty": "Intermediate",
+ "category": "Sorting"
+ },
+ {
+ "id": 11,
+ "term": "Heap Sort",
+ "explanation": "Comparison-based sorting using binary heap. Build max-heap, then repeatedly extract maximum. Time: O(n log n), Space: O(1). In-place but not stable.",
+ "difficulty": "Intermediate",
+ "category": "Sorting"
+ },
+ {
+ "id": 12,
+ "term": "Hash Table",
+ "explanation": "Data structure that maps keys to values using hash function. Average O(1) for search, insert, delete. Handles collisions via chaining or open addressing.",
+ "difficulty": "Basic",
+ "category": "Data Structures"
+ },
+ {
+ "id": 13,
+ "term": "Binary Search Tree (BST)",
+ "explanation": "Binary tree where left subtree contains nodes with keys less than parent, right subtree contains greater keys. Average O(log n) operations, worst O(n) if unbalanced.",
+ "difficulty": "Intermediate",
+ "category": "Data Structures"
+ },
+ {
+ "id": 14,
+ "term": "Heap",
+ "explanation": "Complete binary tree satisfying heap property. Max-heap: parent ≥ children, Min-heap: parent ≤ children. Used in priority queues, heap sort. Insert/delete: O(log n).",
+ "difficulty": "Intermediate",
+ "category": "Data Structures"
+ },
+ {
+ "id": 15,
+ "term": "Recursion",
+ "explanation": "Problem-solving technique where function calls itself with smaller subproblems. Requires base case and recursive case. Can lead to stack overflow if not properly bounded.",
+ "difficulty": "Basic",
+ "category": "Recursion"
+ },
+ {
+ "id": 16,
+ "term": "Dynamic Programming",
+ "explanation": "Optimization technique that solves complex problems by breaking them into simpler subproblems and storing results. Avoids redundant calculations. Two approaches: memoization (top-down) and tabulation (bottom-up).",
+ "difficulty": "Intermediate",
+ "category": "Recursion"
+ },
+ {
+ "id": 17,
+ "term": "Backtracking",
+ "explanation": "Algorithmic approach that considers searching every possible combination to solve computational problems. Builds solution incrementally and abandons candidates that cannot lead to valid solution.",
+ "difficulty": "Intermediate",
+ "category": "Recursion"
+ },
+ {
+ "id": 18,
+ "term": "Recursive Tree",
+ "explanation": "A diagram that represents how a recursive function expands into multiple subproblems at each call.",
+ "difficulty": "Intermediate",
+ "category": "Recursion"
+ },
+ {
+ "id": 19,
+ "term": "Bubble Sort",
+ "explanation": "Bubble Sort is a sorting algorithm that repeatedly compares and swaps adjacent elements if they are in the wrong order, causing larger elements to bubble to the top/end of the array.",
+ "difficulty": "Intermediate",
+ "category": "Sorting"
+ },
+ {
+ "id": 20,
+ "term": "Dijkstra's Algorithm",
+ "explanation": "Greedy algorithm for finding the shortest path from a single source to all other vertices in a weighted graph with non-negative edge weights. Uses a priority queue (min-heap). Time complexity: O((V + E) log V) with heap, Space: O(V).",
+ "difficulty": "Advanced",
+ "category": "Graphs"
+ },
+ {
+ "id": 21,
+ "term": "Trie (Prefix Tree)",
+ "explanation": "Tree-based data structure for storing strings. Efficient for prefix search and autocomplete. Insert/search: O(m), where m is the word length.",
+ "difficulty": "Intermediate",
+ "category": "Data Structures"
+ },
+ {
+ "id": 22,
+ "term": "Stack",
+ "explanation": "Linear data structure that follows LIFO (Last In, First Out). Supports push, pop, and peek operations in O(1).",
+ "difficulty": "Basic",
+ "category": "Data Structures"
+ },
+ {
+ "id": 23,
+ "term": "Priority Queue",
+ "explanation": "A priority queue is a data structure where elements are served based on priority, with higher priority items removed before lower priority ones.",
+ "difficulty": "Basic",
+ "category": "Data Structures"
+ },
+ {
+ "id": 24,
+ "term": "Array",
+ "explanation": "It is a collection of elements of the same type stored in contiguous memory locations, accessed by index.",
+ "difficulty": "Basic",
+ "category": "Array"
+ }
+]
\ No newline at end of file
diff --git a/data/flashcards.ts b/data/flashcards.ts
index e41dec8..e3d0628 100644
--- a/data/flashcards.ts
+++ b/data/flashcards.ts
@@ -1,149 +1,9 @@
-export interface Flashcard {
+export type Flashcard = {
id: number;
term: string;
explanation: string;
- difficulty: 'Basic' | 'Intermediate';
+ difficulty: string;
category: string;
-}
+};
-export const flashcards: Flashcard[] = [
- // Time Complexity
- {
- id: 1,
- term: "Big-O Notation",
- explanation: "Mathematical notation that describes the limiting behavior of a function when the argument tends towards a particular value or infinity. It represents the upper bound of algorithmic complexity.",
- difficulty: "Basic",
- category: "Time Complexity"
- },
- {
- id: 2,
- term: "O(1) - Constant Time",
- explanation: "Algorithm takes the same amount of time regardless of input size. Examples: array access, hash table lookup, stack push/pop.",
- difficulty: "Basic",
- category: "Time Complexity"
- },
- {
- id: 3,
- term: "O(log n) - Logarithmic Time",
- explanation: "Time grows logarithmically with input size. Common in divide-and-conquer algorithms like binary search, balanced tree operations.",
- difficulty: "Basic",
- category: "Time Complexity"
- },
- {
- id: 4,
- term: "O(n) - Linear Time",
- explanation: "Time grows linearly with input size. Examples: single loop through array, linear search, traversing a linked list.",
- difficulty: "Basic",
- category: "Time Complexity"
- },
- {
- id: 5,
- term: "O(n²) - Quadratic Time",
- explanation: "Time grows quadratically with input size. Common in nested loops, bubble sort, selection sort, insertion sort.",
- difficulty: "Basic",
- category: "Time Complexity"
- },
- // Graph Traversals
- {
- id: 6,
- term: "DFS (Depth-First Search)",
- explanation: "Graph traversal algorithm that explores as far as possible along each branch before backtracking. Uses stack (recursion or explicit). Time: O(V+E), Space: O(V).",
- difficulty: "Intermediate",
- category: "Graph Traversals"
- },
- {
- id: 7,
- term: "BFS (Breadth-First Search)",
- explanation: "Graph traversal algorithm that explores all neighbors at current depth before moving to next depth level. Uses queue. Time: O(V+E), Space: O(V). Finds shortest path in unweighted graphs.",
- difficulty: "Intermediate",
- category: "Graph Traversals"
- },
- {
- id: 8,
- term: "Topological Sort",
- explanation: "Linear ordering of vertices in a directed acyclic graph (DAG) where for every directed edge (u,v), vertex u comes before v. Used in scheduling, dependency resolution.",
- difficulty: "Intermediate",
- category: "Graph Traversals"
- },
-
- // Sorting Algorithms
- {
- id: 9,
- term: "Merge Sort",
- explanation: "Divide-and-conquer stable sorting algorithm. Divides array into halves, recursively sorts them, then merges. Time: O(n log n), Space: O(n). Always O(n log n) regardless of input.",
- difficulty: "Intermediate",
- category: "Sorting"
- },
- {
- id: 10,
- term: "Quick Sort",
- explanation: "Divide-and-conquer sorting algorithm using pivot partitioning. Average: O(n log n), Worst: O(n²), Space: O(log n). In-place but not stable.",
- difficulty: "Intermediate",
- category: "Sorting"
- },
- {
- id: 11,
- term: "Heap Sort",
- explanation: "Comparison-based sorting using binary heap. Build max-heap, then repeatedly extract maximum. Time: O(n log n), Space: O(1). In-place but not stable.",
- difficulty: "Intermediate",
- category: "Sorting"
- },
-
- // Data Structures
- {
- id: 12,
- term: "Hash Table",
- explanation: "Data structure that maps keys to values using hash function. Average O(1) for search, insert, delete. Handles collisions via chaining or open addressing.",
- difficulty: "Basic",
- category: "Data Structures"
- },
- {
- id: 13,
- term: "Binary Search Tree (BST)",
- explanation: "Binary tree where left subtree contains nodes with keys less than parent, right subtree contains greater keys. Average O(log n) operations, worst O(n) if unbalanced.",
- difficulty: "Intermediate",
- category: "Data Structures"
- },
- {
- id: 14,
- term: "Heap",
- explanation: "Complete binary tree satisfying heap property. Max-heap: parent ≥ children, Min-heap: parent ≤ children. Used in priority queues, heap sort. Insert/delete: O(log n).",
- difficulty: "Intermediate",
- category: "Data Structures"
- },
-
- // Recursion
- {
- id: 15,
- term: "Recursion",
- explanation: "Problem-solving technique where function calls itself with smaller subproblems. Requires base case and recursive case. Can lead to stack overflow if not properly bounded.",
- difficulty: "Basic",
- category: "Recursion"
- },
- {
- id: 16,
- term: "Dynamic Programming",
- explanation: "Optimization technique that solves complex problems by breaking them into simpler subproblems and storing results. Avoids redundant calculations. Two approaches: memoization (top-down) and tabulation (bottom-up).",
- difficulty: "Intermediate",
- category: "Recursion"
- },
- {
- id: 17,
- term: "Backtracking",
- explanation: "Algorithmic approach that considers searching every possible combination to solve computational problems. Builds solution incrementally and abandons candidates that cannot lead to valid solution.",
- difficulty: "Intermediate",
- category: "Recursion"
- }
-];
-
-export const categories = [
- "All",
- "Time Complexity",
- "Graph Traversals",
- "Sorting",
- "Data Structures",
- "Recursion"
-] as const;
-
-export const difficulties = ["All", "Basic", "Intermediate"] as const;
diff --git a/package-lock.json b/package-lock.json
index 0101bcc..b36b7f0 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -11,6 +11,7 @@
"@auth/supabase-adapter": "^1.9.1",
"@google/generative-ai": "^0.24.1",
"@next-auth/supabase-adapter": "^0.2.1",
+ "@prisma/client": "^6.16.2",
"@radix-ui/react-dialog": "^1.1.14",
"@radix-ui/react-dropdown-menu": "^2.1.15",
"@radix-ui/react-slot": "^1.2.3",
@@ -64,6 +65,7 @@
"@types/three": "^0.179.0",
"eslint": "9.33.0",
"eslint-config-next": "15.4.6",
+ "prisma": "^6.16.2",
"tailwindcss": "^4.1.8",
"ts-node": "^10.9.2",
"tw-animate-css": "^1.3.4",
@@ -3035,6 +3037,91 @@
"url": "https://github.com/sponsors/panva"
}
},
+ "node_modules/@prisma/client": {
+ "version": "6.16.2",
+ "resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.16.2.tgz",
+ "integrity": "sha512-E00PxBcalMfYO/TWnXobBVUai6eW/g5OsifWQsQDzJYm7yaY+IRLo7ZLsaefi0QkTpxfuhFcQ/w180i6kX3iJw==",
+ "hasInstallScript": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=18.18"
+ },
+ "peerDependencies": {
+ "prisma": "*",
+ "typescript": ">=5.1.0"
+ },
+ "peerDependenciesMeta": {
+ "prisma": {
+ "optional": true
+ },
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@prisma/config": {
+ "version": "6.16.2",
+ "resolved": "https://registry.npmjs.org/@prisma/config/-/config-6.16.2.tgz",
+ "integrity": "sha512-mKXSUrcqXj0LXWPmJsK2s3p9PN+aoAbyMx7m5E1v1FufofR1ZpPoIArjjzOIm+bJRLLvYftoNYLx1tbHgF9/yg==",
+ "devOptional": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "c12": "3.1.0",
+ "deepmerge-ts": "7.1.5",
+ "effect": "3.16.12",
+ "empathic": "2.0.0"
+ }
+ },
+ "node_modules/@prisma/debug": {
+ "version": "6.16.2",
+ "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.16.2.tgz",
+ "integrity": "sha512-bo4/gA/HVV6u8YK2uY6glhNsJ7r+k/i5iQ9ny/3q5bt9ijCj7WMPUwfTKPvtEgLP+/r26Z686ly11hhcLiQ8zA==",
+ "devOptional": true,
+ "license": "Apache-2.0"
+ },
+ "node_modules/@prisma/engines": {
+ "version": "6.16.2",
+ "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-6.16.2.tgz",
+ "integrity": "sha512-7yf3AjfPUgsg/l7JSu1iEhsmZZ/YE00yURPjTikqm2z4btM0bCl2coFtTGfeSOWbQMmq45Jab+53yGUIAT1sjA==",
+ "devOptional": true,
+ "hasInstallScript": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@prisma/debug": "6.16.2",
+ "@prisma/engines-version": "6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43",
+ "@prisma/fetch-engine": "6.16.2",
+ "@prisma/get-platform": "6.16.2"
+ }
+ },
+ "node_modules/@prisma/engines-version": {
+ "version": "6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43",
+ "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43.tgz",
+ "integrity": "sha512-ThvlDaKIVrnrv97ujNFDYiQbeMQpLa0O86HFA2mNoip4mtFqM7U5GSz2ie1i2xByZtvPztJlNRgPsXGeM/kqAA==",
+ "devOptional": true,
+ "license": "Apache-2.0"
+ },
+ "node_modules/@prisma/fetch-engine": {
+ "version": "6.16.2",
+ "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-6.16.2.tgz",
+ "integrity": "sha512-wPnZ8DMRqpgzye758ZvfAMiNJRuYpz+rhgEBZi60ZqDIgOU2694oJxiuu3GKFeYeR/hXxso4/2oBC243t/whxQ==",
+ "devOptional": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@prisma/debug": "6.16.2",
+ "@prisma/engines-version": "6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43",
+ "@prisma/get-platform": "6.16.2"
+ }
+ },
+ "node_modules/@prisma/get-platform": {
+ "version": "6.16.2",
+ "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.16.2.tgz",
+ "integrity": "sha512-U/P36Uke5wS7r1+omtAgJpEB94tlT4SdlgaeTc6HVTTT93pXj7zZ+B/cZnmnvjcNPfWddgoDx8RLjmQwqGDYyA==",
+ "devOptional": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@prisma/debug": "6.16.2"
+ }
+ },
"node_modules/@radix-ui/primitive": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.2.tgz",
@@ -6346,6 +6433,35 @@
"node": ">= 0.8"
}
},
+ "node_modules/c12": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/c12/-/c12-3.1.0.tgz",
+ "integrity": "sha512-uWoS8OU1MEIsOv8p/5a82c3H31LsWVR5qiyXVfBNOzfffjUWtPnhAb4BYI2uG2HfGmZmFjCtui5XNWaps+iFuw==",
+ "devOptional": true,
+ "license": "MIT",
+ "dependencies": {
+ "chokidar": "^4.0.3",
+ "confbox": "^0.2.2",
+ "defu": "^6.1.4",
+ "dotenv": "^16.6.1",
+ "exsolve": "^1.0.7",
+ "giget": "^2.0.0",
+ "jiti": "^2.4.2",
+ "ohash": "^2.0.11",
+ "pathe": "^2.0.3",
+ "perfect-debounce": "^1.0.0",
+ "pkg-types": "^2.2.0",
+ "rc9": "^2.1.2"
+ },
+ "peerDependencies": {
+ "magicast": "^0.3.5"
+ },
+ "peerDependenciesMeta": {
+ "magicast": {
+ "optional": true
+ }
+ }
+ },
"node_modules/call-bind": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz",
@@ -6527,6 +6643,22 @@
"url": "https://github.com/inikulin/parse5?sponsor=1"
}
},
+ "node_modules/chokidar": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",
+ "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==",
+ "devOptional": true,
+ "license": "MIT",
+ "dependencies": {
+ "readdirp": "^4.0.1"
+ },
+ "engines": {
+ "node": ">= 14.16.0"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
"node_modules/chownr": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz",
@@ -6547,6 +6679,16 @@
"node": ">=6.0"
}
},
+ "node_modules/citty": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/citty/-/citty-0.1.6.tgz",
+ "integrity": "sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==",
+ "devOptional": true,
+ "license": "MIT",
+ "dependencies": {
+ "consola": "^3.2.3"
+ }
+ },
"node_modules/class-variance-authority": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/class-variance-authority/-/class-variance-authority-0.7.1.tgz",
@@ -6671,6 +6813,23 @@
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
"license": "MIT"
},
+ "node_modules/confbox": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.2.2.tgz",
+ "integrity": "sha512-1NB+BKqhtNipMsov4xI/NnhCKp9XG9NamYp5PVm9klAT0fsrNPjaFICsCFhNhwZJKNh7zB/3q8qXz0E9oaMNtQ==",
+ "devOptional": true,
+ "license": "MIT"
+ },
+ "node_modules/consola": {
+ "version": "3.4.2",
+ "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz",
+ "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==",
+ "devOptional": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^14.18.0 || >=16.10.0"
+ }
+ },
"node_modules/content-disposition": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz",
@@ -7012,6 +7171,16 @@
"node": ">=0.10.0"
}
},
+ "node_modules/deepmerge-ts": {
+ "version": "7.1.5",
+ "resolved": "https://registry.npmjs.org/deepmerge-ts/-/deepmerge-ts-7.1.5.tgz",
+ "integrity": "sha512-HOJkrhaYsweh+W+e74Yn7YStZOilkoPb6fycpwNLKzSPtruFs48nYis0zy5yJz1+ktUhHxoRDJ27RQAWLIJVJw==",
+ "devOptional": true,
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=16.0.0"
+ }
+ },
"node_modules/define-data-property": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz",
@@ -7046,6 +7215,13 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/defu": {
+ "version": "6.1.4",
+ "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.4.tgz",
+ "integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==",
+ "devOptional": true,
+ "license": "MIT"
+ },
"node_modules/del": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/del/-/del-4.1.1.tgz",
@@ -7120,6 +7296,13 @@
"node": ">= 0.8"
}
},
+ "node_modules/destr": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.5.tgz",
+ "integrity": "sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==",
+ "devOptional": true,
+ "license": "MIT"
+ },
"node_modules/detect-libc": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz",
@@ -7225,6 +7408,19 @@
"url": "https://github.com/fb55/domutils?sponsor=1"
}
},
+ "node_modules/dotenv": {
+ "version": "16.6.1",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz",
+ "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==",
+ "devOptional": true,
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://dotenvx.com"
+ }
+ },
"node_modules/dunder-proto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
@@ -7255,6 +7451,17 @@
"license": "MIT",
"peer": true
},
+ "node_modules/effect": {
+ "version": "3.16.12",
+ "resolved": "https://registry.npmjs.org/effect/-/effect-3.16.12.tgz",
+ "integrity": "sha512-N39iBk0K71F9nb442TLbTkjl24FLUzuvx2i1I2RsEAQsdAdUTuUoW0vlfUXgkMTUOnYqKnWcFfqw4hK4Pw27hg==",
+ "devOptional": true,
+ "license": "MIT",
+ "dependencies": {
+ "@standard-schema/spec": "^1.0.0",
+ "fast-check": "^3.23.1"
+ }
+ },
"node_modules/ejs": {
"version": "3.1.10",
"resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz",
@@ -7291,6 +7498,16 @@
"node": ">= 4"
}
},
+ "node_modules/empathic": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/empathic/-/empathic-2.0.0.tgz",
+ "integrity": "sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA==",
+ "devOptional": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=14"
+ }
+ },
"node_modules/encodeurl": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
@@ -8207,6 +8424,36 @@
"node": ">= 0.6"
}
},
+ "node_modules/exsolve": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.0.7.tgz",
+ "integrity": "sha512-VO5fQUzZtI6C+vx4w/4BWJpg3s/5l+6pRQEHzFRM8WFi4XffSP1Z+4qi7GbjWbvRQEbdIco5mIMq+zX4rPuLrw==",
+ "devOptional": true,
+ "license": "MIT"
+ },
+ "node_modules/fast-check": {
+ "version": "3.23.2",
+ "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-3.23.2.tgz",
+ "integrity": "sha512-h5+1OzzfCC3Ef7VbtKdcv7zsstUQwUDlYpUTvjeUsJAssPgLn7QzbboPtL5ro04Mq0rPOsMzl7q5hIbRs2wD1A==",
+ "devOptional": true,
+ "funding": [
+ {
+ "type": "individual",
+ "url": "https://github.com/sponsors/dubzzz"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/fast-check"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "pure-rand": "^6.1.0"
+ },
+ "engines": {
+ "node": ">=8.0.0"
+ }
+ },
"node_modules/fast-content-type-parse": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-3.0.0.tgz",
@@ -8671,6 +8918,24 @@
"url": "https://github.com/privatenumber/get-tsconfig?sponsor=1"
}
},
+ "node_modules/giget": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/giget/-/giget-2.0.0.tgz",
+ "integrity": "sha512-L5bGsVkxJbJgdnwyuheIunkGatUF/zssUoxxjACCseZYAVbaqdh9Tsmmlkl8vYan09H7sbvKt4pS8GqKLBrEzA==",
+ "devOptional": true,
+ "license": "MIT",
+ "dependencies": {
+ "citty": "^0.1.6",
+ "consola": "^3.4.0",
+ "defu": "^6.1.4",
+ "node-fetch-native": "^1.6.6",
+ "nypm": "^0.6.0",
+ "pathe": "^2.0.3"
+ },
+ "bin": {
+ "giget": "dist/cli.mjs"
+ }
+ },
"node_modules/glob": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
@@ -9637,7 +9902,7 @@
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/jiti/-/jiti-2.4.2.tgz",
"integrity": "sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"bin": {
"jiti": "lib/jiti-cli.mjs"
@@ -10841,6 +11106,13 @@
"node": "^10 || ^12 || >=14"
}
},
+ "node_modules/node-fetch-native": {
+ "version": "1.6.7",
+ "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.7.tgz",
+ "integrity": "sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==",
+ "devOptional": true,
+ "license": "MIT"
+ },
"node_modules/node-releases": {
"version": "2.0.19",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz",
@@ -10868,6 +11140,26 @@
"url": "https://github.com/fb55/nth-check?sponsor=1"
}
},
+ "node_modules/nypm": {
+ "version": "0.6.2",
+ "resolved": "https://registry.npmjs.org/nypm/-/nypm-0.6.2.tgz",
+ "integrity": "sha512-7eM+hpOtrKrBDCh7Ypu2lJ9Z7PNZBdi/8AT3AX8xoCj43BBVHD0hPSTEvMtkMpfs8FCqBGhxB+uToIQimA111g==",
+ "devOptional": true,
+ "license": "MIT",
+ "dependencies": {
+ "citty": "^0.1.6",
+ "consola": "^3.4.2",
+ "pathe": "^2.0.3",
+ "pkg-types": "^2.3.0",
+ "tinyexec": "^1.0.1"
+ },
+ "bin": {
+ "nypm": "dist/cli.mjs"
+ },
+ "engines": {
+ "node": "^14.16.0 || >=16.10.0"
+ }
+ },
"node_modules/oauth": {
"version": "0.9.15",
"resolved": "https://registry.npmjs.org/oauth/-/oauth-0.9.15.tgz",
@@ -11020,6 +11312,13 @@
"node": ">= 20"
}
},
+ "node_modules/ohash": {
+ "version": "2.0.11",
+ "resolved": "https://registry.npmjs.org/ohash/-/ohash-2.0.11.tgz",
+ "integrity": "sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==",
+ "devOptional": true,
+ "license": "MIT"
+ },
"node_modules/oidc-token-hash": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/oidc-token-hash/-/oidc-token-hash-5.1.1.tgz",
@@ -11262,6 +11561,20 @@
"node": ">=8"
}
},
+ "node_modules/pathe": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",
+ "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==",
+ "devOptional": true,
+ "license": "MIT"
+ },
+ "node_modules/perfect-debounce": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/perfect-debounce/-/perfect-debounce-1.0.0.tgz",
+ "integrity": "sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==",
+ "devOptional": true,
+ "license": "MIT"
+ },
"node_modules/picocolors": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
@@ -11322,6 +11635,18 @@
"node": ">=8"
}
},
+ "node_modules/pkg-types": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.0.tgz",
+ "integrity": "sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig==",
+ "devOptional": true,
+ "license": "MIT",
+ "dependencies": {
+ "confbox": "^0.2.2",
+ "exsolve": "^1.0.7",
+ "pathe": "^2.0.3"
+ }
+ },
"node_modules/playwright": {
"version": "1.54.2",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.54.2.tgz",
@@ -11452,6 +11777,32 @@
"integrity": "sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew==",
"license": "MIT"
},
+ "node_modules/prisma": {
+ "version": "6.16.2",
+ "resolved": "https://registry.npmjs.org/prisma/-/prisma-6.16.2.tgz",
+ "integrity": "sha512-aRvldGE5UUJTtVmFiH3WfNFNiqFlAtePUxcI0UEGlnXCX7DqhiMT5TRYwncHFeA/Reca5W6ToXXyCMTeFPdSXA==",
+ "devOptional": true,
+ "hasInstallScript": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@prisma/config": "6.16.2",
+ "@prisma/engines": "6.16.2"
+ },
+ "bin": {
+ "prisma": "build/index.js"
+ },
+ "engines": {
+ "node": ">=18.18"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.1.0"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
"node_modules/prop-types": {
"version": "15.8.1",
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
@@ -11492,6 +11843,23 @@
"node": ">=6"
}
},
+ "node_modules/pure-rand": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz",
+ "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==",
+ "devOptional": true,
+ "funding": [
+ {
+ "type": "individual",
+ "url": "https://github.com/sponsors/dubzzz"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/fast-check"
+ }
+ ],
+ "license": "MIT"
+ },
"node_modules/qs": {
"version": "6.14.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz",
@@ -11580,6 +11948,17 @@
"url": "https://opencollective.com/express"
}
},
+ "node_modules/rc9": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/rc9/-/rc9-2.1.2.tgz",
+ "integrity": "sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==",
+ "devOptional": true,
+ "license": "MIT",
+ "dependencies": {
+ "defu": "^6.1.4",
+ "destr": "^2.0.3"
+ }
+ },
"node_modules/react": {
"version": "19.1.1",
"resolved": "https://registry.npmjs.org/react/-/react-19.1.1.tgz",
@@ -11788,6 +12167,20 @@
}
}
},
+ "node_modules/readdirp": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz",
+ "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==",
+ "devOptional": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 14.18.0"
+ },
+ "funding": {
+ "type": "individual",
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
"node_modules/recharts": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/recharts/-/recharts-3.1.2.tgz",
@@ -13009,6 +13402,13 @@
"integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==",
"license": "MIT"
},
+ "node_modules/tinyexec": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.0.1.tgz",
+ "integrity": "sha512-5uC6DDlmeqiOwCPmK9jMSdOuZTh8bU39Ys6yidB+UTt5hfZUPGAypSgFRiEp+jbi9qH40BLDvy85jIU88wKSqw==",
+ "devOptional": true,
+ "license": "MIT"
+ },
"node_modules/tinyglobby": {
"version": "0.2.14",
"resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz",
@@ -13331,7 +13731,7 @@
"version": "5.9.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz",
"integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==",
- "dev": true,
+ "devOptional": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
diff --git a/package.json b/package.json
index e29df6d..ce94567 100644
--- a/package.json
+++ b/package.json
@@ -19,6 +19,7 @@
"@auth/supabase-adapter": "^1.9.1",
"@google/generative-ai": "^0.24.1",
"@next-auth/supabase-adapter": "^0.2.1",
+ "@prisma/client": "^6.16.2",
"@radix-ui/react-dialog": "^1.1.14",
"@radix-ui/react-dropdown-menu": "^2.1.15",
"@radix-ui/react-slot": "^1.2.3",
@@ -72,6 +73,7 @@
"@types/three": "^0.179.0",
"eslint": "9.33.0",
"eslint-config-next": "15.4.6",
+ "prisma": "^6.16.2",
"tailwindcss": "^4.1.8",
"ts-node": "^10.9.2",
"tw-animate-css": "^1.3.4",
diff --git a/prisma/dev.db b/prisma/dev.db
new file mode 100644
index 0000000000000000000000000000000000000000..a56bf445b19682be3cc1a1355e7236238badfcaa
GIT binary patch
literal 28672
zcmeHPTW=f36<%7F=_po|#&LwgEi_d@M1n|~x<@Y3mXc^&s3pf1<rE?{vwq5$Wm)gwH;>=`=L!z4_D}F{?#%Ja4&SlLABW=;
zUs+dgd}@t(gvzjNvmaooTkUQ?K2xJz+bK>TGB4;Y0SpldbLQlV|K_wP&olSAVp%
zgK4&FJN07vP%I*En$>GR$N21-?2b4JUGDQ(2L9y(9NB6~J8|Rg<@aqKi*^v5zdJU2
z@{3%4a(+Jd+lFSf5k^vZyy3}qq?c0{uUr{s{^Eck6bO!UAI;%eFwSvncZ9vK5@0d(
zxeS<=^rh+ur@`a1qcB99>o{vV*ODA0kh58z3Se>Ir6=&P7iP=xFmxp*Qn3hC!wwQ(bJ|y~
zy`9~y`#ZJGixXDHW;d=}oBVJ-XGz}?N13+sBo6d>MSIb4TFWb~g$29fEUm7IrN!lid3&X~w6waolw#>ml?DEAxdpRX7QFC({i
z<7VEP?L96`JrStTQ1U>qdL%@ZIg+D9#$#~@-4KxoBcV{fp;#w4WE>azqg#n@Q{4_j
z4G;Gn#iSnx%tNV;3|+xg(hQ>jg-f1dm`HHD!))%lRNx+#kpfB}(=_3!qCa7aA{HjHC-q2}J}|XrfNZ
z5l(rXD`}sq@1u#lb?dlMn0p|2xS_>^mLk$WsALSgVhU)gR+qTyU`#e++%2JM>8k}WB#yMHhIk1ZX6|coB*-jkKf2!KREu$pqrdiPBusbA5r4j){o31s0#5rCzJdaEqXwh%2&`x-xqJ38CB(O76N+
z!NDkYAUQbZ_{tXO;ZexKXWRikuywzk3gbKjtK+0y%Z1w{61EE@fPr5keIP51
zVwy4~IFlBMB6A4L%S2NotMZ{Yp@88#&;xNqPAaAm(n~xT3Ci0DT4<66x5#!wZtF|)
zvm}BNDjjX;L=tO_f}R1=AWbdfG^$^*E&5}+x;^+CkIFC(7!
zon*#FC=W*)!y3%JE;3{PcAq`9^+n|A`i3?QHXR1vp~aRiPBs$M~*lO
z%AqWb+g;m*kB5T~J8WjNdViK>?hLw|My{(0uUn3Hf{SVFG3&*ukmI
zD-@JEiHqgQd|(s~N`t%LtslpRSh}y*uSXp7D(eQIXaMP
zTVP6lOo1`*JWvIIeV`3+-5>~Ilg*?_DHfSy5suu2qEjZAo~I7If1WyLy<{2}j}WAK
zQ`hp=eD8%OkqFGJiH4n_4w?-$gxy~ttagM#Vp#885bC!<3K0g!5CuuQlX{UNOCKKu
znoNtySUKI>Cw`=gFQ;&IG;eJjPY{KvLnJB#IE^eHJx}WCt$zolbJ3R%%u0cx{Xyc8
z=C**Fqe$KcxjK`eOa!t-V7#32xvP0=`FNBlN2o19h(7cTc?FR?NU2%O_hGp3rASSn
z58R^)Y;t2UsmCS$G1G}t=u>CSZMZzjHz?kx4j#hTPeN#h&ZWXcb?$^gcsaGtNAMnU
z0-V=nyYz_d1Zj4@4Z{}b$JYK98JK1m)WWqmLfMgQX2iQlmUR$siViQLE=H4
z*4JF}sGU$okDQuZNE{p@0KiwJp_0~}t+L%N7RDe&}+1AiY5W$s%5I~v;>b3gu
z7uE$wO^G=@s1ro3%cpAp>nnL{ve%fLtWuc6%#zlpL?<&KkPc%aDs@;I2q*4_5EIgN
z=m3lnDL^dSNsuU=izCH!12jUAN)!=pNFEr7mjYc6pOT`NJbo(&-8gA{|GS&=`94xP
z{;ooB%-*u@BTsekw$ne?X&P{F$YeAvLvFVf1s=%H3{VA0g!BekAjN_J!vW_|Kpgha
zsZIOH#e9U~nBG5i>`O->q$9D_(izHY*$iHhbUK{5$1{*qDl_wx&9U07&cU7{%+i|y
zC3I)f8$^++bD-_%KHiS6-AwEMzqBU4eA&ygxo!|J2p9wm0tNwtfI+|@U=T0}7z7Lg
z1_6V>D~G^%Ze%Jq_^&PAruYAw*w}yLi#MK+|H|zDoBe5omEmSwD3lA5!Zmcb=mw5?vXCz6W&N
zqIm#q27{{k0RaH0SJ
literal 0
HcmV?d00001
diff --git a/prisma/migrations/20250928134336_init/migration.sql b/prisma/migrations/20250928134336_init/migration.sql
new file mode 100644
index 0000000..a8d124d
--- /dev/null
+++ b/prisma/migrations/20250928134336_init/migration.sql
@@ -0,0 +1,8 @@
+-- CreateTable
+CREATE TABLE "Flashcard" (
+ "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ "term" TEXT NOT NULL,
+ "explanation" TEXT NOT NULL,
+ "difficulty" TEXT NOT NULL,
+ "category" TEXT NOT NULL
+);
diff --git a/prisma/migrations/migration_lock.toml b/prisma/migrations/migration_lock.toml
new file mode 100644
index 0000000..2a5a444
--- /dev/null
+++ b/prisma/migrations/migration_lock.toml
@@ -0,0 +1,3 @@
+# Please do not edit this file manually
+# It should be added in your version-control system (e.g., Git)
+provider = "sqlite"
diff --git a/prisma/schema.prisma b/prisma/schema.prisma
new file mode 100644
index 0000000..5dff165
--- /dev/null
+++ b/prisma/schema.prisma
@@ -0,0 +1,25 @@
+// This is your Prisma schema file,
+// learn more about it in the docs: https://pris.ly/d/prisma-schema
+
+// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
+// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
+
+
+datasource db {
+ provider = "sqlite"
+ url = env("DATABASE_URL")
+}
+
+generator client {
+ provider = "prisma-client-js"
+}
+
+model Flashcard {
+ id Int @id @default(autoincrement())
+ term String
+ explanation String
+ difficulty String
+ category String
+}
+
+
From 9a139f5d2e46de209d912b5ad6a8bf29a8610328 Mon Sep 17 00:00:00 2001
From: KIRTI13115 <192kirti@gmail.com>
Date: Mon, 29 Sep 2025 00:18:56 +0530
Subject: [PATCH 2/3] Issue #315 Users can add flashcards
---
components/NavbarSheet.tsx | 4 ++--
prisma/dev.db | Bin 28672 -> 28672 bytes
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/components/NavbarSheet.tsx b/components/NavbarSheet.tsx
index 4728600..150386b 100644
--- a/components/NavbarSheet.tsx
+++ b/components/NavbarSheet.tsx
@@ -109,7 +109,7 @@ export default function NavbarSheet({
{ href: "/notes", label: "Notes" },
{ href: "/companies", label: "Company-wise Sheet" },
{ href: "/timequiz", label: "Timed Quiz" },
- {href: "/flashcards/add", label: "Add Flashcard" },
+ { href:"/flashcards/add", label:"Add Flashcards"},
// Flashcards merged into theory-cheatsheets page (tabbed UI)
{ href: "/theory-cheatsheets", label: "Theory Cheatsheets & Flashcards" },
{ href: "/interview-experiences", label: "Interview Experiences" },
@@ -161,7 +161,7 @@ export default function NavbarSheet({
Mate
{" "}
- Template
+ v2
diff --git a/prisma/dev.db b/prisma/dev.db
index a56bf445b19682be3cc1a1355e7236238badfcaa..a77403bd9d739cd0d111a4cdd39a99d9cfa59ec1 100644
GIT binary patch
delta 175
zcmZp8z}WDBae_3X_(U0JM)8da^Zgk`HwCZ=a4_*rWZ+lgo48p}pp~z_kx!JJLA)_j
zTsycVF*(~OGcProg3mgCd
From dfc55680b64b96e73047f375e2b7eed07f2ff46a Mon Sep 17 00:00:00 2001
From: KIRTI13115 <192kirti@gmail.com>
Date: Mon, 29 Sep 2025 17:43:44 +0530
Subject: [PATCH 3/3] users can see add flashcard button
---
app/flashcards/FlashcardsPageClient.tsx | 34 ++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/app/flashcards/FlashcardsPageClient.tsx b/app/flashcards/FlashcardsPageClient.tsx
index 2e8ca0f..0176f65 100644
--- a/app/flashcards/FlashcardsPageClient.tsx
+++ b/app/flashcards/FlashcardsPageClient.tsx
@@ -5,8 +5,16 @@ import { motion, AnimatePresence } from "framer-motion";
import Navbar from "@/components/Navbar";
import FlashcardComponent from "@/components/FlashcardComponent";
import ReportIssueButton from "@/components/ReportIssueButton";
-import { flashcards, categories, difficulties, type Flashcard } from "@/data/flashcards";
import { ChevronLeft, ChevronRight, RotateCcw, BookOpen, Filter, Trophy } from "lucide-react";
+import { useRouter } from "next/navigation";
+
+type Flashcard = {
+ id: number;
+ term: string;
+ explanation: string;
+ difficulty: string;
+ category: string;
+};
const fadeInUp = {
hidden: { opacity: 0, y: 20 },
@@ -38,6 +46,30 @@ export default function FlashcardsPageClient() {
const [reviewedCards, setReviewedCards] = useState>(new Set());
const [showFilters, setShowFilters] = useState(false);
+ const [flashcards, setFlashcards] = useState([]);
+const [loading, setLoading] = useState(true);
+
+useEffect(() => {
+ async function fetchFlashcards() {
+ try {
+ const res = await fetch("/api/flashcards");
+ if (!res.ok) throw new Error("Failed to fetch flashcards");
+
+ const data: Flashcard[] = await res.json();
+ setFlashcards(data);
+ } catch (err) {
+ console.error(err);
+ } finally {
+ setLoading(false);
+ }
+ }
+ fetchFlashcards();
+}, []);
+
+const categories = ["All", ...Array.from(new Set(flashcards.map(f => f.category)))];
+const difficulties = ["All", "Basic", "Intermediate", "Advanced"];
+
+
// Load progress from localStorage
useEffect(() => {
const savedIndex = localStorage.getItem('flashcard_current_index');