Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,552 changes: 1,313 additions & 239 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"scripts": {
"dev": "next dev --turbopack",
"start": "next start",
"build": "npx prisma generate && next build",
"build": "npx prisma generate --schema=src/db/schema.prisma && next build",
"lint": "eslint .",
"migrate": "npx prisma generate && env $(cat .env.local | xargs) npx prisma migrate dev",
"migrate": "npx prisma generate --schema=src/db/schema.prisma && env $(cat .env.local | xargs) npx prisma migrate dev --schema=src/db/schema.prisma",
"setup-test-user": "env $(cat .env.local | xargs) node scripts/setup-test-user.js",
"cypress:open": "cypress open",
"cypress": "cypress run",
Expand All @@ -18,7 +18,8 @@
"schema": "src/db/schema.prisma"
},
"dependencies": {
"@prisma/client": "6.5.0",
"@prisma/adapter-pg": "^7.1.0",
"@prisma/client": "^7.1.0",
"@radix-ui/react-alert-dialog": "^1.1.6",
"@radix-ui/react-dialog": "^1.1.6",
"@radix-ui/react-dropdown-menu": "^2.1.6",
Expand All @@ -34,9 +35,10 @@
"fuse.js": "^7.1.0",
"lucide-react": "^0.483.0",
"middleware": "^1.0.0",
"next": "^15.3.0",
"next": "^16.0.7",
"next-themes": "^0.4.6",
"openai": "^4.91.1",
"pg": "^8.16.3",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"sonner": "^2.0.1",
Expand All @@ -49,6 +51,7 @@
"@playwright/test": "^1.52.0",
"@tailwindcss/postcss": "^4",
"@types/node": "^20",
"@types/pg": "^8.15.6",
"@types/react": "^19",
"@types/react-dom": "^19",
"@typescript-eslint/eslint-plugin": "^8.46.1",
Expand All @@ -60,6 +63,7 @@
"eslint-plugin-react-hooks": "^7.0.0",
"prettier": "^3.6.2",
"prettier-plugin-tailwindcss": "^0.6.14",
"prisma": "^7.1.0",
"tailwindcss": "^4",
"typescript": "^5"
}
Expand Down
7 changes: 7 additions & 0 deletions prisma.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from 'prisma/config'

export default defineConfig({
datasource: {
url: process.env.DATABASE_URL!
}
})
2 changes: 1 addition & 1 deletion src/actions/notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const askAIAboutNotesAction = async (
}

const formattedNotes = notes
.map((note) =>
.map((note: { text: string; createdAt: Date; updatedAt: Date }) =>
`
Text: ${note.text}
Created at: ${note.createdAt}
Expand Down
2 changes: 1 addition & 1 deletion src/components/AppSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
SidebarGroupLabel,
} from "@/components/ui/sidebar";
import { prisma } from "@/db/prisma";
import { Note } from "@prisma/client";
import { Note } from "@/db/client";
import Link from "next/link";
import SidebarGroupContent from "./SidebarGroupContent";

Expand Down
2 changes: 1 addition & 1 deletion src/components/SelectNoteButton.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import useNote from "@/hooks/useNote";
import { Note } from "@prisma/client";
import { Note } from "@/db/client";
import { useSearchParams } from "next/navigation";
import { useEffect, useState } from "react";
import { SidebarMenuButton } from "./ui/sidebar";
Expand Down
2 changes: 1 addition & 1 deletion src/components/SidebarGroupContent.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { Note } from "@prisma/client";
import { Note } from "@/db/client";
import {
SidebarGroupContent as SidebarGroupContentShadCN,
SidebarMenu,
Expand Down
11 changes: 9 additions & 2 deletions src/db/prisma.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
// lib/prisma.ts
import { PrismaClient } from "@prisma/client";
import { PrismaClient } from "./client";
import { PrismaPg } from '@prisma/adapter-pg'
import { Pool } from 'pg'

const globalForPrisma = global as unknown as { prisma: PrismaClient };

export const prisma = globalForPrisma.prisma || new PrismaClient();
const pool = new Pool({ connectionString: process.env.DATABASE_URL })
const adapter = new PrismaPg(pool)

export const prisma = globalForPrisma.prisma || new PrismaClient({
adapter
});

if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
3 changes: 1 addition & 2 deletions src/db/schema.prisma
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}

generator client {
provider = "prisma-client"
provider = "prisma-client-js"
output = "client"
}

Expand Down
25 changes: 20 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
Expand All @@ -11,17 +15,28 @@
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"jsx": "react-jsx",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./src/*"]
"@/*": [
"./src/*"
]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules", "cypress"]
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
],
"exclude": [
"node_modules",
"cypress"
]
}
Loading