Skip to content

Commit afc1fb3

Browse files
committed
added new packages for the main to work properly
1 parent faeaa29 commit afc1fb3

File tree

7 files changed

+1878
-1153
lines changed

7 files changed

+1878
-1153
lines changed

drizzle.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ export default defineConfig({
66
dialect: "turso",
77
out: "./drizzle",
88
dbCredentials: {
9-
url: process.env.DATABASE_URL!,
10-
//url: process.env.TURSO_DATABASE_URL!,
9+
//url: process.env.DATABASE_URL!,
10+
url: process.env.TURSO_DATABASE_URL!,
1111
authToken: process.env.TURSO_AUTH_TOKEN!,
1212
},
1313
});
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
CREATE TABLE `attachments` (
2+
`attachment_id` text PRIMARY KEY NOT NULL,
3+
`lesson_id` text NOT NULL,
4+
`title` text,
5+
`media_type` text DEFAULT 'other' NOT NULL,
6+
`blob_id` text,
7+
`external_url` text,
8+
`metadata` text DEFAULT '{}' NOT NULL,
9+
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
10+
`updated_at` integer DEFAULT (unixepoch()) NOT NULL,
11+
FOREIGN KEY (`lesson_id`) REFERENCES `lessons`(`lesson_id`) ON UPDATE no action ON DELETE cascade,
12+
FOREIGN KEY (`blob_id`) REFERENCES `blobs`(`blob_id`) ON UPDATE no action ON DELETE set null
13+
);
14+
--> statement-breakpoint
15+
CREATE TABLE `blobs` (
16+
`blob_id` text PRIMARY KEY NOT NULL,
17+
`bucket` text NOT NULL,
18+
`object_key` text NOT NULL,
19+
`version_id` text,
20+
`etag` text,
21+
`size_bytes` integer,
22+
`content_type` text,
23+
`checksum_sha256` text,
24+
`storage_class` text,
25+
`created_by` text,
26+
`is_deleted` integer DEFAULT 0 NOT NULL,
27+
`deleted_at` integer,
28+
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
29+
`updated_at` integer DEFAULT (unixepoch()) NOT NULL,
30+
FOREIGN KEY (`created_by`) REFERENCES `users`(`user_id`) ON UPDATE no action ON DELETE set null
31+
);
32+
--> statement-breakpoint
33+
CREATE TABLE `courses` (
34+
`course_id` text PRIMARY KEY NOT NULL,
35+
`title` text NOT NULL,
36+
`description` text,
37+
`difficulty` text DEFAULT 'beginner' NOT NULL,
38+
`created_by` text,
39+
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
40+
`updated_at` integer DEFAULT (unixepoch()) NOT NULL,
41+
FOREIGN KEY (`created_by`) REFERENCES `users`(`user_id`) ON UPDATE no action ON DELETE set null
42+
);
43+
--> statement-breakpoint
44+
CREATE TABLE `courses_tags` (
45+
`course_id` text NOT NULL,
46+
`tag_id` text NOT NULL,
47+
`added_at` integer DEFAULT (unixepoch()) NOT NULL,
48+
PRIMARY KEY(`course_id`, `tag_id`),
49+
FOREIGN KEY (`course_id`) REFERENCES `courses`(`course_id`) ON UPDATE no action ON DELETE cascade,
50+
FOREIGN KEY (`tag_id`) REFERENCES `tags`(`tag_id`) ON UPDATE no action ON DELETE cascade
51+
);
52+
--> statement-breakpoint
53+
CREATE TABLE `lessons` (
54+
`lesson_id` text PRIMARY KEY NOT NULL,
55+
`unit_id` text NOT NULL,
56+
`media_type` text DEFAULT 'markdown' NOT NULL,
57+
`content_url` text,
58+
`content_blob_id` text,
59+
`metadata` text DEFAULT '{}' NOT NULL,
60+
`position` integer DEFAULT 1 NOT NULL,
61+
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
62+
`updated_at` integer DEFAULT (unixepoch()) NOT NULL,
63+
FOREIGN KEY (`unit_id`) REFERENCES `units`(`unit_id`) ON UPDATE no action ON DELETE cascade,
64+
FOREIGN KEY (`content_blob_id`) REFERENCES `blobs`(`blob_id`) ON UPDATE no action ON DELETE set null
65+
);
66+
--> statement-breakpoint
67+
CREATE TABLE `profiles` (
68+
`profile_id` text PRIMARY KEY NOT NULL,
69+
`user_id` text NOT NULL,
70+
`role` text DEFAULT 'student' NOT NULL,
71+
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
72+
`updated_at` integer DEFAULT (unixepoch()) NOT NULL,
73+
FOREIGN KEY (`user_id`) REFERENCES `users`(`user_id`) ON UPDATE no action ON DELETE cascade
74+
);
75+
--> statement-breakpoint
76+
CREATE TABLE `tags` (
77+
`tag_id` text PRIMARY KEY NOT NULL,
78+
`tag_name` text NOT NULL,
79+
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
80+
`updated_at` integer DEFAULT (unixepoch()) NOT NULL
81+
);
82+
--> statement-breakpoint
83+
CREATE TABLE `units` (
84+
`unit_id` text PRIMARY KEY NOT NULL,
85+
`course_id` text NOT NULL,
86+
`title` text,
87+
`position` integer DEFAULT 1 NOT NULL,
88+
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
89+
`updated_at` integer DEFAULT (unixepoch()) NOT NULL,
90+
FOREIGN KEY (`course_id`) REFERENCES `courses`(`course_id`) ON UPDATE no action ON DELETE cascade
91+
);
92+
--> statement-breakpoint
93+
CREATE TABLE `users` (
94+
`user_id` text PRIMARY KEY NOT NULL,
95+
`provider` text NOT NULL,
96+
`subject` text NOT NULL,
97+
`email` text,
98+
`display_name` text,
99+
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
100+
`updated_at` integer DEFAULT (unixepoch()) NOT NULL
101+
);

