Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

feat: :sparkles: adding projects

Andrejdb2f600d58ea
diff --git a/apps/api/drizzle/0000_abandoned_power_man.sql b/apps/api/drizzle/0000_abandoned_power_man.sql
new file mode 100644
index 000000000..d57888dcb
--- /dev/null
+++ b/apps/api/drizzle/0000_abandoned_power_man.sql
@@ -0,0 +1,56 @@
+CREATE TABLE `project` (
+ `id` text PRIMARY KEY NOT NULL,
+ `workspace_id` text NOT NULL,
+ `name` text NOT NULL,
+ `description` text,
+ `created_at` integer DEFAULT '"2025-01-18T14:59:51.091Z"' NOT NULL,
+ FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE cascade ON DELETE cascade
+);
+--> statement-breakpoint
+CREATE TABLE `session` (
+ `id` text PRIMARY KEY NOT NULL,
+ `user_id` text NOT NULL,
+ `expires_at` integer NOT NULL,
+ FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE cascade ON DELETE cascade
+);
+--> statement-breakpoint
+CREATE TABLE `task` (
+ `id` text PRIMARY KEY NOT NULL,
+ `project_id` text NOT NULL,
+ `assignee_id` text NOT NULL,
+ `title` text NOT NULL,
+ `description` text,
+ `status` text DEFAULT 'to-do' NOT NULL,
+ `due_date` integer,
+ `created_at` integer DEFAULT '"2025-01-18T14:59:51.091Z"' NOT NULL,
+ FOREIGN KEY (`project_id`) REFERENCES `project`(`id`) ON UPDATE cascade ON DELETE cascade,
+ FOREIGN KEY (`assignee_id`) REFERENCES `user`(`id`) ON UPDATE cascade ON DELETE cascade
+);
+--> statement-breakpoint
+CREATE TABLE `user` (
+ `id` text PRIMARY KEY NOT NULL,
+ `name` text NOT NULL,
+ `password` text NOT NULL,
+ `email` text NOT NULL,
+ `created_at` integer DEFAULT '"2025-01-18T14:59:51.090Z"' NOT NULL
+);
+--> statement-breakpoint
+CREATE UNIQUE INDEX `user_email_unique` ON `user` (`email`);--> statement-breakpoint
+CREATE TABLE `workspace` (
+ `id` text PRIMARY KEY NOT NULL,
+ `name` text NOT NULL,
+ `description` text,
+ `owner_id` text NOT NULL,
+ `created_at` integer DEFAULT '"2025-01-18T14:59:51.091Z"' NOT NULL,
+ FOREIGN KEY (`owner_id`) REFERENCES `user`(`id`) ON UPDATE cascade ON DELETE cascade
+);
+--> statement-breakpoint
+CREATE TABLE `workspace_member` (
+ `id` text PRIMARY KEY NOT NULL,
+ `workspace_id` text NOT NULL,
+ `user_id` text NOT NULL,
+ `role` text,
+ `joined_at` integer DEFAULT '"2025-01-18T14:59:51.091Z"' NOT NULL,
+ FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE cascade ON DELETE cascade,
+ FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE cascade ON DELETE cascade
+);
diff --git a/apps/api/drizzle/0000_shocking_screwball.sql b/apps/api/drizzle/0000_shocking_screwball.sql
deleted file mode 100644
index e64baba28..000000000
--- a/apps/api/drizzle/0000_shocking_screwball.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-CREATE TABLE `user` (
- `id` text PRIMARY KEY NOT NULL,
- `name` text NOT NULL,
- `password` text NOT NULL,
- `email` text NOT NULL,
- `created_at` integer DEFAULT '"2025-01-01T22:11:31.903Z"' NOT NULL,
- `refresh_token_version` integer DEFAULT 0 NOT NULL
-);
---> statement-breakpoint
-CREATE UNIQUE INDEX `user_name_unique` ON `user` (`name`);--> statement-breakpoint
-CREATE UNIQUE INDEX `user_email_unique` ON `user` (`email`);
\ No newline at end of file
diff --git a/apps/api/drizzle/0001_melted_whizzer.sql b/apps/api/drizzle/0001_melted_whizzer.sql
deleted file mode 100644
index 1a806a8dd..000000000
--- a/apps/api/drizzle/0001_melted_whizzer.sql
+++ /dev/null
@@ -1,14 +0,0 @@
-PRAGMA foreign_keys=OFF;--> statement-breakpoint
-CREATE TABLE `__new_user` (
- `id` text PRIMARY KEY NOT NULL,
- `name` text NOT NULL,
- `password` text NOT NULL,
- `email` text NOT NULL,
- `created_at` integer DEFAULT '"2025-01-04T13:09:57.494Z"' NOT NULL
-);
---> statement-breakpoint
-INSERT INTO `__new_user`("id", "name", "password", "email", "created_at") SELECT "id", "name", "password", "email", "created_at" FROM `user`;--> statement-breakpoint
-DROP TABLE `user`;--> statement-breakpoint
-ALTER TABLE `__new_user` RENAME TO `user`;--> statement-breakpoint
-PRAGMA foreign_keys=ON;--> statement-breakpoint
-CREATE UNIQUE INDEX `user_email_unique` ON `user` (`email`);
\ No newline at end of file
diff --git a/apps/api/drizzle/0002_flowery_secret_warriors.sql b/apps/api/drizzle/0002_flowery_secret_warriors.sql
deleted file mode 100644
index 1131d0297..000000000
--- a/apps/api/drizzle/0002_flowery_secret_warriors.sql
+++ /dev/null
@@ -1,21 +0,0 @@
-CREATE TABLE `session` (
- `id` text PRIMARY KEY NOT NULL,
- `user_id` text NOT NULL,
- `expires_at` integer NOT NULL,
- FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE no action
-);
---> statement-breakpoint
-PRAGMA foreign_keys=OFF;--> statement-breakpoint
-CREATE TABLE `__new_user` (
- `id` text PRIMARY KEY NOT NULL,
- `name` text NOT NULL,
- `password` text NOT NULL,
- `email` text NOT NULL,
- `created_at` integer DEFAULT '"2025-01-04T22:24:29.828Z"' NOT NULL
-);
---> statement-breakpoint
-INSERT INTO `__new_user`("id", "name", "password", "email", "created_at") SELECT "id", "name", "password", "email", "created_at" FROM `user`;--> statement-breakpoint
-DROP TABLE `user`;--> statement-breakpoint
-ALTER TABLE `__new_user` RENAME TO `user`;--> statement-breakpoint
-PRAGMA foreign_keys=ON;--> statement-breakpoint
-CREATE UNIQUE INDEX `user_email_unique` ON `user` (`email`);
\ No newline at end of file
diff --git a/apps/api/drizzle/0003_mature_madripoor.sql b/apps/api/drizzle/0003_mature_madripoor.sql
deleted file mode 100644
index c4016f0af..000000000
--- a/apps/api/drizzle/0003_mature_madripoor.sql
+++ /dev/null
@@ -1,55 +0,0 @@
-CREATE TABLE `board` (
- `id` text PRIMARY KEY NOT NULL,
- `workspace_id` text NOT NULL,
- `name` text NOT NULL,
- `description` text,
- `created_at` integer DEFAULT '"2025-01-05T21:49:54.348Z"' NOT NULL,
- FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE no action ON DELETE no action
-);
---> statement-breakpoint
-CREATE TABLE `task` (
- `id` text PRIMARY KEY NOT NULL,
- `board_id` text NOT NULL,
- `assignee_id` text NOT NULL,
- `title` text NOT NULL,
- `description` text,
- `status` text DEFAULT 'to-do' NOT NULL,
- `due_date` integer,
- `created_at` integer DEFAULT '"2025-01-05T21:49:54.348Z"' NOT NULL,
- FOREIGN KEY (`board_id`) REFERENCES `board`(`id`) ON UPDATE no action ON DELETE no action,
- FOREIGN KEY (`assignee_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE no action
-);
---> statement-breakpoint
-CREATE TABLE `workspace` (
- `id` text PRIMARY KEY NOT NULL,
- `name` text NOT NULL,
- `description` text,
- `owner_id` text NOT NULL,
- `created_at` integer DEFAULT '"2025-01-05T21:49:54.347Z"' NOT NULL,
- FOREIGN KEY (`owner_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE no action
-);
---> statement-breakpoint
-CREATE TABLE `workspace_member` (
- `id` text PRIMARY KEY NOT NULL,
- `workspace_id` text NOT NULL,
- `user_id` text NOT NULL,
- `role` text,
- `joined_at` integer DEFAULT '"2025-01-05T21:49:54.347Z"' NOT NULL,
- FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE no action ON DELETE no action,
- FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE no action
-);
---> statement-breakpoint
-PRAGMA foreign_keys=OFF;--> statement-breakpoint
-CREATE TABLE `__new_user` (
- `id` text PRIMARY KEY NOT NULL,
- `name` text NOT NULL,
- `password` text NOT NULL,
- `email` text NOT NULL,
- `created_at` integer DEFAULT '"2025-01-05T21:49:54.347Z"' NOT NULL
-);
---> statement-breakpoint
-INSERT INTO `__new_user`("id", "name", "password", "email", "created_at") SELECT "id", "name", "password", "email", "created_at" FROM `user`;--> statement-breakpoint
-DROP TABLE `user`;--> statement-breakpoint
-ALTER TABLE `__new_user` RENAME TO `user`;--> statement-breakpoint
-PRAGMA foreign_keys=ON;--> statement-breakpoint
-CREATE UNIQUE INDEX `user_email_unique` ON `user` (`email`);
\ No newline at end of file
diff --git a/apps/api/drizzle/0004_quiet_vector.sql b/apps/api/drizzle/0004_quiet_vector.sql
deleted file mode 100644
index ac134943e..000000000
--- a/apps/api/drizzle/0004_quiet_vector.sql
+++ /dev/null
@@ -1,77 +0,0 @@
-PRAGMA foreign_keys=OFF;--> statement-breakpoint
-CREATE TABLE `__new_session` (
- `id` text PRIMARY KEY NOT NULL,
- `user_id` text NOT NULL,
- `expires_at` integer NOT NULL,
- FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-INSERT INTO `__new_session`("id", "user_id", "expires_at") SELECT "id", "user_id", "expires_at" FROM `session`;--> statement-breakpoint
-DROP TABLE `session`;--> statement-breakpoint
-ALTER TABLE `__new_session` RENAME TO `session`;--> statement-breakpoint
-PRAGMA foreign_keys=ON;--> statement-breakpoint
-CREATE TABLE `__new_workspace` (
- `id` text PRIMARY KEY NOT NULL,
- `name` text NOT NULL,
- `description` text,
- `owner_id` text NOT NULL,
- `created_at` integer DEFAULT '"2025-01-05T21:51:16.320Z"' NOT NULL,
- FOREIGN KEY (`owner_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-INSERT INTO `__new_workspace`("id", "name", "description", "owner_id", "created_at") SELECT "id", "name", "description", "owner_id", "created_at" FROM `workspace`;--> statement-breakpoint
-DROP TABLE `workspace`;--> statement-breakpoint
-ALTER TABLE `__new_workspace` RENAME TO `workspace`;--> statement-breakpoint
-CREATE TABLE `__new_board` (
- `id` text PRIMARY KEY NOT NULL,
- `workspace_id` text NOT NULL,
- `name` text NOT NULL,
- `description` text,
- `created_at` integer DEFAULT '"2025-01-05T21:51:16.320Z"' NOT NULL,
- FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE no action ON DELETE no action
-);
---> statement-breakpoint
-INSERT INTO `__new_board`("id", "workspace_id", "name", "description", "created_at") SELECT "id", "workspace_id", "name", "description", "created_at" FROM `board`;--> statement-breakpoint
-DROP TABLE `board`;--> statement-breakpoint
-ALTER TABLE `__new_board` RENAME TO `board`;--> statement-breakpoint
-CREATE TABLE `__new_task` (
- `id` text PRIMARY KEY NOT NULL,
- `board_id` text NOT NULL,
- `assignee_id` text NOT NULL,
- `title` text NOT NULL,
- `description` text,
- `status` text DEFAULT 'to-do' NOT NULL,
- `due_date` integer,
- `created_at` integer DEFAULT '"2025-01-05T21:51:16.320Z"' NOT NULL,
- FOREIGN KEY (`board_id`) REFERENCES `board`(`id`) ON UPDATE no action ON DELETE no action,
- FOREIGN KEY (`assignee_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE no action
-);
---> statement-breakpoint
-INSERT INTO `__new_task`("id", "board_id", "assignee_id", "title", "description", "status", "due_date", "created_at") SELECT "id", "board_id", "assignee_id", "title", "description", "status", "due_date", "created_at" FROM `task`;--> statement-breakpoint
-DROP TABLE `task`;--> statement-breakpoint
-ALTER TABLE `__new_task` RENAME TO `task`;--> statement-breakpoint
-CREATE TABLE `__new_user` (
- `id` text PRIMARY KEY NOT NULL,
- `name` text NOT NULL,
- `password` text NOT NULL,
- `email` text NOT NULL,
- `created_at` integer DEFAULT '"2025-01-05T21:51:16.320Z"' NOT NULL
-);
---> statement-breakpoint
-INSERT INTO `__new_user`("id", "name", "password", "email", "created_at") SELECT "id", "name", "password", "email", "created_at" FROM `user`;--> statement-breakpoint
-DROP TABLE `user`;--> statement-breakpoint
-ALTER TABLE `__new_user` RENAME TO `user`;--> statement-breakpoint
-CREATE UNIQUE INDEX `user_email_unique` ON `user` (`email`);--> statement-breakpoint
-CREATE TABLE `__new_workspace_member` (
- `id` text PRIMARY KEY NOT NULL,
- `workspace_id` text NOT NULL,
- `user_id` text NOT NULL,
- `role` text,
- `joined_at` integer DEFAULT '"2025-01-05T21:51:16.320Z"' NOT NULL,
- FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE no action ON DELETE no action,
- FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE no action
-);
---> statement-breakpoint
-INSERT INTO `__new_workspace_member`("id", "workspace_id", "user_id", "role", "joined_at") SELECT "id", "workspace_id", "user_id", "role", "joined_at" FROM `workspace_member`;--> statement-breakpoint
-DROP TABLE `workspace_member`;--> statement-breakpoint
-ALTER TABLE `__new_workspace_member` RENAME TO `workspace_member`;
\ No newline at end of file
diff --git a/apps/api/drizzle/0005_lyrical_marvex.sql b/apps/api/drizzle/0005_lyrical_marvex.sql
deleted file mode 100644
index 0652f7093..000000000
--- a/apps/api/drizzle/0005_lyrical_marvex.sql
+++ /dev/null
@@ -1,67 +0,0 @@
-PRAGMA foreign_keys=OFF;--> statement-breakpoint
-CREATE TABLE `__new_task` (
- `id` text PRIMARY KEY NOT NULL,
- `board_id` text NOT NULL,
- `assignee_id` text NOT NULL,
- `title` text NOT NULL,
- `description` text,
- `status` text DEFAULT 'to-do' NOT NULL,
- `due_date` integer,
- `created_at` integer DEFAULT '"2025-01-05T21:51:38.968Z"' NOT NULL,
- FOREIGN KEY (`board_id`) REFERENCES `board`(`id`) ON UPDATE no action ON DELETE no action,
- FOREIGN KEY (`assignee_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-INSERT INTO `__new_task`("id", "board_id", "assignee_id", "title", "description", "status", "due_date", "created_at") SELECT "id", "board_id", "assignee_id", "title", "description", "status", "due_date", "created_at" FROM `task`;--> statement-breakpoint
-DROP TABLE `task`;--> statement-breakpoint
-ALTER TABLE `__new_task` RENAME TO `task`;--> statement-breakpoint
-PRAGMA foreign_keys=ON;--> statement-breakpoint
-CREATE TABLE `__new_workspace_member` (
- `id` text PRIMARY KEY NOT NULL,
- `workspace_id` text NOT NULL,
- `user_id` text NOT NULL,
- `role` text,
- `joined_at` integer DEFAULT '"2025-01-05T21:51:38.967Z"' NOT NULL,
- FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE no action ON DELETE no action,
- FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-INSERT INTO `__new_workspace_member`("id", "workspace_id", "user_id", "role", "joined_at") SELECT "id", "workspace_id", "user_id", "role", "joined_at" FROM `workspace_member`;--> statement-breakpoint
-DROP TABLE `workspace_member`;--> statement-breakpoint
-ALTER TABLE `__new_workspace_member` RENAME TO `workspace_member`;--> statement-breakpoint
-CREATE TABLE `__new_board` (
- `id` text PRIMARY KEY NOT NULL,
- `workspace_id` text NOT NULL,
- `name` text NOT NULL,
- `description` text,
- `created_at` integer DEFAULT '"2025-01-05T21:51:38.968Z"' NOT NULL,
- FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE no action ON DELETE no action
-);
---> statement-breakpoint
-INSERT INTO `__new_board`("id", "workspace_id", "name", "description", "created_at") SELECT "id", "workspace_id", "name", "description", "created_at" FROM `board`;--> statement-breakpoint
-DROP TABLE `board`;--> statement-breakpoint
-ALTER TABLE `__new_board` RENAME TO `board`;--> statement-breakpoint
-CREATE TABLE `__new_user` (
- `id` text PRIMARY KEY NOT NULL,
- `name` text NOT NULL,
- `password` text NOT NULL,
- `email` text NOT NULL,
- `created_at` integer DEFAULT '"2025-01-05T21:51:38.967Z"' NOT NULL
-);
---> statement-breakpoint
-INSERT INTO `__new_user`("id", "name", "password", "email", "created_at") SELECT "id", "name", "password", "email", "created_at" FROM `user`;--> statement-breakpoint
-DROP TABLE `user`;--> statement-breakpoint
-ALTER TABLE `__new_user` RENAME TO `user`;--> statement-breakpoint
-CREATE UNIQUE INDEX `user_email_unique` ON `user` (`email`);--> statement-breakpoint
-CREATE TABLE `__new_workspace` (
- `id` text PRIMARY KEY NOT NULL,
- `name` text NOT NULL,
- `description` text,
- `owner_id` text NOT NULL,
- `created_at` integer DEFAULT '"2025-01-05T21:51:38.967Z"' NOT NULL,
- FOREIGN KEY (`owner_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-INSERT INTO `__new_workspace`("id", "name", "description", "owner_id", "created_at") SELECT "id", "name", "description", "owner_id", "created_at" FROM `workspace`;--> statement-breakpoint
-DROP TABLE `workspace`;--> statement-breakpoint
-ALTER TABLE `__new_workspace` RENAME TO `workspace`;
\ No newline at end of file
diff --git a/apps/api/drizzle/0006_windy_sabra.sql b/apps/api/drizzle/0006_windy_sabra.sql
deleted file mode 100644
index a7a439843..000000000
--- a/apps/api/drizzle/0006_windy_sabra.sql
+++ /dev/null
@@ -1,67 +0,0 @@
-PRAGMA foreign_keys=OFF;--> statement-breakpoint
-CREATE TABLE `__new_board` (
- `id` text PRIMARY KEY NOT NULL,
- `workspace_id` text NOT NULL,
- `name` text NOT NULL,
- `description` text,
- `created_at` integer DEFAULT '"2025-01-05T21:52:34.989Z"' NOT NULL,
- FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-INSERT INTO `__new_board`("id", "workspace_id", "name", "description", "created_at") SELECT "id", "workspace_id", "name", "description", "created_at" FROM `board`;--> statement-breakpoint
-DROP TABLE `board`;--> statement-breakpoint
-ALTER TABLE `__new_board` RENAME TO `board`;--> statement-breakpoint
-PRAGMA foreign_keys=ON;--> statement-breakpoint
-CREATE TABLE `__new_task` (
- `id` text PRIMARY KEY NOT NULL,
- `board_id` text NOT NULL,
- `assignee_id` text NOT NULL,
- `title` text NOT NULL,
- `description` text,
- `status` text DEFAULT 'to-do' NOT NULL,
- `due_date` integer,
- `created_at` integer DEFAULT '"2025-01-05T21:52:34.989Z"' NOT NULL,
- FOREIGN KEY (`board_id`) REFERENCES `board`(`id`) ON UPDATE no action ON DELETE cascade,
- FOREIGN KEY (`assignee_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-INSERT INTO `__new_task`("id", "board_id", "assignee_id", "title", "description", "status", "due_date", "created_at") SELECT "id", "board_id", "assignee_id", "title", "description", "status", "due_date", "created_at" FROM `task`;--> statement-breakpoint
-DROP TABLE `task`;--> statement-breakpoint
-ALTER TABLE `__new_task` RENAME TO `task`;--> statement-breakpoint
-CREATE TABLE `__new_workspace_member` (
- `id` text PRIMARY KEY NOT NULL,
- `workspace_id` text NOT NULL,
- `user_id` text NOT NULL,
- `role` text,
- `joined_at` integer DEFAULT '"2025-01-05T21:52:34.989Z"' NOT NULL,
- FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE no action ON DELETE cascade,
- FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-INSERT INTO `__new_workspace_member`("id", "workspace_id", "user_id", "role", "joined_at") SELECT "id", "workspace_id", "user_id", "role", "joined_at" FROM `workspace_member`;--> statement-breakpoint
-DROP TABLE `workspace_member`;--> statement-breakpoint
-ALTER TABLE `__new_workspace_member` RENAME TO `workspace_member`;--> statement-breakpoint
-CREATE TABLE `__new_user` (
- `id` text PRIMARY KEY NOT NULL,
- `name` text NOT NULL,
- `password` text NOT NULL,
- `email` text NOT NULL,
- `created_at` integer DEFAULT '"2025-01-05T21:52:34.989Z"' NOT NULL
-);
---> statement-breakpoint
-INSERT INTO `__new_user`("id", "name", "password", "email", "created_at") SELECT "id", "name", "password", "email", "created_at" FROM `user`;--> statement-breakpoint
-DROP TABLE `user`;--> statement-breakpoint
-ALTER TABLE `__new_user` RENAME TO `user`;--> statement-breakpoint
-CREATE UNIQUE INDEX `user_email_unique` ON `user` (`email`);--> statement-breakpoint
-CREATE TABLE `__new_workspace` (
- `id` text PRIMARY KEY NOT NULL,
- `name` text NOT NULL,
- `description` text,
- `owner_id` text NOT NULL,
- `created_at` integer DEFAULT '"2025-01-05T21:52:34.989Z"' NOT NULL,
- FOREIGN KEY (`owner_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-INSERT INTO `__new_workspace`("id", "name", "description", "owner_id", "created_at") SELECT "id", "name", "description", "owner_id", "created_at" FROM `workspace`;--> statement-breakpoint
-DROP TABLE `workspace`;--> statement-breakpoint
-ALTER TABLE `__new_workspace` RENAME TO `workspace`;
\ No newline at end of file
diff --git a/apps/api/drizzle/0007_reflective_microchip.sql b/apps/api/drizzle/0007_reflective_microchip.sql
deleted file mode 100644
index 7327e0d8a..000000000
--- a/apps/api/drizzle/0007_reflective_microchip.sql
+++ /dev/null
@@ -1,67 +0,0 @@
-PRAGMA foreign_keys=OFF;--> statement-breakpoint
-CREATE TABLE `__new_board` (
- `id` text PRIMARY KEY NOT NULL,
- `workspace_id` text NOT NULL,
- `name` text NOT NULL,
- `description` text,
- `created_at` integer DEFAULT '"2025-01-05T21:53:53.178Z"' NOT NULL,
- FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-INSERT INTO `__new_board`("id", "workspace_id", "name", "description", "created_at") SELECT "id", "workspace_id", "name", "description", "created_at" FROM `board`;--> statement-breakpoint
-DROP TABLE `board`;--> statement-breakpoint
-ALTER TABLE `__new_board` RENAME TO `board`;--> statement-breakpoint
-PRAGMA foreign_keys=ON;--> statement-breakpoint
-CREATE TABLE `__new_task` (
- `id` text PRIMARY KEY NOT NULL,
- `board_id` text NOT NULL,
- `assignee_id` text NOT NULL,
- `title` text NOT NULL,
- `description` text,
- `status` text DEFAULT 'to-do' NOT NULL,
- `due_date` integer,
- `created_at` integer DEFAULT '"2025-01-05T21:53:53.178Z"' NOT NULL,
- FOREIGN KEY (`board_id`) REFERENCES `board`(`id`) ON UPDATE no action ON DELETE cascade,
- FOREIGN KEY (`assignee_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-INSERT INTO `__new_task`("id", "board_id", "assignee_id", "title", "description", "status", "due_date", "created_at") SELECT "id", "board_id", "assignee_id", "title", "description", "status", "due_date", "created_at" FROM `task`;--> statement-breakpoint
-DROP TABLE `task`;--> statement-breakpoint
-ALTER TABLE `__new_task` RENAME TO `task`;--> statement-breakpoint
-CREATE TABLE `__new_user` (
- `id` text PRIMARY KEY NOT NULL,
- `name` text NOT NULL,
- `password` text NOT NULL,
- `email` text NOT NULL,
- `created_at` integer DEFAULT '"2025-01-05T21:53:53.177Z"' NOT NULL
-);
---> statement-breakpoint
-INSERT INTO `__new_user`("id", "name", "password", "email", "created_at") SELECT "id", "name", "password", "email", "created_at" FROM `user`;--> statement-breakpoint
-DROP TABLE `user`;--> statement-breakpoint
-ALTER TABLE `__new_user` RENAME TO `user`;--> statement-breakpoint
-CREATE UNIQUE INDEX `user_email_unique` ON `user` (`email`);--> statement-breakpoint
-CREATE TABLE `__new_workspace` (
- `id` text PRIMARY KEY NOT NULL,
- `name` text NOT NULL,
- `description` text,
- `owner_id` text NOT NULL,
- `created_at` integer DEFAULT '"2025-01-05T21:53:53.178Z"' NOT NULL,
- FOREIGN KEY (`owner_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-INSERT INTO `__new_workspace`("id", "name", "description", "owner_id", "created_at") SELECT "id", "name", "description", "owner_id", "created_at" FROM `workspace`;--> statement-breakpoint
-DROP TABLE `workspace`;--> statement-breakpoint
-ALTER TABLE `__new_workspace` RENAME TO `workspace`;--> statement-breakpoint
-CREATE TABLE `__new_workspace_member` (
- `id` text PRIMARY KEY NOT NULL,
- `workspace_id` text NOT NULL,
- `user_id` text NOT NULL,
- `role` text,
- `joined_at` integer DEFAULT '"2025-01-05T21:53:53.178Z"' NOT NULL,
- FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE no action ON DELETE cascade,
- FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-INSERT INTO `__new_workspace_member`("id", "workspace_id", "user_id", "role", "joined_at") SELECT "id", "workspace_id", "user_id", "role", "joined_at" FROM `workspace_member`;--> statement-breakpoint
-DROP TABLE `workspace_member`;--> statement-breakpoint
-ALTER TABLE `__new_workspace_member` RENAME TO `workspace_member`;
\ No newline at end of file
diff --git a/apps/api/drizzle/0008_black_electro.sql b/apps/api/drizzle/0008_black_electro.sql
deleted file mode 100644
index 5c1d0a53d..000000000
--- a/apps/api/drizzle/0008_black_electro.sql
+++ /dev/null
@@ -1,77 +0,0 @@
-PRAGMA foreign_keys=OFF;--> statement-breakpoint
-CREATE TABLE `__new_board` (
- `id` text PRIMARY KEY NOT NULL,
- `workspace_id` text NOT NULL,
- `name` text NOT NULL,
- `description` text,
- `created_at` integer DEFAULT '"2025-01-05T22:09:42.868Z"' NOT NULL,
- FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE cascade ON DELETE cascade
-);
---> statement-breakpoint
-INSERT INTO `__new_board`("id", "workspace_id", "name", "description", "created_at") SELECT "id", "workspace_id", "name", "description", "created_at" FROM `board`;--> statement-breakpoint
-DROP TABLE `board`;--> statement-breakpoint
-ALTER TABLE `__new_board` RENAME TO `board`;--> statement-breakpoint
-PRAGMA foreign_keys=ON;--> statement-breakpoint
-CREATE TABLE `__new_session` (
- `id` text PRIMARY KEY NOT NULL,
- `user_id` text NOT NULL,
- `expires_at` integer NOT NULL,
- FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE cascade ON DELETE cascade
-);
---> statement-breakpoint
-INSERT INTO `__new_session`("id", "user_id", "expires_at") SELECT "id", "user_id", "expires_at" FROM `session`;--> statement-breakpoint
-DROP TABLE `session`;--> statement-breakpoint
-ALTER TABLE `__new_session` RENAME TO `session`;--> statement-breakpoint
-CREATE TABLE `__new_task` (
- `id` text PRIMARY KEY NOT NULL,
- `board_id` text NOT NULL,
- `assignee_id` text NOT NULL,
- `title` text NOT NULL,
- `description` text,
- `status` text DEFAULT 'to-do' NOT NULL,
- `due_date` integer,
- `created_at` integer DEFAULT '"2025-01-05T22:09:42.868Z"' NOT NULL,
- FOREIGN KEY (`board_id`) REFERENCES `board`(`id`) ON UPDATE cascade ON DELETE cascade,
- FOREIGN KEY (`assignee_id`) REFERENCES `user`(`id`) ON UPDATE cascade ON DELETE cascade
-);
---> statement-breakpoint
-INSERT INTO `__new_task`("id", "board_id", "assignee_id", "title", "description", "status", "due_date", "created_at") SELECT "id", "board_id", "assignee_id", "title", "description", "status", "due_date", "created_at" FROM `task`;--> statement-breakpoint
-DROP TABLE `task`;--> statement-breakpoint
-ALTER TABLE `__new_task` RENAME TO `task`;--> statement-breakpoint
-CREATE TABLE `__new_workspace` (
- `id` text PRIMARY KEY NOT NULL,
- `name` text NOT NULL,
- `description` text,
- `owner_id` text NOT NULL,
- `created_at` integer DEFAULT '"2025-01-05T22:09:42.867Z"' NOT NULL,
- FOREIGN KEY (`owner_id`) REFERENCES `user`(`id`) ON UPDATE cascade ON DELETE cascade
-);
---> statement-breakpoint
-INSERT INTO `__new_workspace`("id", "name", "description", "owner_id", "created_at") SELECT "id", "name", "description", "owner_id", "created_at" FROM `workspace`;--> statement-breakpoint
-DROP TABLE `workspace`;--> statement-breakpoint
-ALTER TABLE `__new_workspace` RENAME TO `workspace`;--> statement-breakpoint
-CREATE TABLE `__new_workspace_member` (
- `id` text PRIMARY KEY NOT NULL,
- `workspace_id` text NOT NULL,
- `user_id` text NOT NULL,
- `role` text,
- `joined_at` integer DEFAULT '"2025-01-05T22:09:42.867Z"' NOT NULL,
- FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE cascade ON DELETE cascade,
- FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE cascade ON DELETE cascade
-);
---> statement-breakpoint
-INSERT INTO `__new_workspace_member`("id", "workspace_id", "user_id", "role", "joined_at") SELECT "id", "workspace_id", "user_id", "role", "joined_at" FROM `workspace_member`;--> statement-breakpoint
-DROP TABLE `workspace_member`;--> statement-breakpoint
-ALTER TABLE `__new_workspace_member` RENAME TO `workspace_member`;--> statement-breakpoint
-CREATE TABLE `__new_user` (
- `id` text PRIMARY KEY NOT NULL,
- `name` text NOT NULL,
- `password` text NOT NULL,
- `email` text NOT NULL,
- `created_at` integer DEFAULT '"2025-01-05T22:09:42.867Z"' NOT NULL
-);
---> statement-breakpoint
-INSERT INTO `__new_user`("id", "name", "password", "email", "created_at") SELECT "id", "name", "password", "email", "created_at" FROM `user`;--> statement-breakpoint
-DROP TABLE `user`;--> statement-breakpoint
-ALTER TABLE `__new_user` RENAME TO `user`;--> statement-breakpoint
-CREATE UNIQUE INDEX `user_email_unique` ON `user` (`email`);
\ No newline at end of file
diff --git a/apps/api/drizzle/meta/0000_snapshot.json b/apps/api/drizzle/meta/0000_snapshot.json
index d49e7dc71..d06e6e545 100644
--- a/apps/api/drizzle/meta/0000_snapshot.json
+++ b/apps/api/drizzle/meta/0000_snapshot.json
@@ -1,9 +1,193 @@
{
"version": "6",
"dialect": "sqlite",
- "id": "5647ebd6-d065-463c-89be-de3b3e73393d",
+ "id": "c0af92e1-37ce-46b9-bd70-337eb6049763",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
+ "project": {
+ "name": "project",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'\"2025-01-18T14:59:51.091Z\"'"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "project_workspace_id_workspace_id_fk": {
+ "name": "project_workspace_id_workspace_id_fk",
+ "tableFrom": "project",
+ "tableTo": "workspace",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "session": {
+ "name": "session",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_user_id_user_id_fk": {
+ "name": "session_user_id_user_id_fk",
+ "tableFrom": "session",
+ "tableTo": "user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "task": {
+ "name": "task",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "assignee_id": {
+ "name": "assignee_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'to-do'"
+ },
+ "due_date": {
+ "name": "due_date",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'\"2025-01-18T14:59:51.091Z\"'"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "task_project_id_project_id_fk": {
+ "name": "task_project_id_project_id_fk",
+ "tableFrom": "task",
+ "tableTo": "project",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "task_assignee_id_user_id_fk": {
+ "name": "task_assignee_id_user_id_fk",
+ "tableFrom": "task",
+ "tableTo": "user",
+ "columnsFrom": ["assignee_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
"user": {
"name": "user",
"columns": {
@@ -41,23 +225,10 @@
"primaryKey": false,
"notNull": true,
"autoincrement": false,
- "default": "'\"2025-01-01T22:11:31.903Z\"'"
- },
- "refresh_token_version": {
- "name": "refresh_token_version",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
+ "default": "'\"2025-01-18T14:59:51.090Z\"'"
}
},
"indexes": {
- "user_name_unique": {
- "name": "user_name_unique",
- "columns": ["name"],
- "isUnique": true
- },
"user_email_unique": {
"name": "user_email_unique",
"columns": ["email"],
@@ -68,6 +239,127 @@
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
+ },
+ "workspace": {
+ "name": "workspace",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "owner_id": {
+ "name": "owner_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'\"2025-01-18T14:59:51.091Z\"'"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "workspace_owner_id_user_id_fk": {
+ "name": "workspace_owner_id_user_id_fk",
+ "tableFrom": "workspace",
+ "tableTo": "user",
+ "columnsFrom": ["owner_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "workspace_member": {
+ "name": "workspace_member",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'\"2025-01-18T14:59:51.091Z\"'"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "workspace_member_workspace_id_workspace_id_fk": {
+ "name": "workspace_member_workspace_id_workspace_id_fk",
+ "tableFrom": "workspace_member",
+ "tableTo": "workspace",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "workspace_member_user_id_user_id_fk": {
+ "name": "workspace_member_user_id_user_id_fk",
+ "tableFrom": "workspace_member",
+ "tableTo": "user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
}
},
"views": {},
diff --git a/apps/api/drizzle/meta/0001_snapshot.json b/apps/api/drizzle/meta/0001_snapshot.json
deleted file mode 100644
index dccb1e934..000000000
--- a/apps/api/drizzle/meta/0001_snapshot.json
+++ /dev/null
@@ -1,70 +0,0 @@
-{
- "version": "6",
- "dialect": "sqlite",
- "id": "e1a9d8d8-e2dd-4fa3-864a-b396b6f6034e",
- "prevId": "5647ebd6-d065-463c-89be-de3b3e73393d",
- "tables": {
- "user": {
- "name": "user",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "password": {
- "name": "password",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-04T13:09:57.494Z\"'"
- }
- },
- "indexes": {
- "user_email_unique": {
- "name": "user_email_unique",
- "columns": ["email"],
- "isUnique": true
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- }
- },
- "views": {},
- "enums": {},
- "_meta": {
- "schemas": {},
- "tables": {},
- "columns": {}
- },
- "internal": {
- "indexes": {}
- }
-}
diff --git a/apps/api/drizzle/meta/0002_snapshot.json b/apps/api/drizzle/meta/0002_snapshot.json
deleted file mode 100644
index 74016a49b..000000000
--- a/apps/api/drizzle/meta/0002_snapshot.json
+++ /dev/null
@@ -1,111 +0,0 @@
-{
- "version": "6",
- "dialect": "sqlite",
- "id": "1c74d9e8-3e5e-4199-9175-7514767a6912",
- "prevId": "e1a9d8d8-e2dd-4fa3-864a-b396b6f6034e",
- "tables": {
- "session": {
- "name": "session",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "session_user_id_user_id_fk": {
- "name": "session_user_id_user_id_fk",
- "tableFrom": "session",
- "tableTo": "user",
- "columnsFrom": ["user_id"],
- "columnsTo": ["id"],
- "onDelete": "no action",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "user": {
- "name": "user",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "password": {
- "name": "password",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-04T22:24:29.828Z\"'"
- }
- },
- "indexes": {
- "user_email_unique": {
- "name": "user_email_unique",
- "columns": ["email"],
- "isUnique": true
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- }
- },
- "views": {},
- "enums": {},
- "_meta": {
- "schemas": {},
- "tables": {},
- "columns": {}
- },
- "internal": {
- "indexes": {}
- }
-}
diff --git a/apps/api/drizzle/meta/0003_snapshot.json b/apps/api/drizzle/meta/0003_snapshot.json
deleted file mode 100644
index 94b49c0ae..000000000
--- a/apps/api/drizzle/meta/0003_snapshot.json
+++ /dev/null
@@ -1,375 +0,0 @@
-{
- "version": "6",
- "dialect": "sqlite",
- "id": "64109be0-fa20-41a8-aefd-3c6bc53e94d3",
- "prevId": "1c74d9e8-3e5e-4199-9175-7514767a6912",
- "tables": {
- "board": {
- "name": "board",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:49:54.348Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "board_workspace_id_workspace_id_fk": {
- "name": "board_workspace_id_workspace_id_fk",
- "tableFrom": "board",
- "tableTo": "workspace",
- "columnsFrom": ["workspace_id"],
- "columnsTo": ["id"],
- "onDelete": "no action",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "session": {
- "name": "session",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "session_user_id_user_id_fk": {
- "name": "session_user_id_user_id_fk",
- "tableFrom": "session",
- "tableTo": "user",
- "columnsFrom": ["user_id"],
- "columnsTo": ["id"],
- "onDelete": "no action",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "task": {
- "name": "task",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "board_id": {
- "name": "board_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "assignee_id": {
- "name": "assignee_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "title": {
- "name": "title",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'to-do'"
- },
- "due_date": {
- "name": "due_date",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:49:54.348Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "task_board_id_board_id_fk": {
- "name": "task_board_id_board_id_fk",
- "tableFrom": "task",
- "tableTo": "board",
- "columnsFrom": ["board_id"],
- "columnsTo": ["id"],
- "onDelete": "no action",
- "onUpdate": "no action"
- },
- "task_assignee_id_user_id_fk": {
- "name": "task_assignee_id_user_id_fk",
- "tableFrom": "task",
- "tableTo": "user",
- "columnsFrom": ["assignee_id"],
- "columnsTo": ["id"],
- "onDelete": "no action",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "user": {
- "name": "user",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "password": {
- "name": "password",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:49:54.347Z\"'"
- }
- },
- "indexes": {
- "user_email_unique": {
- "name": "user_email_unique",
- "columns": ["email"],
- "isUnique": true
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "workspace": {
- "name": "workspace",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "owner_id": {
- "name": "owner_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:49:54.347Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "workspace_owner_id_user_id_fk": {
- "name": "workspace_owner_id_user_id_fk",
- "tableFrom": "workspace",
- "tableTo": "user",
- "columnsFrom": ["owner_id"],
- "columnsTo": ["id"],
- "onDelete": "no action",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "workspace_member": {
- "name": "workspace_member",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "joined_at": {
- "name": "joined_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:49:54.347Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "workspace_member_workspace_id_workspace_id_fk": {
- "name": "workspace_member_workspace_id_workspace_id_fk",
- "tableFrom": "workspace_member",
- "tableTo": "workspace",
- "columnsFrom": ["workspace_id"],
- "columnsTo": ["id"],
- "onDelete": "no action",
- "onUpdate": "no action"
- },
- "workspace_member_user_id_user_id_fk": {
- "name": "workspace_member_user_id_user_id_fk",
- "tableFrom": "workspace_member",
- "tableTo": "user",
- "columnsFrom": ["user_id"],
- "columnsTo": ["id"],
- "onDelete": "no action",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- }
- },
- "views": {},
- "enums": {},
- "_meta": {
- "schemas": {},
- "tables": {},
- "columns": {}
- },
- "internal": {
- "indexes": {}
- }
-}
diff --git a/apps/api/drizzle/meta/0004_snapshot.json b/apps/api/drizzle/meta/0004_snapshot.json
deleted file mode 100644
index 6ecaf8b83..000000000
--- a/apps/api/drizzle/meta/0004_snapshot.json
+++ /dev/null
@@ -1,375 +0,0 @@
-{
- "version": "6",
- "dialect": "sqlite",
- "id": "66df98fd-0af4-4151-9aad-14edaa811ba3",
- "prevId": "64109be0-fa20-41a8-aefd-3c6bc53e94d3",
- "tables": {
- "board": {
- "name": "board",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:51:16.320Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "board_workspace_id_workspace_id_fk": {
- "name": "board_workspace_id_workspace_id_fk",
- "tableFrom": "board",
- "tableTo": "workspace",
- "columnsFrom": ["workspace_id"],
- "columnsTo": ["id"],
- "onDelete": "no action",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "session": {
- "name": "session",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "session_user_id_user_id_fk": {
- "name": "session_user_id_user_id_fk",
- "tableFrom": "session",
- "tableTo": "user",
- "columnsFrom": ["user_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "task": {
- "name": "task",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "board_id": {
- "name": "board_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "assignee_id": {
- "name": "assignee_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "title": {
- "name": "title",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'to-do'"
- },
- "due_date": {
- "name": "due_date",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:51:16.320Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "task_board_id_board_id_fk": {
- "name": "task_board_id_board_id_fk",
- "tableFrom": "task",
- "tableTo": "board",
- "columnsFrom": ["board_id"],
- "columnsTo": ["id"],
- "onDelete": "no action",
- "onUpdate": "no action"
- },
- "task_assignee_id_user_id_fk": {
- "name": "task_assignee_id_user_id_fk",
- "tableFrom": "task",
- "tableTo": "user",
- "columnsFrom": ["assignee_id"],
- "columnsTo": ["id"],
- "onDelete": "no action",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "user": {
- "name": "user",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "password": {
- "name": "password",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:51:16.320Z\"'"
- }
- },
- "indexes": {
- "user_email_unique": {
- "name": "user_email_unique",
- "columns": ["email"],
- "isUnique": true
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "workspace": {
- "name": "workspace",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "owner_id": {
- "name": "owner_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:51:16.320Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "workspace_owner_id_user_id_fk": {
- "name": "workspace_owner_id_user_id_fk",
- "tableFrom": "workspace",
- "tableTo": "user",
- "columnsFrom": ["owner_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "workspace_member": {
- "name": "workspace_member",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "joined_at": {
- "name": "joined_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:51:16.320Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "workspace_member_workspace_id_workspace_id_fk": {
- "name": "workspace_member_workspace_id_workspace_id_fk",
- "tableFrom": "workspace_member",
- "tableTo": "workspace",
- "columnsFrom": ["workspace_id"],
- "columnsTo": ["id"],
- "onDelete": "no action",
- "onUpdate": "no action"
- },
- "workspace_member_user_id_user_id_fk": {
- "name": "workspace_member_user_id_user_id_fk",
- "tableFrom": "workspace_member",
- "tableTo": "user",
- "columnsFrom": ["user_id"],
- "columnsTo": ["id"],
- "onDelete": "no action",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- }
- },
- "views": {},
- "enums": {},
- "_meta": {
- "schemas": {},
- "tables": {},
- "columns": {}
- },
- "internal": {
- "indexes": {}
- }
-}
diff --git a/apps/api/drizzle/meta/0005_snapshot.json b/apps/api/drizzle/meta/0005_snapshot.json
deleted file mode 100644
index 62bf9febf..000000000
--- a/apps/api/drizzle/meta/0005_snapshot.json
+++ /dev/null
@@ -1,375 +0,0 @@
-{
- "version": "6",
- "dialect": "sqlite",
- "id": "79900e77-5a5a-4d24-beff-2d0b50ea3e94",
- "prevId": "66df98fd-0af4-4151-9aad-14edaa811ba3",
- "tables": {
- "board": {
- "name": "board",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:51:38.968Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "board_workspace_id_workspace_id_fk": {
- "name": "board_workspace_id_workspace_id_fk",
- "tableFrom": "board",
- "tableTo": "workspace",
- "columnsFrom": ["workspace_id"],
- "columnsTo": ["id"],
- "onDelete": "no action",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "session": {
- "name": "session",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "session_user_id_user_id_fk": {
- "name": "session_user_id_user_id_fk",
- "tableFrom": "session",
- "tableTo": "user",
- "columnsFrom": ["user_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "task": {
- "name": "task",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "board_id": {
- "name": "board_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "assignee_id": {
- "name": "assignee_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "title": {
- "name": "title",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'to-do'"
- },
- "due_date": {
- "name": "due_date",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:51:38.968Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "task_board_id_board_id_fk": {
- "name": "task_board_id_board_id_fk",
- "tableFrom": "task",
- "tableTo": "board",
- "columnsFrom": ["board_id"],
- "columnsTo": ["id"],
- "onDelete": "no action",
- "onUpdate": "no action"
- },
- "task_assignee_id_user_id_fk": {
- "name": "task_assignee_id_user_id_fk",
- "tableFrom": "task",
- "tableTo": "user",
- "columnsFrom": ["assignee_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "user": {
- "name": "user",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "password": {
- "name": "password",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:51:38.967Z\"'"
- }
- },
- "indexes": {
- "user_email_unique": {
- "name": "user_email_unique",
- "columns": ["email"],
- "isUnique": true
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "workspace": {
- "name": "workspace",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "owner_id": {
- "name": "owner_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:51:38.967Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "workspace_owner_id_user_id_fk": {
- "name": "workspace_owner_id_user_id_fk",
- "tableFrom": "workspace",
- "tableTo": "user",
- "columnsFrom": ["owner_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "workspace_member": {
- "name": "workspace_member",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "joined_at": {
- "name": "joined_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:51:38.967Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "workspace_member_workspace_id_workspace_id_fk": {
- "name": "workspace_member_workspace_id_workspace_id_fk",
- "tableFrom": "workspace_member",
- "tableTo": "workspace",
- "columnsFrom": ["workspace_id"],
- "columnsTo": ["id"],
- "onDelete": "no action",
- "onUpdate": "no action"
- },
- "workspace_member_user_id_user_id_fk": {
- "name": "workspace_member_user_id_user_id_fk",
- "tableFrom": "workspace_member",
- "tableTo": "user",
- "columnsFrom": ["user_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- }
- },
- "views": {},
- "enums": {},
- "_meta": {
- "schemas": {},
- "tables": {},
- "columns": {}
- },
- "internal": {
- "indexes": {}
- }
-}
diff --git a/apps/api/drizzle/meta/0006_snapshot.json b/apps/api/drizzle/meta/0006_snapshot.json
deleted file mode 100644
index 693441fbc..000000000
--- a/apps/api/drizzle/meta/0006_snapshot.json
+++ /dev/null
@@ -1,375 +0,0 @@
-{
- "version": "6",
- "dialect": "sqlite",
- "id": "df646c60-7bb0-4626-a061-a835a20af5d6",
- "prevId": "79900e77-5a5a-4d24-beff-2d0b50ea3e94",
- "tables": {
- "board": {
- "name": "board",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:52:34.989Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "board_workspace_id_workspace_id_fk": {
- "name": "board_workspace_id_workspace_id_fk",
- "tableFrom": "board",
- "tableTo": "workspace",
- "columnsFrom": ["workspace_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "session": {
- "name": "session",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "session_user_id_user_id_fk": {
- "name": "session_user_id_user_id_fk",
- "tableFrom": "session",
- "tableTo": "user",
- "columnsFrom": ["user_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "task": {
- "name": "task",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "board_id": {
- "name": "board_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "assignee_id": {
- "name": "assignee_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "title": {
- "name": "title",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'to-do'"
- },
- "due_date": {
- "name": "due_date",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:52:34.989Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "task_board_id_board_id_fk": {
- "name": "task_board_id_board_id_fk",
- "tableFrom": "task",
- "tableTo": "board",
- "columnsFrom": ["board_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "task_assignee_id_user_id_fk": {
- "name": "task_assignee_id_user_id_fk",
- "tableFrom": "task",
- "tableTo": "user",
- "columnsFrom": ["assignee_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "user": {
- "name": "user",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "password": {
- "name": "password",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:52:34.989Z\"'"
- }
- },
- "indexes": {
- "user_email_unique": {
- "name": "user_email_unique",
- "columns": ["email"],
- "isUnique": true
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "workspace": {
- "name": "workspace",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "owner_id": {
- "name": "owner_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:52:34.989Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "workspace_owner_id_user_id_fk": {
- "name": "workspace_owner_id_user_id_fk",
- "tableFrom": "workspace",
- "tableTo": "user",
- "columnsFrom": ["owner_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "workspace_member": {
- "name": "workspace_member",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "joined_at": {
- "name": "joined_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:52:34.989Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "workspace_member_workspace_id_workspace_id_fk": {
- "name": "workspace_member_workspace_id_workspace_id_fk",
- "tableFrom": "workspace_member",
- "tableTo": "workspace",
- "columnsFrom": ["workspace_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "workspace_member_user_id_user_id_fk": {
- "name": "workspace_member_user_id_user_id_fk",
- "tableFrom": "workspace_member",
- "tableTo": "user",
- "columnsFrom": ["user_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- }
- },
- "views": {},
- "enums": {},
- "_meta": {
- "schemas": {},
- "tables": {},
- "columns": {}
- },
- "internal": {
- "indexes": {}
- }
-}
diff --git a/apps/api/drizzle/meta/0007_snapshot.json b/apps/api/drizzle/meta/0007_snapshot.json
deleted file mode 100644
index bbb616087..000000000
--- a/apps/api/drizzle/meta/0007_snapshot.json
+++ /dev/null
@@ -1,375 +0,0 @@
-{
- "version": "6",
- "dialect": "sqlite",
- "id": "c0ba8524-5b32-4413-b5bf-7a1ab6e20252",
- "prevId": "df646c60-7bb0-4626-a061-a835a20af5d6",
- "tables": {
- "board": {
- "name": "board",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:53:53.178Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "board_workspace_id_workspace_id_fk": {
- "name": "board_workspace_id_workspace_id_fk",
- "tableFrom": "board",
- "tableTo": "workspace",
- "columnsFrom": ["workspace_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "session": {
- "name": "session",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "session_user_id_user_id_fk": {
- "name": "session_user_id_user_id_fk",
- "tableFrom": "session",
- "tableTo": "user",
- "columnsFrom": ["user_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "task": {
- "name": "task",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "board_id": {
- "name": "board_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "assignee_id": {
- "name": "assignee_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "title": {
- "name": "title",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'to-do'"
- },
- "due_date": {
- "name": "due_date",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:53:53.178Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "task_board_id_board_id_fk": {
- "name": "task_board_id_board_id_fk",
- "tableFrom": "task",
- "tableTo": "board",
- "columnsFrom": ["board_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "task_assignee_id_user_id_fk": {
- "name": "task_assignee_id_user_id_fk",
- "tableFrom": "task",
- "tableTo": "user",
- "columnsFrom": ["assignee_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "user": {
- "name": "user",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "password": {
- "name": "password",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:53:53.177Z\"'"
- }
- },
- "indexes": {
- "user_email_unique": {
- "name": "user_email_unique",
- "columns": ["email"],
- "isUnique": true
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "workspace": {
- "name": "workspace",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "owner_id": {
- "name": "owner_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:53:53.178Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "workspace_owner_id_user_id_fk": {
- "name": "workspace_owner_id_user_id_fk",
- "tableFrom": "workspace",
- "tableTo": "user",
- "columnsFrom": ["owner_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "workspace_member": {
- "name": "workspace_member",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "joined_at": {
- "name": "joined_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T21:53:53.178Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "workspace_member_workspace_id_workspace_id_fk": {
- "name": "workspace_member_workspace_id_workspace_id_fk",
- "tableFrom": "workspace_member",
- "tableTo": "workspace",
- "columnsFrom": ["workspace_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "workspace_member_user_id_user_id_fk": {
- "name": "workspace_member_user_id_user_id_fk",
- "tableFrom": "workspace_member",
- "tableTo": "user",
- "columnsFrom": ["user_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- }
- },
- "views": {},
- "enums": {},
- "_meta": {
- "schemas": {},
- "tables": {},
- "columns": {}
- },
- "internal": {
- "indexes": {}
- }
-}
diff --git a/apps/api/drizzle/meta/0008_snapshot.json b/apps/api/drizzle/meta/0008_snapshot.json
deleted file mode 100644
index 647787fc5..000000000
--- a/apps/api/drizzle/meta/0008_snapshot.json
+++ /dev/null
@@ -1,375 +0,0 @@
-{
- "version": "6",
- "dialect": "sqlite",
- "id": "cc45f253-5810-4589-8c71-d68c71e4074b",
- "prevId": "c0ba8524-5b32-4413-b5bf-7a1ab6e20252",
- "tables": {
- "board": {
- "name": "board",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T22:09:42.868Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "board_workspace_id_workspace_id_fk": {
- "name": "board_workspace_id_workspace_id_fk",
- "tableFrom": "board",
- "tableTo": "workspace",
- "columnsFrom": ["workspace_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "session": {
- "name": "session",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "session_user_id_user_id_fk": {
- "name": "session_user_id_user_id_fk",
- "tableFrom": "session",
- "tableTo": "user",
- "columnsFrom": ["user_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "task": {
- "name": "task",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "board_id": {
- "name": "board_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "assignee_id": {
- "name": "assignee_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "title": {
- "name": "title",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'to-do'"
- },
- "due_date": {
- "name": "due_date",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T22:09:42.868Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "task_board_id_board_id_fk": {
- "name": "task_board_id_board_id_fk",
- "tableFrom": "task",
- "tableTo": "board",
- "columnsFrom": ["board_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "task_assignee_id_user_id_fk": {
- "name": "task_assignee_id_user_id_fk",
- "tableFrom": "task",
- "tableTo": "user",
- "columnsFrom": ["assignee_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "user": {
- "name": "user",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "password": {
- "name": "password",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T22:09:42.867Z\"'"
- }
- },
- "indexes": {
- "user_email_unique": {
- "name": "user_email_unique",
- "columns": ["email"],
- "isUnique": true
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "workspace": {
- "name": "workspace",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "owner_id": {
- "name": "owner_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T22:09:42.867Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "workspace_owner_id_user_id_fk": {
- "name": "workspace_owner_id_user_id_fk",
- "tableFrom": "workspace",
- "tableTo": "user",
- "columnsFrom": ["owner_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "workspace_member": {
- "name": "workspace_member",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "joined_at": {
- "name": "joined_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'\"2025-01-05T22:09:42.867Z\"'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "workspace_member_workspace_id_workspace_id_fk": {
- "name": "workspace_member_workspace_id_workspace_id_fk",
- "tableFrom": "workspace_member",
- "tableTo": "workspace",
- "columnsFrom": ["workspace_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "workspace_member_user_id_user_id_fk": {
- "name": "workspace_member_user_id_user_id_fk",
- "tableFrom": "workspace_member",
- "tableTo": "user",
- "columnsFrom": ["user_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- }
- },
- "views": {},
- "enums": {},
- "_meta": {
- "schemas": {},
- "tables": {},
- "columns": {}
- },
- "internal": {
- "indexes": {}
- }
-}
diff --git a/apps/api/drizzle/meta/_journal.json b/apps/api/drizzle/meta/_journal.json
index 44448ae72..4eb41726f 100644
--- a/apps/api/drizzle/meta/_journal.json
+++ b/apps/api/drizzle/meta/_journal.json
@@ -5,64 +5,8 @@
{
"idx": 0,
"version": "6",
- "when": 1735769491908,
- "tag": "0000_shocking_screwball",
- "breakpoints": true
- },
- {
- "idx": 1,
- "version": "6",
- "when": 1735996197501,
- "tag": "0001_melted_whizzer",
- "breakpoints": true
- },
- {
- "idx": 2,
- "version": "6",
- "when": 1736029469835,
- "tag": "0002_flowery_secret_warriors",
- "breakpoints": true
- },
- {
- "idx": 3,
- "version": "6",
- "when": 1736113794356,
- "tag": "0003_mature_madripoor",
- "breakpoints": true
- },
- {
- "idx": 4,
- "version": "6",
- "when": 1736113876330,
- "tag": "0004_quiet_vector",
- "breakpoints": true
- },
- {
- "idx": 5,
- "version": "6",
- "when": 1736113898977,
- "tag": "0005_lyrical_marvex",
- "breakpoints": true
- },
- {
- "idx": 6,
- "version": "6",
- "when": 1736113955000,
- "tag": "0006_windy_sabra",
- "breakpoints": true
- },
- {
- "idx": 7,
- "version": "6",
- "when": 1736114033188,
- "tag": "0007_reflective_microchip",
- "breakpoints": true
- },
- {
- "idx": 8,
- "version": "6",
- "when": 1736114982878,
- "tag": "0008_black_electro",
+ "when": 1737212391097,
+ "tag": "0000_abandoned_power_man",
"breakpoints": true
}
]
diff --git a/apps/api/src/database/schema.ts b/apps/api/src/database/schema.ts
index 8187578dc..4fe9dddd0 100644
--- a/apps/api/src/database/schema.ts
+++ b/apps/api/src/database/schema.ts
@@ -65,7 +65,7 @@ export const workspaceUserTable = sqliteTable("workspace_member", {
.notNull(),
});
-export const boardTable = sqliteTable("board", {
+export const projectTable = sqliteTable("project", {
id: text("id")
.$defaultFn(() => createId())
.primaryKey(),
@@ -86,9 +86,9 @@ export const taskTable = sqliteTable("task", {
id: text("id")
.$defaultFn(() => createId())
.primaryKey(),
- boardId: text("board_id")
+ projectId: text("project_id")
.notNull()
- .references(() => boardTable.id, {
+ .references(() => projectTable.id, {
onDelete: "cascade",
onUpdate: "cascade",
}),
diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts
index 2e0ef4dcf..162c067e8 100644
--- a/apps/api/src/index.ts
+++ b/apps/api/src/index.ts
@@ -1,5 +1,6 @@
import { cors } from "@elysiajs/cors";
import { Elysia } from "elysia";
+import project from "./project";
import user from "./user";
import { validateSessionToken } from "./user/controllers/validate-session-token";
import workspace from "./workspace";
@@ -35,6 +36,7 @@ const app = new Elysia()
return { user };
})
.use(workspace)
+ .use(project)
.onError(({ code, error }) => {
switch (code) {
case "VALIDATION":
diff --git a/apps/api/src/project/controllers/create-project.ts b/apps/api/src/project/controllers/create-project.ts
new file mode 100644
index 000000000..4730b7cfb
--- /dev/null
+++ b/apps/api/src/project/controllers/create-project.ts
@@ -0,0 +1,11 @@
+import db from "../../database";
+import { projectTable } from "../../database/schema";
+import type { CreateProjectPayload } from "../db/queries";
+
+function createProject(
+ body: Pick<CreateProjectPayload, "name" | "description" | "workspaceId">,
+) {
+ return db.insert(projectTable).values(body);
+}
+
+export default createProject;
diff --git a/apps/api/src/project/controllers/delete-project.ts b/apps/api/src/project/controllers/delete-project.ts
new file mode 100644
index 000000000..6711435ec
--- /dev/null
+++ b/apps/api/src/project/controllers/delete-project.ts
@@ -0,0 +1,33 @@
+import { and, eq } from "drizzle-orm";
+import db from "../../database";
+import { projectTable } from "../../database/schema";
+import type { DeleteProjectPayload } from "../db/queries";
+
+async function deleteProject({
+ id,
+ workspaceId,
+}: Pick<DeleteProjectPayload, "id" | "workspaceId">) {
+ const [existingProject] = await db
+ .select()
+ .from(projectTable)
+ .where(
+ and(eq(projectTable.id, id), eq(projectTable.workspaceId, workspaceId)),
+ );
+
+ const isProjectExisting = Boolean(existingProject);
+
+ if (!isProjectExisting) {
+ throw new Error("TODO");
+ }
+
+ const [deletedProject] = await db
+ .delete(projectTable)
+ .where(
+ and(eq(projectTable.id, id), eq(projectTable.workspaceId, workspaceId)),
+ )
+ .returning();
+
+ return deletedProject;
+}
+
+export default deleteProject;
diff --git a/apps/api/src/project/controllers/get-project.ts b/apps/api/src/project/controllers/get-project.ts
new file mode 100644
index 000000000..86be26368
--- /dev/null
+++ b/apps/api/src/project/controllers/get-project.ts
@@ -0,0 +1,27 @@
+import { and, eq } from "drizzle-orm";
+import db from "../../database";
+import { projectTable, workspaceTable } from "../../database/schema";
+import type { GetProjectPayload } from "../db/queries";
+
+async function getProject({
+ id,
+ workspaceId,
+}: Pick<GetProjectPayload, "id" | "workspaceId">) {
+ const [project] = await db
+ .select({
+ id: projectTable.id,
+ name: projectTable.name,
+ description: projectTable.description,
+ workspaceId: projectTable.workspaceId,
+ workspace: workspaceTable,
+ })
+ .from(projectTable)
+ .leftJoin(workspaceTable, eq(projectTable.workspaceId, workspaceTable.id))
+ .where(
+ and(eq(projectTable.id, id), eq(projectTable.workspaceId, workspaceId)),
+ );
+
+ return project;
+}
+
+export default getProject;
diff --git a/apps/api/src/project/controllers/get-projects.ts b/apps/api/src/project/controllers/get-projects.ts
new file mode 100644
index 000000000..9010798d5
--- /dev/null
+++ b/apps/api/src/project/controllers/get-projects.ts
@@ -0,0 +1,28 @@
+import { and, eq } from "drizzle-orm";
+import db from "../../database";
+import { projectTable, workspaceTable } from "../../database/schema";
+import type { GetProjectsPayload } from "../db/queries";
+
+async function getProjects({
+ workspaceId,
+}: Pick<GetProjectsPayload, "workspaceId">) {
+ const projects = await db
+ .select({
+ id: projectTable.id,
+ name: projectTable.name,
+ description: projectTable.description,
+ workspaceId: projectTable.workspaceId,
+ createdAt: projectTable.createdAt,
+ workspace: {
+ id: workspaceTable.id,
+ name: workspaceTable.name,
+ },
+ })
+ .from(projectTable)
+ .leftJoin(workspaceTable, eq(projectTable.workspaceId, workspaceTable.id))
+ .where(and(eq(projectTable.workspaceId, workspaceId)));
+
+ return projects;
+}
+
+export default getProjects;
diff --git a/apps/api/src/project/controllers/update-project.ts b/apps/api/src/project/controllers/update-project.ts
new file mode 100644
index 000000000..8ed7851e1
--- /dev/null
+++ b/apps/api/src/project/controllers/update-project.ts
@@ -0,0 +1,39 @@
+import { and, eq } from "drizzle-orm";
+import db from "../../database";
+import { projectTable } from "../../database/schema";
+import type { UpdateProjectPayload } from "../db/queries";
+
+async function updateProject({
+ id,
+ workspaceId,
+ name,
+ description,
+}: UpdateProjectPayload) {
+ const [existingProject] = await db
+ .select()
+ .from(projectTable)
+ .where(
+ and(eq(projectTable.id, id), eq(projectTable.workspaceId, workspaceId)),
+ );
+
+ const isProjectExisting = Boolean(existingProject);
+
+ if (!isProjectExisting) {
+ throw new Error("TODO");
+ }
+
+ const [updatedWorkspace] = await db
+ .update(projectTable)
+ .set({
+ name,
+ description,
+ })
+ .where(
+ and(eq(projectTable.id, id), eq(projectTable.workspaceId, workspaceId)),
+ )
+ .returning();
+
+ return updatedWorkspace;
+}
+
+export default updateProject;
diff --git a/apps/api/src/project/db/queries.ts b/apps/api/src/project/db/queries.ts
new file mode 100644
index 000000000..3dfae6b3d
--- /dev/null
+++ b/apps/api/src/project/db/queries.ts
@@ -0,0 +1,39 @@
+import {
+ createInsertSchema,
+ createSelectSchema,
+ createUpdateSchema,
+} from "drizzle-typebox";
+import { type Static, t } from "elysia";
+import { projectTable } from "../../database/schema";
+
+export const getProjectSchema = createSelectSchema(projectTable, {
+ workspaceId: t.String(),
+ id: t.String(),
+});
+
+export const getProjectsSchema = createSelectSchema(projectTable, {
+ workspaceId: t.String(),
+});
+
+export const createProjectSchema = createInsertSchema(projectTable, {
+ name: t.String(),
+ workspaceId: t.String(),
+ description: t.String(),
+});
+
+export const updateProjectSchema = createUpdateSchema(projectTable, {
+ id: t.String(),
+ name: t.String(),
+ description: t.String(),
+ workspaceId: t.String(),
+});
+
+export const deleteProjectSchema = createInsertSchema(projectTable, {
+ id: t.String(),
+});
+
+export type GetProjectPayload = Static<typeof getProjectSchema>;
+export type GetProjectsPayload = Static<typeof getProjectsSchema>;
+export type CreateProjectPayload = Static<typeof createProjectSchema>;
+export type UpdateProjectPayload = Static<typeof updateProjectSchema>;
+export type DeleteProjectPayload = Static<typeof deleteProjectSchema>;
diff --git a/apps/api/src/project/index.ts b/apps/api/src/project/index.ts
new file mode 100644
index 000000000..389a36a75
--- /dev/null
+++ b/apps/api/src/project/index.ts
@@ -0,0 +1,61 @@
+import Elysia, { t } from "elysia";
+import createProject from "./controllers/create-project";
+import deleteProject from "./controllers/delete-project";
+import getProject from "./controllers/get-project";
+import getProjects from "./controllers/get-projects";
+import updateProject from "./controllers/update-project";
+import { updateProjectSchema } from "./db/queries";
+
+const project = new Elysia({ prefix: "/project" })
+ .post(
+ "/create",
+ async ({ body }) => {
+ const createdProject = await createProject(body);
+
+ return createdProject;
+ },
+ {
+ body: t.Object({
+ name: t.String(),
+ workspaceId: t.String(),
+ description: t.String(),
+ }),
+ },
+ )
+ .get("/list/:workspaceId", async ({ params: { workspaceId } }) => {
+ const projects = await getProjects({ workspaceId });
+
+ return projects;
+ })
+ .get("/:id", async ({ params: { id }, query: { workspaceId } }) => {
+ if (!workspaceId) throw new Error("TODO");
+
+ const project = await getProject({ id, workspaceId });
+
+ return project;
+ })
+ .put(
+ "/:id",
+ async ({ params: { id }, body: { workspaceId, name, description } }) => {
+ const updatedProject = await updateProject({
+ id,
+ workspaceId,
+ name,
+ description,
+ });
+
+ return updatedProject;
+ },
+ {
+ body: updateProjectSchema,
+ },
+ )
+ .delete("/:id", async ({ params: { id }, query: { workspaceId } }) => {
+ if (!workspaceId) throw new Error("TODO");
+
+ const deletedProject = await deleteProject({ id, workspaceId });
+
+ return deletedProject;
+ });
+
+export default project;
diff --git a/apps/api/src/user/controllers/validate-session-token.ts b/apps/api/src/user/controllers/validate-session-token.ts
index 9e88750cb..1ad5d46f6 100644
--- a/apps/api/src/user/controllers/validate-session-token.ts
+++ b/apps/api/src/user/controllers/validate-session-token.ts
@@ -9,17 +9,17 @@ export async function validateSessionToken(
token: string,
): Promise<SessionValidationResult> {
const sessionId = encodeHexLowerCase(sha256(new TextEncoder().encode(token)));
- const result = await db
+ const sessions = await db
.select({ user: userTable, session: sessionTable })
.from(sessionTable)
.innerJoin(userTable, eq(sessionTable.userId, userTable.id))
.where(eq(sessionTable.id, sessionId));
- if (result.length < 1) {
+ if (sessions.length < 1) {
return { session: null, user: null };
}
- const { user, session } = result[0];
+ const { user, session } = sessions[0];
const isSessionExpired = Date.now() >= session.expiresAt.getTime();
diff --git a/apps/api/src/workspace/controllers/create-workspace.ts b/apps/api/src/workspace/controllers/create-workspace.ts
index ab7ba8970..ba0250e40 100644
--- a/apps/api/src/workspace/controllers/create-workspace.ts
+++ b/apps/api/src/workspace/controllers/create-workspace.ts
@@ -1,11 +1,9 @@
import type { Static } from "elysia";
import db from "../../database";
import { workspaceTable } from "../../database/schema";
-import type { createWorkspaceSchema } from "../db/queries";
+import type { CreateWorkspacePayload } from "../db/queries";
-type CreateWorkspaceArgs = Static<typeof createWorkspaceSchema>;
-
-async function createWorkspace(body: CreateWorkspaceArgs) {
+async function createWorkspace(body: CreateWorkspacePayload) {
return db.insert(workspaceTable).values(body);
}
diff --git a/apps/api/src/workspace/controllers/delete-workspace.ts b/apps/api/src/workspace/controllers/delete-workspace.ts
index 20be756f6..b3e2570bb 100644
--- a/apps/api/src/workspace/controllers/delete-workspace.ts
+++ b/apps/api/src/workspace/controllers/delete-workspace.ts
@@ -8,7 +8,7 @@ async function deleteWorkspace({
userId,
workspaceId,
}: DeleteWorkspacePayload) {
- const workspace = await db
+ const [existingWorkspace] = await db
.select({
id: workspaceTable.id,
ownerId: workspaceTable.ownerId,
@@ -22,13 +22,13 @@ async function deleteWorkspace({
)
.limit(1);
- const isWorkspaceExisting = Boolean(workspace.at(0));
+ const isWorkspaceExisting = Boolean(existingWorkspace);
if (!isWorkspaceExisting) {
throw new Error("Workspace not found or access denied");
}
- const deletedWorkspace = await db
+ const [deletedWorkspace] = await db
.delete(workspaceTable)
.where(eq(workspaceTable.id, workspaceId))
.returning({
@@ -38,7 +38,7 @@ async function deleteWorkspace({
createdAt: workspaceTable.createdAt,
});
- return deletedWorkspace.at(0);
+ return deletedWorkspace;
}
export default deleteWorkspace;
diff --git a/apps/api/src/workspace/controllers/get-workspace.ts b/apps/api/src/workspace/controllers/get-workspace.ts
index 0c45b9352..a85a0cce0 100644
--- a/apps/api/src/workspace/controllers/get-workspace.ts
+++ b/apps/api/src/workspace/controllers/get-workspace.ts
@@ -2,12 +2,11 @@ import { and, eq, or } from "drizzle-orm";
import db from "../../database";
import { workspaceTable, workspaceUserTable } from "../../database/schema";
-// TODO: Unify this type
async function getWorkspace({
userId,
workspaceId,
}: { userId: string; workspaceId: string }) {
- const workspace = await db
+ const [existingWorkspace] = await db
.select({
id: workspaceTable.id,
name: workspaceTable.name,
@@ -30,7 +29,7 @@ async function getWorkspace({
)
.limit(1);
- return workspace.at(0);
+ return existingWorkspace;
}
export default getWorkspace;
diff --git a/apps/api/src/workspace/controllers/get-workspaces.ts b/apps/api/src/workspace/controllers/get-workspaces.ts
index 74dcff6df..632363da4 100644
--- a/apps/api/src/workspace/controllers/get-workspaces.ts
+++ b/apps/api/src/workspace/controllers/get-workspaces.ts
@@ -1,26 +1,35 @@
import { eq, or } from "drizzle-orm";
import db from "../../database";
-import { workspaceTable, workspaceUserTable } from "../../database/schema";
+import {
+ projectTable,
+ workspaceTable,
+ workspaceUserTable,
+} from "../../database/schema";
+import groupWorkspacesWithProjects from "../utils/group-workspaces-with-project";
-// TODO: Unify this type
async function getWorkspaces({ userId }: { userId: string }) {
- return await db
+ const workspacesWithProjects = await db
.select({
id: workspaceTable.id,
name: workspaceTable.name,
ownerId: workspaceTable.ownerId,
+ projectId: projectTable.id,
+ projectName: projectTable.name,
})
.from(workspaceTable)
.leftJoin(
workspaceUserTable,
eq(workspaceTable.id, workspaceUserTable.workspaceId),
)
+ .leftJoin(projectTable, eq(workspaceTable.id, projectTable.workspaceId))
.where(
or(
eq(workspaceTable.ownerId, userId),
eq(workspaceUserTable.userId, userId),
),
);
+
+ return groupWorkspacesWithProjects(workspacesWithProjects);
}
export default getWorkspaces;
diff --git a/apps/api/src/workspace/controllers/update-workspace.ts b/apps/api/src/workspace/controllers/update-workspace.ts
index f5db2290d..82e3ff94d 100644
--- a/apps/api/src/workspace/controllers/update-workspace.ts
+++ b/apps/api/src/workspace/controllers/update-workspace.ts
@@ -1,4 +1,4 @@
-import { and, eq, or } from "drizzle-orm";
+import { and, eq } from "drizzle-orm";
import db from "../../database";
import { workspaceTable } from "../../database/schema";
import type { UpdateWorkspacePayload } from "../db/queries";
@@ -8,7 +8,7 @@ async function updateWorkspace({
workspaceId,
body,
}: { userId: string; workspaceId: string; body: UpdateWorkspacePayload }) {
- const workspace = await db
+ const [existingWorkspace] = await db
.select({
id: workspaceTable.id,
ownerId: workspaceTable.ownerId,
@@ -22,7 +22,7 @@ async function updateWorkspace({
)
.limit(1);
- const isWorkspaceExisting = Boolean(workspace.at(0));
+ const isWorkspaceExisting = Boolean(existingWorkspace);
if (!isWorkspaceExisting) {
throw new Error("TODO");
diff --git a/apps/api/src/workspace/db/queries.ts b/apps/api/src/workspace/db/queries.ts
index 0dd5a9e4c..83e0d71ea 100644
--- a/apps/api/src/workspace/db/queries.ts
+++ b/apps/api/src/workspace/db/queries.ts
@@ -16,5 +16,6 @@ export const deleteWorkspaceSchema = t.Object({
workspaceId: t.String(),
});
+export type CreateWorkspacePayload = Static<typeof createWorkspaceSchema>;
export type UpdateWorkspacePayload = Static<typeof updateWorkspaceSchema>;
export type DeleteWorkspacePayload = Static<typeof deleteWorkspaceSchema>;
diff --git a/apps/api/src/workspace/utils/group-workspaces-with-project.ts b/apps/api/src/workspace/utils/group-workspaces-with-project.ts
new file mode 100644
index 000000000..5b95b4779
--- /dev/null
+++ b/apps/api/src/workspace/utils/group-workspaces-with-project.ts
@@ -0,0 +1,45 @@
+function groupWorkspacesWithProjects(
+ workspacesWithProjects: {
+ id: string;
+ name: string;
+ ownerId: string;
+ projectId: string | null;
+ projectName: string | null;
+ }[],
+) {
+ const groupedWorkspaces = new Map<
+ string,
+ {
+ id: string;
+ name: string;
+ ownerId: string;
+ projects: { projectId: string; projectName: string }[];
+ }
+ >();
+
+ for (const {
+ id,
+ name,
+ ownerId,
+ projectId,
+ projectName,
+ } of workspacesWithProjects) {
+ if (!groupedWorkspaces.has(id)) {
+ groupedWorkspaces.set(id, {
+ id,
+ name,
+ ownerId,
+ projects: [],
+ });
+ }
+
+ const workspace = groupedWorkspaces.get(id);
+ if (workspace && projectId && projectName) {
+ workspace.projects.push({ projectId, projectName });
+ }
+ }
+
+ return Array.from(groupedWorkspaces.values());
+}
+
+export default groupWorkspacesWithProjects;
diff --git a/apps/web/package.json b/apps/web/package.json
index 90f9ee64e..be154e498 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -13,8 +13,10 @@
"@dnd-kit/sortable": "^10.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@hookform/resolvers": "^3.10.0",
+ "@radix-ui/react-accordion": "^1.2.2",
"@radix-ui/react-avatar": "^1.1.2",
"@radix-ui/react-dialog": "^1.1.4",
+ "@radix-ui/react-dropdown-menu": "^2.1.4",
"@radix-ui/react-label": "^2.1.1",
"@radix-ui/react-slot": "^1.1.1",
"@radix-ui/react-tooltip": "^1.1.6",
diff --git a/apps/web/src/components/common/sidebar/sections/projects/add-project-modal.tsx b/apps/web/src/components/common/sidebar/sections/projects/add-project-modal.tsx
new file mode 100644
index 000000000..2567f9926
--- /dev/null
+++ b/apps/web/src/components/common/sidebar/sections/projects/add-project-modal.tsx
@@ -0,0 +1,111 @@
+import { Button } from "@/components/ui/button";
+import { Input } from "@/components/ui/input";
+import useCreateProject from "@/hooks/mutations/project/use-create-project";
+import useWorkspaceStore from "@/store/workspace";
+import * as Dialog from "@radix-ui/react-dialog";
+import { useQueryClient } from "@tanstack/react-query";
+import { X } from "lucide-react";
+import { useState } from "react";
+
+type AddProjectModalProps = {
+ open: boolean;
+ onClose: () => void;
+};
+
+function AddProjectModal({ open, onClose }: AddProjectModalProps) {
+ const [name, setName] = useState("");
+ const [description, setDescription] = useState("");
+ const queryClient = useQueryClient();
+ const { workspace } = useWorkspaceStore();
+ const { mutateAsync } = useCreateProject({
+ name,
+ description,
+ workspaceId: workspace?.id ?? "",
+ });
+
+ const handleSubmit = async (e: React.FormEvent) => {
+ e.preventDefault();
+ if (!name.trim()) return;
+
+ await mutateAsync();
+ await queryClient.invalidateQueries({ queryKey: ["workspaces"] });
+
+ setName("");
+ onClose();
+ };
+
+ return (
+ <Dialog.Root open={open} onOpenChange={onClose}>
+ <Dialog.Portal>
+ <Dialog.Overlay className="fixed inset-0 bg-black/40 backdrop-blur-sm" />
+ <Dialog.Content className="fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-md">
+ <div className="bg-white dark:bg-zinc-900 rounded-lg shadow-xl">
+ <div className="flex items-center justify-between p-4 border-b border-zinc-200 dark:border-zinc-800">
+ <Dialog.Title className="text-lg font-semibold text-zinc-900 dark:text-zinc-100">
+ New Project
+ </Dialog.Title>
+ <Dialog.Close className="text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-300">
+ <X size={20} />
+ </Dialog.Close>
+ </div>
+
+ <form onSubmit={handleSubmit} className="p-4">
+ <div className="mb-4">
+ <label
+ htmlFor="projectName"
+ aria-label="Project name"
+ className="block text-sm font-medium text-zinc-900 dark:text-zinc-300 mb-1"
+ >
+ Project Name
+ </label>
+ <Input
+ value={name}
+ onChange={(e) => setName(e.target.value)}
+ placeholder="Designers"
+ className="bg-white dark:bg-zinc-800/50"
+ required
+ />
+ </div>
+
+ <div className="mb-4">
+ <label
+ htmlFor="projectDescription"
+ aria-label="Project description"
+ className="block text-sm font-medium text-zinc-900 dark:text-zinc-300 mb-1"
+ >
+ Project Description
+ </label>
+ <Input
+ value={description}
+ onChange={(e) => setDescription(e.target.value)}
+ placeholder="The design project!"
+ className="bg-white dark:bg-zinc-800/50"
+ required
+ />
+ </div>
+
+ <div className="flex justify-end gap-2">
+ <Dialog.Close asChild>
+ <Button
+ type="button"
+ className="bg-zinc-100 text-zinc-900 hover:bg-zinc-200 dark:bg-zinc-800 dark:text-zinc-100 dark:hover:bg-zinc-700"
+ >
+ Cancel
+ </Button>
+ </Dialog.Close>
+ <Button
+ type="submit"
+ className="bg-indigo-600 text-white hover:bg-indigo-500 dark:bg-indigo-500 dark:hover:bg-indigo-400"
+ >
+ Create Project
+ </Button>
+ </div>
+ </form>
+ </div>
+ </Dialog.Content>
+ </Dialog.Portal>
+ </Dialog.Root>
+ );
+}
+
+export default AddProjectModal;
diff --git a/apps/web/src/components/common/sidebar/sections/projects/project-item.tsx b/apps/web/src/components/common/sidebar/sections/projects/project-item.tsx
new file mode 100644
index 000000000..9e44ca91e
--- /dev/null
+++ b/apps/web/src/components/common/sidebar/sections/projects/project-item.tsx
@@ -0,0 +1,50 @@
+import { cn } from "@/lib/utils";
+import useProjectStore from "@/store/project";
+import { Layout } from "lucide-react";
+
+type ProjectItemProps = {
+ project: {
+ projectId: string;
+ projectName: string;
+ };
+};
+
+function ProjectItem({ project }: ProjectItemProps) {
+ const { project: selectedProject, setProject } = useProjectStore();
+ const isSelected = project?.projectId === selectedProject?.projectId;
+
+ return (
+ <button
+ type="button"
+ key={project.projectId}
+ onClick={() => setProject(project)}
+ className={cn(
+ "w-full text-left px-2 py-1.5 rounded-md flex items-center text-sm transition-all group",
+ isSelected
+ ? "bg-indigo-50 dark:bg-indigo-500/10"
+ : "hover:bg-zinc-100 dark:hover:bg-zinc-800/50",
+ )}
+ >
+ <Layout
+ className={cn(
+ "w-4 h-4 mr-2",
+ isSelected
+ ? "text-indigo-600 dark:text-indigo-400"
+ : "text-zinc-400 dark:text-zinc-500 group-hover:text-zinc-500 dark:group-hover:text-zinc-400",
+ )}
+ />
+ <span
+ className={cn(
+ "font-medium",
+ isSelected
+ ? "text-indigo-600 dark:text-indigo-400"
+ : "text-zinc-600 dark:text-zinc-400 group-hover:text-zinc-900 dark:group-hover:text-zinc-300",
+ )}
+ >
+ {project.projectName}
+ </span>
+ </button>
+ );
+}
+
+export default ProjectItem;
diff --git a/apps/web/src/components/common/sidebar/sections/team.tsx b/apps/web/src/components/common/sidebar/sections/team.tsx
index d7411c2e3..e2e20dc7a 100644
--- a/apps/web/src/components/common/sidebar/sections/team.tsx
+++ b/apps/web/src/components/common/sidebar/sections/team.tsx
@@ -8,10 +8,12 @@ function Team() {
</h2>
<button
type="button"
- className="w-full text-left px-3 py-2 text-zinc-700 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-zinc-800 rounded-lg flex items-center transition-colors"
+ className="w-full text-left px-2 py-1.5 text-zinc-600 hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800/50 rounded-md flex items-center transition-all group"
>
- <Users className="w-4 h-4 mr-2 text-zinc-500 dark:text-zinc-400" />
- Manage Team
+ <Users className="w-4 h-4 mr-2 text-zinc-400 dark:text-zinc-500 group-hover:text-zinc-500 dark:group-hover:text-zinc-400" />
+ <span className="text-sm font-medium group-hover:text-zinc-900 dark:group-hover:text-zinc-300">
+ Manage Team
+ </span>
</button>
</div>
);
diff --git a/apps/web/src/components/common/sidebar/sections/workspaces/add-workspace.tsx b/apps/web/src/components/common/sidebar/sections/workspaces/add-workspace.tsx
deleted file mode 100644
index 91195204f..000000000
--- a/apps/web/src/components/common/sidebar/sections/workspaces/add-workspace.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import { Plus } from "lucide-react";
-import { useState } from "react";
-import { CreateWorkspaceModal } from "./add-workspace-modal";
-
-function AddWorkspace() {
- const [isDialogOpen, setIsDialogOpen] = useState<boolean>(false);
-
- return (
- <>
- <button
- type="button"
- onClick={() => setIsDialogOpen(true)}
- className="w-full text-left px-3 py-2 text-zinc-700 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-zinc-800 rounded-lg flex items-center transition-colors"
- >
- <Plus className="w-4 h-4 mr-2 text-zinc-500 dark:text-zinc-400" />
- Add Workspace
- </button>
- <CreateWorkspaceModal
- open={isDialogOpen}
- onClose={() => setIsDialogOpen(false)}
- />
- </>
- );
-}
-
-export default AddWorkspace;
diff --git a/apps/web/src/components/common/sidebar/sections/workspaces/add-workspace-modal.tsx b/apps/web/src/components/common/sidebar/sections/workspaces/components/add-workspace-modal.tsx
similarity index 100%
rename from apps/web/src/components/common/sidebar/sections/workspaces/add-workspace-modal.tsx
rename to apps/web/src/components/common/sidebar/sections/workspaces/components/add-workspace-modal.tsx
diff --git a/apps/web/src/components/common/sidebar/sections/workspaces/components/add-workspace.tsx b/apps/web/src/components/common/sidebar/sections/workspaces/components/add-workspace.tsx
new file mode 100644
index 000000000..bffcdcc2e
--- /dev/null
+++ b/apps/web/src/components/common/sidebar/sections/workspaces/components/add-workspace.tsx
@@ -0,0 +1,31 @@
+import { Plus } from "lucide-react";
+import { useState } from "react";
+import { CreateWorkspaceModal } from "./add-workspace-modal";
+
+function AddWorkspace() {
+ const [isAddWorkspaceModalOpen, setIsAddWorkspaceModalOpen] =
+ useState<boolean>(false);
+
+ return (
+ <>
+ <button
+ type="button"
+ onClick={() => setIsAddWorkspaceModalOpen(true)}
+ className="w-full text-left px-2 py-1.5 text-zinc-600 hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800/50 rounded-md flex items-center transition-all group"
+ >
+ <div className="p-1 rounded-md bg-zinc-100 dark:bg-zinc-800 mr-2">
+ <Plus className="w-3 h-3 text-zinc-500 dark:text-zinc-400" />
+ </div>
+ <span className="text-sm font-medium group-hover:text-zinc-900 dark:group-hover:text-zinc-300">
+ Add Workspace
+ </span>
+ </button>
+ <CreateWorkspaceModal
+ open={isAddWorkspaceModalOpen}
+ onClose={() => setIsAddWorkspaceModalOpen(false)}
+ />
+ </>
+ );
+}
+
+export default AddWorkspace;
diff --git a/apps/web/src/components/common/sidebar/sections/workspaces/components/workspace-item.tsx b/apps/web/src/components/common/sidebar/sections/workspaces/components/workspace-item.tsx
new file mode 100644
index 000000000..6593d98c6
--- /dev/null
+++ b/apps/web/src/components/common/sidebar/sections/workspaces/components/workspace-item.tsx
@@ -0,0 +1,84 @@
+import { cn } from "@/lib/utils";
+import type { Project } from "@/types/project";
+import { ChevronDown, ChevronRight, Folder, FolderOpen } from "lucide-react";
+import { Fragment } from "react/jsx-runtime";
+import ProjectItem from "../../projects/project-item";
+import WorkspaceMenu from "./workspace-menu";
+
+type WorkspaceItemProps = {
+ workspace: {
+ id: string;
+ name: string;
+ projects: Project[];
+ };
+ isExpanded: boolean;
+ onExpandWorkspace: (id: string) => void;
+ onSelectWorkspace: (
+ event:
+ | React.KeyboardEvent<HTMLDivElement>
+ | React.MouseEvent<HTMLDivElement>,
+ id: string,
+ ) => void;
+};
+
+function WorkspaceItem({
+ workspace,
+ isExpanded,
+ onSelectWorkspace,
+ onExpandWorkspace,
+}: WorkspaceItemProps) {
+ return (
+ <Fragment>
+ <div
+ onClick={(e) => onSelectWorkspace(e, workspace.id)}
+ onKeyUp={(e) => e.key === "Enter" && onSelectWorkspace(e, workspace.id)}
+ onKeyDown={(e) =>
+ e.key === "Enter" && onSelectWorkspace(e, workspace.id)
+ }
+ className={cn(
+ "w-full text-left px-2 py-1.5 rounded-md flex items-center transition-all cursor-pointer group",
+ "hover:bg-zinc-100 dark:hover:bg-zinc-800/50",
+ isExpanded && "bg-zinc-50 dark:bg-zinc-800/30",
+ )}
+ >
+ <button
+ type="button"
+ onClick={() => onExpandWorkspace(workspace.id)}
+ className="p-1 rounded-md mr-1 hover:bg-zinc-200 dark:hover:bg-zinc-700/50 transition-colors"
+ >
+ {isExpanded ? (
+ <ChevronDown className="w-3.5 h-3.5 text-zinc-500 dark:text-zinc-400" />
+ ) : (
+ <ChevronRight className="w-3.5 h-3.5 text-zinc-500 dark:text-zinc-400" />
+ )}
+ </button>
+ {isExpanded ? (
+ <FolderOpen className="w-4 h-4 mr-2 text-indigo-500 dark:text-indigo-400" />
+ ) : (
+ <Folder className="w-4 h-4 mr-2 text-zinc-400 dark:text-zinc-500 group-hover:text-zinc-500 dark:group-hover:text-zinc-400" />
+ )}
+ <span
+ className={cn(
+ "text-sm font-medium",
+ isExpanded
+ ? "text-zinc-900 dark:text-zinc-100"
+ : "text-zinc-600 dark:text-zinc-400 group-hover:text-zinc-900 dark:group-hover:text-zinc-300",
+ )}
+ >
+ {workspace.name}
+ </span>
+
+ <WorkspaceMenu id={workspace?.id} />
+ </div>
+ {isExpanded && workspace.projects.length > 0 && (
+ <div className="ml-8 space-y-0.5 mt-1">
+ {workspace.projects.map((project) => (
+ <ProjectItem key={project.projectId} project={project} />
+ ))}
+ </div>
+ )}
+ </Fragment>
+ );
+}
+
+export default WorkspaceItem;
diff --git a/apps/web/src/components/common/sidebar/sections/workspaces/components/workspace-menu.tsx b/apps/web/src/components/common/sidebar/sections/workspaces/components/workspace-menu.tsx
new file mode 100644
index 000000000..654c6cb47
--- /dev/null
+++ b/apps/web/src/components/common/sidebar/sections/workspaces/components/workspace-menu.tsx
@@ -0,0 +1,98 @@
+import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
+
+import useDeleteWorkspace from "@/hooks/mutations/workspace/use-delete-workspace";
+import { cn } from "@/lib/utils";
+import queryClient from "@/query-client";
+import { MoreHorizontal, Pencil, Plus, Trash2 } from "lucide-react";
+import { useState } from "react";
+import AddProjectModal from "../../projects/add-project-modal";
+
+type WorkspaceMenuProps = {
+ id: string;
+};
+
+function WorkspaceMenu({ id }: WorkspaceMenuProps) {
+ const [isCreateProjectModalOpen, setCreateProjectModalOpen] = useState(false);
+ const { mutateAsync: deleteWorkspace } = useDeleteWorkspace({
+ id,
+ });
+
+ async function handleDeleteWorkspace() {
+ await deleteWorkspace();
+ queryClient.invalidateQueries({
+ queryKey: ["workspaces"],
+ });
+ }
+
+ return (
+ <>
+ <DropdownMenu.Root>
+ <DropdownMenu.Trigger asChild>
+ <button
+ type="button"
+ aria-label="Edit workspace"
+ className="p-1 rounded-md hover:bg-zinc-200 dark:hover:bg-zinc-700/50 transition-colors ml-auto"
+ onClick={(e) => e.stopPropagation()}
+ >
+ <MoreHorizontal className="w-4 h-4 text-zinc-500 dark:text-zinc-400" />
+ </button>
+ </DropdownMenu.Trigger>
+
+ <DropdownMenu.Portal>
+ <DropdownMenu.Content
+ className="min-w-[180px] bg-white dark:bg-zinc-800 rounded-lg shadow-lg border border-zinc-200 dark:border-zinc-700 py-1"
+ align="end"
+ sideOffset={5}
+ >
+ <DropdownMenu.Item
+ className={cn(
+ "flex items-center px-2 py-1.5 mx-1 text-sm rounded-md cursor-pointer outline-none",
+ "text-zinc-600 dark:text-zinc-300",
+ "hover:bg-zinc-100 dark:hover:bg-zinc-700",
+ "focus:bg-zinc-100 dark:focus:bg-zinc-700",
+ )}
+ onClick={() => setCreateProjectModalOpen(true)}
+ >
+ <Plus className="w-4 h-4 mr-2" />
+ New Project
+ </DropdownMenu.Item>
+
+ <DropdownMenu.Separator className="h-px bg-zinc-200 dark:bg-zinc-700 my-1" />
+
+ <DropdownMenu.Item
+ className={cn(
+ "flex items-center px-2 py-1.5 mx-1 text-sm rounded-md cursor-pointer outline-none",
+ "text-zinc-600 dark:text-zinc-300",
+ "hover:bg-zinc-100 dark:hover:bg-zinc-700",
+ "focus:bg-zinc-100 dark:focus:bg-zinc-700",
+ )}
+ onClick={() => {}}
+ >
+ <Pencil className="w-4 h-4 mr-2" />
+ Edit Workspace
+ </DropdownMenu.Item>
+
+ <DropdownMenu.Item
+ className={cn(
+ "flex items-center px-2 py-1.5 mx-1 text-sm rounded-md cursor-pointer outline-none",
+ "text-red-600 dark:text-red-400",
+ "hover:bg-red-50 dark:hover:bg-red-500/10",
+ "focus:bg-red-50 dark:focus:bg-red-500/10",
+ )}
+ onClick={handleDeleteWorkspace}
+ >
+ <Trash2 className="w-4 h-4 mr-2" />
+ Delete Workspace
+ </DropdownMenu.Item>
+ </DropdownMenu.Content>
+ </DropdownMenu.Portal>
+ </DropdownMenu.Root>
+ <AddProjectModal
+ open={isCreateProjectModalOpen}
+ onClose={() => setCreateProjectModalOpen(false)}
+ />
+ </>
+ );
+}
+
+export default WorkspaceMenu;
diff --git a/apps/web/src/components/common/sidebar/sections/workspaces/index.tsx b/apps/web/src/components/common/sidebar/sections/workspaces/index.tsx
index 3fc358d88..4a66ae5be 100644
--- a/apps/web/src/components/common/sidebar/sections/workspaces/index.tsx
+++ b/apps/web/src/components/common/sidebar/sections/workspaces/index.tsx
@@ -1,8 +1,10 @@
import useGetWorkspaces from "@/hooks/queries/workspace/use-get-workspace";
import useWorkspaceStore from "@/store/workspace";
-import { useEffect } from "react";
-import AddWorkspace from "./add-workspace";
-import WorkspaceItemButton from "./workspace-item-button";
+import { FilePlus } from "lucide-react";
+import type React from "react";
+import { useEffect, useState } from "react";
+import AddWorkspace from "./components/add-workspace";
+import WorkspaceItem from "./components/workspace-item";
function Workspaces() {
const { data } = useGetWorkspaces();
@@ -11,15 +13,62 @@ function Workspaces() {
(state) => state,
);
+ const [expandedWorkspaces, setExpandedWorkspaces] = useState<string[]>([
+ selectedWorkspace?.id || "",
+ ]);
+
+ const handleExpandWorkspace = (workspaceId: string) => {
+ setExpandedWorkspaces((prev) =>
+ prev.includes(workspaceId)
+ ? prev.filter((id) => id !== workspaceId)
+ : [...prev, workspaceId],
+ );
+ };
+
+ const handleSelectWorkspace = (
+ event:
+ | React.MouseEvent<HTMLDivElement>
+ | React.KeyboardEvent<HTMLDivElement>,
+ workspaceId: string,
+ ) => {
+ event.stopPropagation();
+
+ const newWorkspace = workspaces?.find(
+ (workspace) => workspace.id === workspaceId,
+ );
+
+ if (!newWorkspace) return;
+
+ setWorkspace(newWorkspace);
+
+ if (!expandedWorkspaces.includes(workspaceId)) {
+ setExpandedWorkspaces((prev) => [...prev, workspaceId]);
+ }
+ };
+
useEffect(() => {
if (data?.data) {
setWorkspace(data?.data[0]);
}
}, [data?.data, setWorkspace]);
- if (!workspaces || !workspaces?.length) {
- // TODO: Add better empty screen
- return <div>You don't have any workspaces</div>;
+ if (!workspaces || !workspaces.length) {
+ return (
+ <>
+ <div className="flex items-center justify-center px-3 pt-8 text-center">
+ <div className="text-sm text-zinc-500 dark:text-zinc-400">
+ <FilePlus className="mx-auto mb-5 text-zinc-400 dark:text-zinc-500 w-8 h-8" />
+ <p className="text-base text-zinc-700 dark:text-zinc-200 font-medium">
+ No workspaces yet
+ </p>
+ <p className="text-sm text-zinc-400 dark:text-zinc-500 mt-2">
+ Create a workspace to organize your projects.
+ </p>
+ </div>
+ </div>
+ <AddWorkspace />
+ </>
+ );
}
return (
@@ -29,12 +78,14 @@ function Workspaces() {
</h2>
<div className="space-y-1">
{workspaces.map((workspace) => (
- <WorkspaceItemButton
- key={workspace.id}
- workspace={workspace}
- onSelectWorkspace={() => setWorkspace(workspace)}
- isSelected={workspace.id === selectedWorkspace?.id}
- />
+ <div key={workspace.id} className="space-y-1">
+ <WorkspaceItem
+ workspace={workspace}
+ isExpanded={expandedWorkspaces.includes(workspace.id)}
+ onSelectWorkspace={handleSelectWorkspace}
+ onExpandWorkspace={handleExpandWorkspace}
+ />
+ </div>
))}
<AddWorkspace />
</div>
diff --git a/apps/web/src/components/common/sidebar/sections/workspaces/workspace-item-button.tsx b/apps/web/src/components/common/sidebar/sections/workspaces/workspace-item-button.tsx
deleted file mode 100644
index 520ac0866..000000000
--- a/apps/web/src/components/common/sidebar/sections/workspaces/workspace-item-button.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-import {
- Tooltip,
- TooltipContent,
- TooltipProvider,
- TooltipTrigger,
-} from "@/components/ui/tooltip";
-import { Folder } from "lucide-react";
-
-type WorkspaceItemButtonProps = {
- workspace: {
- id: string;
- name: string;
- };
- isSelected: boolean;
- onSelectWorkspace: (id: string) => void;
-};
-
-const buttonStyles: Record<string, string> = {
- true: "bg-indigo-50 text-indigo-600 dark:bg-indigo-500/10 dark:text-indigo-400",
- false:
- "text-zinc-700 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-zinc-800",
-};
-
-const iconStyles: Record<string, string> = {
- true: "text-indigo-600 dark:text-indigo-400",
- false: "text-zinc-500 dark:text-zinc-400",
-};
-
-function WorkspaceItemButton({
- workspace,
- isSelected,
- onSelectWorkspace,
-}: WorkspaceItemButtonProps) {
- return (
- <TooltipProvider>
- <Tooltip>
- <TooltipTrigger asChild>
- <button
- type="button"
- key={workspace.id}
- onClick={() => onSelectWorkspace(workspace.id)}
- className={`w-full text-left px-3 py-2 rounded-lg flex items-center transition-colors ${
- buttonStyles[String(isSelected)]
- }`}
- >
- <Folder
- className={`w-4 h-4 mr-2 flex-shrink-0 ${
- iconStyles[String(isSelected)]
- }`}
- />
- <span className="truncate">{workspace.name}</span>
- </button>
- </TooltipTrigger>
- <TooltipContent>
- <p>{workspace.name}</p>
- </TooltipContent>
- </Tooltip>
- </TooltipProvider>
- );
-}
-
-export default WorkspaceItemButton;
diff --git a/apps/web/src/fetchers/project/create-project.ts b/apps/web/src/fetchers/project/create-project.ts
new file mode 100644
index 000000000..31a30a94f
--- /dev/null
+++ b/apps/web/src/fetchers/project/create-project.ts
@@ -0,0 +1,21 @@
+import { api } from "@kaneo/libs";
+
+async function createProject({
+ name,
+ description,
+ workspaceId,
+}: { name: string; description: string; workspaceId: string }) {
+ const response = await api.project.create.post({
+ name,
+ description,
+ workspaceId,
+ });
+
+ if (response.error) {
+ throw new Error(response.error.value.message);
+ }
+
+ return response;
+}
+
+export default createProject;
diff --git a/apps/web/src/fetchers/project/get-projects.ts b/apps/web/src/fetchers/project/get-projects.ts
new file mode 100644
index 000000000..c7ad5edae
--- /dev/null
+++ b/apps/web/src/fetchers/project/get-projects.ts
@@ -0,0 +1,13 @@
+import { api } from "@kaneo/libs";
+
+async function getProjects({ workspaceId }: { workspaceId: string }) {
+ const response = await api.project.list({ workspaceId }).get();
+
+ if (response.error) {
+ throw new Error(response.error.value.message);
+ }
+
+ return response?.data;
+}
+
+export default getProjects;
diff --git a/apps/web/src/fetchers/workspace/delete-workspace.ts b/apps/web/src/fetchers/workspace/delete-workspace.ts
new file mode 100644
index 000000000..8602ebf01
--- /dev/null
+++ b/apps/web/src/fetchers/workspace/delete-workspace.ts
@@ -0,0 +1,13 @@
+import { api } from "@kaneo/libs";
+
+const deleteWorkspace = async ({ id }: { id: string }) => {
+ const response = await api.workspace({ id }).delete();
+
+ if (response.error) {
+ throw new Error(response.error.value.message);
+ }
+
+ return response;
+};
+
+export default deleteWorkspace;
diff --git a/apps/web/src/hooks/mutations/project/use-create-project.ts b/apps/web/src/hooks/mutations/project/use-create-project.ts
new file mode 100644
index 000000000..26f35f730
--- /dev/null
+++ b/apps/web/src/hooks/mutations/project/use-create-project.ts
@@ -0,0 +1,14 @@
+import createProject from "@/fetchers/project/create-project";
+import { useMutation } from "@tanstack/react-query";
+
+function useCreateProject({
+ name,
+ description,
+ workspaceId,
+}: { name: string; description: string; workspaceId: string }) {
+ return useMutation({
+ mutationFn: () => createProject({ name, description, workspaceId }),
+ });
+}
+
+export default useCreateProject;
diff --git a/apps/web/src/hooks/mutations/workspace/use-delete-workspace.ts b/apps/web/src/hooks/mutations/workspace/use-delete-workspace.ts
new file mode 100644
index 000000000..ad1ccc806
--- /dev/null
+++ b/apps/web/src/hooks/mutations/workspace/use-delete-workspace.ts
@@ -0,0 +1,13 @@
+import deleteWorkspace from "@/fetchers/workspace/delete-workspace";
+import { useMutation } from "@tanstack/react-query";
+
+function useDeleteWorkspace({ id }: { id: string }) {
+ return useMutation({
+ mutationFn: () =>
+ deleteWorkspace({
+ id,
+ }),
+ });
+}
+
+export default useDeleteWorkspace;
diff --git a/apps/web/src/hooks/queries/project/use-get-projects.ts b/apps/web/src/hooks/queries/project/use-get-projects.ts
new file mode 100644
index 000000000..7a1ca97ce
--- /dev/null
+++ b/apps/web/src/hooks/queries/project/use-get-projects.ts
@@ -0,0 +1,11 @@
+import getProjects from "@/fetchers/project/get-projects";
+import { useQuery } from "@tanstack/react-query";
+
+function useGetProjects({ workspaceId }: { workspaceId: string }) {
+ return useQuery({
+ queryFn: () => getProjects({ workspaceId }),
+ queryKey: ["projects"],
+ });
+}
+
+export default useGetProjects;
diff --git a/apps/web/src/store/project.ts b/apps/web/src/store/project.ts
new file mode 100644
index 000000000..4f6d8bd5a
--- /dev/null
+++ b/apps/web/src/store/project.ts
@@ -0,0 +1,12 @@
+import type { Project } from "@/types/project";
+import { create } from "zustand";
+
+const useProjectStore = create<{
+ project: Project | null;
+ setProject: (updatedProject: Project) => void;
+}>((set) => ({
+ project: null,
+ setProject: (updatedProject) => set(() => ({ project: updatedProject })),
+}));
+
+export default useProjectStore;
diff --git a/apps/web/src/types/project/index.ts b/apps/web/src/types/project/index.ts
new file mode 100644
index 000000000..70ffcde88
--- /dev/null
+++ b/apps/web/src/types/project/index.ts
@@ -0,0 +1,4 @@
+export type Project = {
+ projectId: string;
+ projectName: string;
+};
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index b4cf18b38..cf83bfb51 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -97,12 +97,18 @@ importers:
'@hookform/resolvers':
specifier: ^3.10.0
+ '@radix-ui/react-accordion':
+ specifier: ^1.2.2
'@radix-ui/react-avatar':
specifier: ^1.1.2
'@radix-ui/react-dialog':
specifier: ^1.1.4
+ '@radix-ui/react-dropdown-menu':
+ specifier: ^2.1.4
'@radix-ui/react-label':
specifier: ^2.1.1
@@ -1133,6 +1139,19 @@ packages:
'@radix-ui/[email protected]':
resolution: {integrity: sha512-SJ31y+Q/zAyShtXJc8x83i9TYdbAfHZ++tUZnvjJJqFjzsdUnKsxPL6IEtBlxKkU7yzer//GQtZSV4GbldL3YA==}
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-b1oh54x4DMCdGsB4/7ahiSrViXxaBwRPotiZNnYXjLha9vfuURSAZErki6qjDoSIV0eXx5v57XnTGVtGwnfp2g==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
'@radix-ui/[email protected]':
resolution: {integrity: sha512-NaVpZfmv8SKeZbn4ijN2V3jlHA9ngBG16VnIIm22nUR0Yk8KUALyBxT3KYEUnNuch9sTE8UTsS3whzBgKOL30w==}
peerDependencies:
@@ -1159,6 +1178,32 @@ packages:
'@types/react-dom':
optional: true
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-PliMB63vxz7vggcyq0IxNYk8vGDrLXVWw4+W4B8YnwI1s18x7YZYqlG9PLX7XxAJUi0g2DxP4XKJMFHh/iVh9A==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-LwT3pSho9Dljg+wY2KN2mrrh6y3qELfftINERIzBUO9e0N+t0oMTyn3k9iv+ZqgrwGkRnLpNJrsMv9BZlt2yuA==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
'@radix-ui/[email protected]':
resolution: {integrity: sha512-Y9VzoRDSJtgFMUCoiZBDVo084VQ5hfpXxVE+NgkdNsjiDBByiImMZKKhxMwCbdHvhlENG6a833CbFkOQvTricw==}
peerDependencies:
@@ -1190,6 +1235,15 @@ packages:
'@types/react-dom':
optional: true
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-BUuBvgThEiAXh2DWu93XsT+a3aWrGqolGlqqw5VU1kG7p/ZH2cuDlM1sRLNnY3QcBS69UIz2mcKhMxDsdewhjg==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
'@radix-ui/[email protected]':
resolution: {integrity: sha512-onrWn/72lQoEucDmJnr8uczSNTujT0vJnA/X5+3AkChVPowr8n1yvIKIabhWyMQeMvvmdpsvcyDqx3X1LEXCPg==}
peerDependencies:
@@ -1203,6 +1257,19 @@ packages:
'@types/react-dom':
optional: true
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-iXU1Ab5ecM+yEepGAWK8ZhMyKX4ubFdCNtol4sT9D0OVErG9PNElfx3TQhjw7n7BC5nFVz68/5//clWy+8TXzA==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
'@radix-ui/[email protected]':
resolution: {integrity: sha512-pSIwfrT1a6sIoDASCSpFwOasEwKTZWDw/iBdtnqKO7v6FeOzYJ7U53cPzYFVR3geGGXgVHaH+CdngrrAzqUGxg==}
peerDependencies:
@@ -1247,6 +1314,19 @@ packages:
'@types/react-dom':
optional: true
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-BnOgVoL6YYdHAG6DtXONaR29Eq4nvbi8rutrV/xlr3RQCMMb3yqP85Qiw/3NReozrSW+4dfLkK+rc1hb4wPU/A==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
'@radix-ui/[email protected]':
resolution: {integrity: sha512-3kn5Me69L+jv82EKRuQCXdYyf1DqHwD2U/sxoNgBGCB7K9TRc3bQamQ+5EPM9EvyPdli0W41sROd+ZU1dTCztw==}
peerDependencies:
@@ -1299,6 +1379,19 @@ packages:
'@types/react-dom':
optional: true
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-QE1RoxPGJ/Nm8Qmk0PxP8ojmoaS67i0s7hVssS7KuI2FQoc/uzVlZsqKfQvxPE6D8hICCPHJ4D88zNhT3OOmkw==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
'@radix-ui/[email protected]':
resolution: {integrity: sha512-RApLLOcINYJA+dMVbOju7MYv1Mb2EBp2nH4HdDzXTSyaR5optlm6Otrz1euW3HbdOR8UmmFK06TD+A9frYWv+g==}
peerDependencies:
@@ -3674,6 +3767,23 @@ snapshots:
'@radix-ui/[email protected]': {}
+ dependencies:
+ '@radix-ui/primitive': 1.1.1
+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-direction': 1.1.0(@types/[email protected])([email protected])
+ '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])
+ react: 19.0.0
+ react-dom: 19.0.0([email protected])
+ optionalDependencies:
+ '@types/react': 19.0.7
+ '@types/react-dom': 19.0.3(@types/[email protected])
+
dependencies:
@@ -3695,6 +3805,34 @@ snapshots:
'@types/react': 19.0.7
'@types/react-dom': 19.0.3(@types/[email protected])
+ dependencies:
+ '@radix-ui/primitive': 1.1.1
+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])
+ '@radix-ui/react-use-layout-effect': 1.1.0(@types/[email protected])([email protected])
+ react: 19.0.0
+ react-dom: 19.0.0([email protected])
+ optionalDependencies:
+ '@types/react': 19.0.7
+ '@types/react-dom': 19.0.3(@types/[email protected])
+
+ dependencies:
+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-slot': 1.1.1(@types/[email protected])([email protected])
+ react: 19.0.0
+ react-dom: 19.0.0([email protected])
+ optionalDependencies:
+ '@types/react': 19.0.7
+ '@types/react-dom': 19.0.3(@types/[email protected])
+
dependencies:
react: 19.0.0
@@ -3729,6 +3867,12 @@ snapshots:
'@types/react': 19.0.7
'@types/react-dom': 19.0.3(@types/[email protected])
+ dependencies:
+ react: 19.0.0
+ optionalDependencies:
+ '@types/react': 19.0.7
+
dependencies:
'@radix-ui/primitive': 1.1.1
@@ -3742,6 +3886,21 @@ snapshots:
'@types/react': 19.0.7
'@types/react-dom': 19.0.3(@types/[email protected])
+ dependencies:
+ '@radix-ui/primitive': 1.1.1
+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])
+ react: 19.0.0
+ react-dom: 19.0.0([email protected])
+ optionalDependencies:
+ '@types/react': 19.0.7
+ '@types/react-dom': 19.0.3(@types/[email protected])
+
dependencies:
react: 19.0.0
@@ -3775,6 +3934,32 @@ snapshots:
'@types/react': 19.0.7
'@types/react-dom': 19.0.3(@types/[email protected])
+ dependencies:
+ '@radix-ui/primitive': 1.1.1
+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-direction': 1.1.0(@types/[email protected])([email protected])
+ '@radix-ui/react-dismissable-layer': 1.1.3(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-focus-guards': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])
+ '@radix-ui/react-roving-focus': 1.1.1(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-slot': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])
+ aria-hidden: 1.2.4
+ react: 19.0.0
+ react-dom: 19.0.0([email protected])
+ react-remove-scroll: 2.6.2(@types/[email protected])([email protected])
+ optionalDependencies:
+ '@types/react': 19.0.7
+ '@types/react-dom': 19.0.3(@types/[email protected])
+
dependencies:
'@floating-ui/react-dom': 2.1.2([email protected]([email protected]))([email protected])
@@ -3822,6 +4007,23 @@ snapshots:
'@types/react': 19.0.7
'@types/react-dom': 19.0.3(@types/[email protected])
+ dependencies:
+ '@radix-ui/primitive': 1.1.1
+ '@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-direction': 1.1.0(@types/[email protected])([email protected])
+ '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])
+ '@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])
+ react: 19.0.0
+ react-dom: 19.0.0([email protected])
+ optionalDependencies:
+ '@types/react': 19.0.7
+ '@types/react-dom': 19.0.3(@types/[email protected])
+
dependencies:
'@radix-ui/react-compose-refs': 1.1.1(@types/[email protected])([email protected])