Skip to content

Commit acf95fa

Browse files
committed
chore: update dependencies and improve layout structure
- Updated dependencies in package.json to latest versions for better performance and security. - Refactored layout.tsx for improved readability and structure, ensuring consistent formatting. - Minor adjustments in page.tsx for consistency. - Enhanced database schema in schema.ts for better clarity and maintainability. - Cleaned up client.tsx for better organization and readability.
1 parent 90f3acc commit acf95fa

7 files changed

Lines changed: 533 additions & 322 deletions

File tree

bun.lock

Lines changed: 288 additions & 96 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"babel-plugin-react-compiler"
1616
],
1717
"dependencies": {
18-
"@dicebear/collection": "^9.3.1",
19-
"@dicebear/core": "^9.3.1",
18+
"@dicebear/collection": "^9.3.2",
19+
"@dicebear/core": "^9.3.2",
2020
"@hookform/resolvers": "^5.2.2",
2121
"@neondatabase/serverless": "^1.0.2",
2222
"@radix-ui/react-accordion": "^1.2.12",
@@ -45,13 +45,13 @@
4545
"@radix-ui/react-toggle": "^1.1.10",
4646
"@radix-ui/react-toggle-group": "^1.1.11",
4747
"@radix-ui/react-tooltip": "^1.2.8",
48-
"@tanstack/react-query": "^5.90.20",
48+
"@tanstack/react-query": "^5.90.21",
4949
"@tanstack/react-table": "^8.21.3",
50-
"@trpc/client": "^11.8.1",
51-
"@trpc/server": "^11.8.1",
52-
"@trpc/tanstack-react-query": "^11.8.1",
50+
"@trpc/client": "^11.11.0",
51+
"@trpc/server": "^11.11.0",
52+
"@trpc/tanstack-react-query": "^11.11.0",
5353
"babel-plugin-react-compiler": "^1.0.0",
54-
"better-auth": "^1.4.17",
54+
"better-auth": "^1.5.1",
5555
"class-variance-authority": "^0.7.1",
5656
"client-only": "^0.0.1",
5757
"clsx": "^2.1.1",
@@ -63,32 +63,32 @@
6363
"input-otp": "^1.4.2",
6464
"lucide-react": "^0.546.0",
6565
"nanoid": "^5.1.6",
66-
"next": "^16.1.5",
66+
"next": "^16.1.6",
6767
"next-themes": "^0.4.6",
68-
"nuqs": "^2.8.6",
68+
"nuqs": "^2.8.9",
6969
"react": "^19.2.4",
70-
"react-day-picker": "^9.13.0",
70+
"react-day-picker": "^9.14.0",
7171
"react-dom": "^19.2.4",
72-
"react-error-boundary": "^6.1.0",
73-
"react-hook-form": "^7.71.1",
72+
"react-error-boundary": "^6.1.1",
73+
"react-hook-form": "^7.71.2",
7474
"react-icons": "^5.5.0",
7575
"react-resizable-panels": "^3.0.6",
7676
"recharts": "2.15.4",
7777
"server-only": "^0.0.1",
7878
"sonner": "^2.0.7",
79-
"tailwind-merge": "^3.4.0",
79+
"tailwind-merge": "^3.5.0",
8080
"vaul": "^1.1.2",
8181
"zod": "^4.3.6"
8282
},
8383
"devDependencies": {
84-
"@tailwindcss/postcss": "^4.1.18",
85-
"@types/node": "^20.19.30",
84+
"@tailwindcss/postcss": "^4.2.1",
85+
"@types/node": "^20.19.35",
8686
"@types/react": "^19.2.2",
8787
"@types/react-dom": "19.2.2",
88-
"drizzle-kit": "^0.31.8",
89-
"eslint": "^9.39.2",
88+
"drizzle-kit": "^0.31.9",
89+
"eslint": "^9.39.3",
9090
"eslint-config-next": "16.0.0",
91-
"tailwindcss": "^4.1.18",
91+
"tailwindcss": "^4.2.1",
9292
"tsx": "^4.21.0",
9393
"tw-animate-css": "^1.4.0",
9494
"typescript": "^5.9.3"

src/app/(dashboard)/layout.tsx

Lines changed: 51 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,51 @@
1-
import { LoadingState } from "@/components/loading-state";
2-
import { SidebarProvider } from "@/components/ui/sidebar";
3-
import { auth } from "@/lib/auth";
4-
import DashboardNavbar from "@/modules/dashboard/ui/components/dashboard-navbar";
5-
import DashboardSidebar from "@/modules/dashboard/ui/components/dashboard-sidebar";
6-
import { headers } from "next/headers";
7-
import { redirect } from "next/navigation";
8-
import { ReactNode, Suspense } from "react";
9-
10-
interface DashboardLayoutProps {
11-
children: ReactNode;
12-
}
13-
14-
const AuthCheck = async ({ children }: DashboardLayoutProps) => {
15-
const session = await auth.api.getSession({
16-
headers: await headers(),
17-
});
18-
if (!session) redirect("/sign-in");
19-
return <>{children}</>;
20-
};
21-
22-
const DashboardLayout = ({ children }: DashboardLayoutProps) => {
23-
return (
24-
<SidebarProvider>
25-
<Suspense fallback={<LoadingState title="Loading layout..." description="Please wait a moment" />}>
26-
<DashboardSidebar />
27-
<main className="flex flex-col h-screen w-screen bg-muted">
28-
<DashboardNavbar />
29-
<Suspense
30-
fallback={<LoadingState title="Loading Agent..." description="Please wait a moment " />}
31-
>
32-
<AuthCheck>{children}</AuthCheck>
33-
</Suspense>
34-
</main>
35-
</Suspense>
36-
</SidebarProvider>
37-
);
38-
};
39-
export default DashboardLayout;
1+
import { LoadingState } from "@/components/loading-state";
2+
import { SidebarProvider } from "@/components/ui/sidebar";
3+
import { auth } from "@/lib/auth";
4+
import DashboardNavbar from "@/modules/dashboard/ui/components/dashboard-navbar";
5+
import DashboardSidebar from "@/modules/dashboard/ui/components/dashboard-sidebar";
6+
import { headers } from "next/headers";
7+
import { redirect } from "next/navigation";
8+
import { ReactNode, Suspense } from "react";
9+
10+
interface DashboardLayoutProps {
11+
children: ReactNode;
12+
}
13+
14+
const AuthCheck = async ({ children }: DashboardLayoutProps) => {
15+
const session = await auth.api.getSession({
16+
headers: await headers(),
17+
});
18+
if (!session) redirect("/sign-in");
19+
return <>{children}</>;
20+
};
21+
22+
const DashboardLayout = ({ children }: DashboardLayoutProps) => {
23+
return (
24+
<SidebarProvider>
25+
<Suspense
26+
fallback={
27+
<LoadingState
28+
title="Loading layout..."
29+
description="Please wait a moment"
30+
/>
31+
}
32+
>
33+
<DashboardSidebar />
34+
<main className="flex flex-col h-screen w-screen bg-muted">
35+
<DashboardNavbar />
36+
<Suspense
37+
fallback={
38+
<LoadingState
39+
title="Loading Agent..."
40+
description="Please wait a moment "
41+
/>
42+
}
43+
>
44+
<AuthCheck>{children}</AuthCheck>
45+
</Suspense>
46+
</main>
47+
</Suspense>
48+
</SidebarProvider>
49+
);
50+
};
51+
export default DashboardLayout;

src/app/(dashboard)/page.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { HomeView } from "@/modules/home/ui/views/home-view";
2-
3-
const Page = () => {
4-
return <HomeView />;
5-
};
6-
7-
export default Page;
1+
import { HomeView } from "@/modules/home/ui/views/home-view";
2+
3+
const Page = () => {
4+
return <HomeView />;
5+
};
6+
7+
export default Page;

src/db/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
import { drizzle } from "drizzle-orm/neon-http";
2-
3-
export const db = drizzle(process.env.DATABASE_URL || "postgres://postgres:postgres@localhost:5432/postgres");
1+
import { drizzle } from "drizzle-orm/neon-http";
2+
3+
export const db = drizzle(
4+
process.env.DATABASE_URL ||
5+
"postgres://postgres:postgres@localhost:5432/postgres",
6+
);

src/db/schema.ts

Lines changed: 105 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,105 @@
1-
import { boolean, pgEnum, pgTable, text, timestamp } from "drizzle-orm/pg-core";
2-
3-
import { nanoid } from "nanoid";
4-
5-
export const user = pgTable("user", {
6-
id: text("id").primaryKey(),
7-
name: text("name").notNull(),
8-
email: text("email").notNull().unique(),
9-
emailVerified: boolean("email_verified")
10-
.$defaultFn(() => false)
11-
.notNull(),
12-
image: text("image"),
13-
createdAt: timestamp("created_at")
14-
.$defaultFn(() => /* @__PURE__ */ new Date())
15-
.notNull(),
16-
updatedAt: timestamp("updated_at")
17-
.$defaultFn(() => /* @__PURE__ */ new Date())
18-
.notNull(),
19-
});
20-
21-
export const session = pgTable("session", {
22-
id: text("id").primaryKey(),
23-
expiresAt: timestamp("expires_at").notNull(),
24-
token: text("token").notNull().unique(),
25-
createdAt: timestamp("created_at").notNull(),
26-
updatedAt: timestamp("updated_at").notNull(),
27-
ipAddress: text("ip_address"),
28-
userAgent: text("user_agent"),
29-
userId: text("user_id")
30-
.notNull()
31-
.references(() => user.id, { onDelete: "cascade" }),
32-
});
33-
34-
export const account = pgTable("account", {
35-
id: text("id").primaryKey(),
36-
accountId: text("account_id").notNull(),
37-
providerId: text("provider_id").notNull(),
38-
userId: text("user_id")
39-
.notNull()
40-
.references(() => user.id, { onDelete: "cascade" }),
41-
accessToken: text("access_token"),
42-
refreshToken: text("refresh_token"),
43-
idToken: text("id_token"),
44-
accessTokenExpiresAt: timestamp("access_token_expires_at"),
45-
refreshTokenExpiresAt: timestamp("refresh_token_expires_at"),
46-
scope: text("scope"),
47-
password: text("password"),
48-
createdAt: timestamp("created_at").notNull(),
49-
updatedAt: timestamp("updated_at").notNull(),
50-
});
51-
52-
export const verification = pgTable("verification", {
53-
id: text("id").primaryKey(),
54-
identifier: text("identifier").notNull(),
55-
value: text("value").notNull(),
56-
expiresAt: timestamp("expires_at").notNull(),
57-
createdAt: timestamp("created_at").$defaultFn(() => /* @__PURE__ */ new Date()),
58-
updatedAt: timestamp("updated_at").$defaultFn(() => /* @__PURE__ */ new Date()),
59-
});
60-
61-
export const agents = pgTable("agents", {
62-
id: text("id")
63-
.primaryKey()
64-
.$defaultFn(() => nanoid()),
65-
name: text("name").notNull(),
66-
userId: text("user_id")
67-
.notNull()
68-
.references(() => user.id, { onDelete: "cascade" }),
69-
instructions: text("instructions").notNull(),
70-
createdAt: timestamp("created_at").notNull().defaultNow(),
71-
updatedAt: timestamp("updated_at").notNull().defaultNow(),
72-
});
73-
74-
export const meetingStatus = pgEnum("meeting_status", [
75-
"upcomming",
76-
"active",
77-
"completed",
78-
"processing",
79-
"cancelled",
80-
]);
81-
82-
export const meetings = pgTable("meetings", {
83-
id: text("id")
84-
.primaryKey()
85-
.$defaultFn(() => nanoid()),
86-
name: text("name").notNull(),
87-
userId: text("user_id")
88-
.notNull()
89-
.references(() => user.id, { onDelete: "cascade" }),
90-
agentId: text("agent_id")
91-
.notNull()
92-
.references(() => agents.id, { onDelete: "cascade" }),
93-
status: meetingStatus("status").notNull().default("upcomming"),
94-
startedAt: timestamp("started_at"),
95-
endedAt: timestamp("ended_at"),
96-
transcriptUrl: text("transcript_url"),
97-
recordingUrl: text("recording_url"),
98-
summary: text("summary"),
99-
createdAt: timestamp("created_at").notNull().defaultNow(),
100-
updatedAt: timestamp("updated_at").notNull().defaultNow(),
101-
});
1+
import { boolean, pgEnum, pgTable, text, timestamp } from "drizzle-orm/pg-core";
2+
3+
import { nanoid } from "nanoid";
4+
5+
export const user = pgTable("user", {
6+
id: text("id").primaryKey(),
7+
name: text("name").notNull(),
8+
email: text("email").notNull().unique(),
9+
emailVerified: boolean("email_verified")
10+
.$defaultFn(() => false)
11+
.notNull(),
12+
image: text("image"),
13+
createdAt: timestamp("created_at")
14+
.$defaultFn(() => /* @__PURE__ */ new Date())
15+
.notNull(),
16+
updatedAt: timestamp("updated_at")
17+
.$defaultFn(() => /* @__PURE__ */ new Date())
18+
.notNull(),
19+
});
20+
21+
export const session = pgTable("session", {
22+
id: text("id").primaryKey(),
23+
expiresAt: timestamp("expires_at").notNull(),
24+
token: text("token").notNull().unique(),
25+
createdAt: timestamp("created_at").notNull(),
26+
updatedAt: timestamp("updated_at").notNull(),
27+
ipAddress: text("ip_address"),
28+
userAgent: text("user_agent"),
29+
userId: text("user_id")
30+
.notNull()
31+
.references(() => user.id, { onDelete: "cascade" }),
32+
});
33+
34+
export const account = pgTable("account", {
35+
id: text("id").primaryKey(),
36+
accountId: text("account_id").notNull(),
37+
providerId: text("provider_id").notNull(),
38+
userId: text("user_id")
39+
.notNull()
40+
.references(() => user.id, { onDelete: "cascade" }),
41+
accessToken: text("access_token"),
42+
refreshToken: text("refresh_token"),
43+
idToken: text("id_token"),
44+
accessTokenExpiresAt: timestamp("access_token_expires_at"),
45+
refreshTokenExpiresAt: timestamp("refresh_token_expires_at"),
46+
scope: text("scope"),
47+
password: text("password"),
48+
createdAt: timestamp("created_at").notNull(),
49+
updatedAt: timestamp("updated_at").notNull(),
50+
});
51+
52+
export const verification = pgTable("verification", {
53+
id: text("id").primaryKey(),
54+
identifier: text("identifier").notNull(),
55+
value: text("value").notNull(),
56+
expiresAt: timestamp("expires_at").notNull(),
57+
createdAt: timestamp("created_at").$defaultFn(
58+
() => /* @__PURE__ */ new Date(),
59+
),
60+
updatedAt: timestamp("updated_at").$defaultFn(
61+
() => /* @__PURE__ */ new Date(),
62+
),
63+
});
64+
65+
export const agents = pgTable("agents", {
66+
id: text("id")
67+
.primaryKey()
68+
.$defaultFn(() => nanoid()),
69+
name: text("name").notNull(),
70+
userId: text("user_id")
71+
.notNull()
72+
.references(() => user.id, { onDelete: "cascade" }),
73+
instructions: text("instructions").notNull(),
74+
createdAt: timestamp("created_at").notNull().defaultNow(),
75+
updatedAt: timestamp("updated_at").notNull().defaultNow(),
76+
});
77+
78+
export const meetingStatus = pgEnum("meeting_status", [
79+
"upcomming",
80+
"active",
81+
"completed",
82+
"processing",
83+
"cancelled",
84+
]);
85+
86+
export const meetings = pgTable("meetings", {
87+
id: text("id")
88+
.primaryKey()
89+
.$defaultFn(() => nanoid()),
90+
name: text("name").notNull(),
91+
userId: text("user_id")
92+
.notNull()
93+
.references(() => user.id, { onDelete: "cascade" }),
94+
agentId: text("agent_id")
95+
.notNull()
96+
.references(() => agents.id, { onDelete: "cascade" }),
97+
status: meetingStatus("status").notNull().default("upcomming"),
98+
startedAt: timestamp("started_at"),
99+
endedAt: timestamp("ended_at"),
100+
transcriptUrl: text("transcript_url"),
101+
recordingUrl: text("recording_url"),
102+
summary: text("summary"),
103+
createdAt: timestamp("created_at").notNull().defaultNow(),
104+
updatedAt: timestamp("updated_at").notNull().defaultNow(),
105+
});

0 commit comments

Comments
 (0)