drizzle/0000_safe_polaris.sql

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
CREATE TABLE IF NOT EXISTS `attachments` (
2+
`attachment_id` text PRIMARY KEY NOT NULL,
3+
`lesson_id` text NOT NULL,
4+
`title` text,
5+
`media_type` text DEFAULT 'other' NOT NULL,
6+
`blob_id` text,
7+
`external_url` text,
8+
`metadata` text DEFAULT '{}' NOT NULL,
9+
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
10+
`updated_at` integer DEFAULT (unixepoch()) NOT NULL,
11+
FOREIGN KEY (`lesson_id`) REFERENCES `lessons`(`lesson_id`) ON UPDATE no action ON DELETE cascade,
12+
FOREIGN KEY (`blob_id`) REFERENCES `blobs`(`blob_id`) ON UPDATE no action ON DELETE set null
13+
);
14+
--> statement-breakpoint
15+
CREATE TABLE IF NOT EXISTS `blobs` (
16+
`blob_id` text PRIMARY KEY NOT NULL,
17+
`bucket` text NOT NULL,
18+
`object_key` text NOT NULL,
19+
`version_id` text,
20+
`etag` text,
21+
`size_bytes` integer,
22+
`content_type` text,
23+
`checksum_sha256` text,
24+
`storage_class` text,
25+
`created_by` text,
26+
`is_deleted` integer DEFAULT 0 NOT NULL,
27+
`deleted_at` integer,
28+
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
29+
`updated_at` integer DEFAULT (unixepoch()) NOT NULL,
30+
FOREIGN KEY (`created_by`) REFERENCES `users`(`user_id`) ON UPDATE no action ON DELETE set null
31+
);
32+
--> statement-breakpoint
33+
CREATE TABLE IF NOT EXISTS `courses` (
34+
`course_id` text PRIMARY KEY NOT NULL,
35+
`title` text NOT NULL,
36+
`description` text,
37+
`difficulty` text DEFAULT 'beginner' NOT NULL,
38+
`created_by` text,
39+
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
40+
`updated_at` integer DEFAULT (unixepoch()) NOT NULL,
41+
FOREIGN KEY (`created_by`) REFERENCES `users`(`user_id`) ON UPDATE no action ON DELETE set null
42+
);
43+
--> statement-breakpoint
44+
CREATE TABLE IF NOT EXISTS `courses_tags` (
45+
`course_id` text NOT NULL,
46+
`tag_id` text NOT NULL,
47+
`added_at` integer DEFAULT (unixepoch()) NOT NULL,
48+
PRIMARY KEY(`course_id`, `tag_id`),
49+
FOREIGN KEY (`course_id`) REFERENCES `courses`(`course_id`) ON UPDATE no action ON DELETE cascade,
50+
FOREIGN KEY (`tag_id`) REFERENCES `tags`(`tag_id`) ON UPDATE no action ON DELETE cascade
51+
);
52+
--> statement-breakpoint
53+
CREATE TABLE IF NOT EXISTS `lessons` (
54+
`lesson_id` text PRIMARY KEY NOT NULL,
55+
`unit_id` text NOT NULL,
56+
`media_type` text DEFAULT 'markdown' NOT NULL,
57+
`content_url` text,
58+
`content_blob_id` text,
59+
`metadata` text DEFAULT '{}' NOT NULL,
60+
`position` integer DEFAULT 1 NOT NULL,
61+
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
62+
`updated_at` integer DEFAULT (unixepoch()) NOT NULL,
63+
FOREIGN KEY (`unit_id`) REFERENCES `units`(`unit_id`) ON UPDATE no action ON DELETE cascade,
64+
FOREIGN KEY (`content_blob_id`) REFERENCES `blobs`(`blob_id`) ON UPDATE no action ON DELETE set null
65+
);
66+
--> statement-breakpoint
67+
CREATE TABLE IF NOT EXISTS `profiles` (
68+
`profile_id` text PRIMARY KEY NOT NULL,
69+
`user_id` text NOT NULL,
70+
`role` text DEFAULT 'student' NOT NULL,
71+
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
72+
`updated_at` integer DEFAULT (unixepoch()) NOT NULL,
73+
FOREIGN KEY (`user_id`) REFERENCES `users`(`user_id`) ON UPDATE no action ON DELETE cascade
74+
);
75+
--> statement-breakpoint
76+
CREATE TABLE IF NOT EXISTS `tags` (
77+
`tag_id` text PRIMARY KEY NOT NULL,
78+
`tag_name` text NOT NULL,
79+
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
80+
`updated_at` integer DEFAULT (unixepoch()) NOT NULL
81+
);
82+
--> statement-breakpoint
83+
CREATE TABLE IF NOT EXISTS `units` (
84+
`unit_id` text PRIMARY KEY NOT NULL,
85+
`course_id` text NOT NULL,
86+
`title` text,
87+
`position` integer DEFAULT 1 NOT NULL,
88+
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
89+
`updated_at` integer DEFAULT (unixepoch()) NOT NULL,
90+
FOREIGN KEY (`course_id`) REFERENCES `courses`(`course_id`) ON UPDATE no action ON DELETE cascade
91+
);
92+
--> statement-breakpoint
93+
CREATE TABLE IF NOT EXISTS `users` (
94+
`user_id` text PRIMARY KEY NOT NULL,
95+
`provider` text NOT NULL,
96+
`subject` text NOT NULL,
97+
`email` text,
98+
`display_name` text,
99+
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
100+
`updated_at` integer DEFAULT (unixepoch()) NOT NULL
101+
);

drizzle/0002_complex_khan.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE users
2+
ADD COLUMN role TEXT NOT NULL DEFAULT 'student';

package.json

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,46 +19,51 @@
1919
],
2020
"dependencies": {
2121
"@libsql/client": "^0.15.15",
22-
"@radix-ui/react-aspect-ratio": "^1.1.7",
22+
"@radix-ui/react-alert-dialog": "^1.1.15",
23+
"@radix-ui/react-aspect-ratio": "^1.1.8",
24+
"@radix-ui/react-avatar": "^1.1.11",
2325
"@radix-ui/react-checkbox": "^1.3.3",
2426
"@radix-ui/react-dropdown-menu": "^2.1.16",
25-
"@radix-ui/react-progress": "^1.1.7",
27+
"@radix-ui/react-icons": "^1.3.2",
28+
"@radix-ui/react-navigation-menu": "^1.2.14",
29+
"@radix-ui/react-progress": "^1.1.8",
2630
"@radix-ui/react-scroll-area": "^1.2.10",
27-
"@radix-ui/react-separator": "^1.1.7",
28-
"@radix-ui/react-slot": "^1.2.3",
31+
"@radix-ui/react-separator": "^1.1.8",
32+
"@radix-ui/react-slot": "^1.2.4",
2933
"@radix-ui/react-tabs": "^1.1.13",
30-
"better-auth": "^1.3.26",
34+
"@radix-ui/react-tooltip": "^1.2.8",
35+
"better-auth": "^1.3.34",
3136
"class-variance-authority": "^0.7.1",
3237
"clsx": "^2.1.1",
33-
"drizzle-orm": "^0.44.6",
34-
"lucide-react": "^0.552.0",
35-
"next": "15.5.4",
38+
"drizzle-orm": "^0.44.7",
39+
"lucide-react": "^0.554.0",
40+
"next": "16.0.3",
3641
"next-safe-action": "8.0.11",
37-
"react": "19.1.0",
38-
"react-dom": "19.1.0",
39-
"react-hook-form": "^7.63.0",
40-
"tailwind-merge": "^3.3.1",
41-
"web": "link:@libsql/client/web",
4242
"next-themes": "^0.4.6",
43+
"react": "19.2.0",
44+
"react-dom": "19.2.0",
45+
"react-hook-form": "^7.66.1",
4346
"sonner": "^2.0.7",
44-
"zod": "^4.1.11"
47+
"tailwind-merge": "^3.4.0",
48+
"web": "link:@libsql/client/web",
49+
"zod": "^4.1.12"
4550
},
4651
"devDependencies": {
47-
"@eslint/eslintrc": "^3",
48-
"@tailwindcss/postcss": "^4",
52+
"@eslint/eslintrc": "^3.3.1",
53+
"@tailwindcss/postcss": "^4.1.17",
4954
"@types/better-sqlite3": "^7.6.13",
50-
"@types/node": "^20",
51-
"@types/react": "^19",
52-
"@types/react-dom": "^19",
53-
"autoprefixer": "^10.4.21",
55+
"@types/node": "^24.10.1",
56+
"@types/react": "^19.2.6",
57+
"@types/react-dom": "^19.2.3",
58+
"autoprefixer": "^10.4.22",
5459
"dotenv": "^17.2.3",
55-
"drizzle-kit": "^0.31.5",
56-
"eslint": "^9",
57-
"eslint-config-next": "15.5.4",
60+
"drizzle-kit": "^0.31.7",
61+
"eslint": "^9.39.1",
62+
"eslint-config-next": "16.0.3",
5863
"postcss": "^8.5.6",
59-
"tailwindcss": "^4",
64+
"tailwindcss": "^4.1.17",
6065
"tsx": "^4.20.6",
6166
"tw-animate-css": "^1.4.0",
62-
"typescript": "^5"
67+
"typescript": "^5.9.3"
6368
}
6469
}

0 commit comments

Comments
 (0)