Skip to content

Commit

Permalink
feat: modules (#374)
Browse files Browse the repository at this point in the history
* feat: modules db schema & actions

* feat: trpc modules router

* chore: apply migrations

* feat: initial version of recent modules section

* feat: icon primitive & recent modules collapsing

* feat: module card skeleton

* feat: static variation of module card skeleton

* feat: empty state for recent modules

* chore: cleanup

* feat: initialises auto animated module creation popover

* feat: step 1 module creation form

* chore: updates all deps

* feat: icon & color pickers

* chore: updates deps

* feat: create mutation

* feat: displaying modules when created

* refactor: better modules listing

* chore: updates deps

* refactor: optional description for module

* chore: updates deps

* fix: missing react-popover dep
  • Loading branch information
ixahmedxi committed Sep 1, 2024
1 parent ef43f41 commit 8f91ca2
Show file tree
Hide file tree
Showing 37 changed files with 1,548 additions and 159 deletions.
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ node_modules
next-env.d.ts
.husky
bun.lockb
*.toml
*.toml
drizzle
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ words:
- typecheck
- Uploadthing
- Upstash
- healthcheck
15 changes: 15 additions & 0 deletions drizzle/0001_minor_warlock.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CREATE TABLE IF NOT EXISTS "modules" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"user_id" text NOT NULL,
"name" text NOT NULL,
"description" text NOT NULL,
"code" text NOT NULL,
"icon" text DEFAULT 'default' NOT NULL,
"color" text DEFAULT 'default' NOT NULL,
"archived" boolean DEFAULT false NOT NULL,
"credits" integer DEFAULT 0 NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
"modified_at" timestamp DEFAULT now() NOT NULL,
"last_visited" timestamp DEFAULT now() NOT NULL,
CONSTRAINT "modules_id_unique" UNIQUE("id")
);
1 change: 1 addition & 0 deletions drizzle/0002_complex_sally_floyd.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "modules" ALTER COLUMN "description" DROP NOT NULL;
20 changes: 11 additions & 9 deletions drizzle/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"id": "b304d26a-1927-40c9-9067-57935d6d9ab3",
"prevId": "00000000-0000-0000-0000-000000000000",
"version": "6",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.early_access": {
Expand Down Expand Up @@ -60,17 +58,21 @@
"uniqueConstraints": {
"early_access_email_unique": {
"name": "early_access_email_unique",
"nullsNotDistinct": false,
"columns": ["email"]
"columns": [
"email"
],
"nullsNotDistinct": false
}
}
}
},
"enums": {},
"schemas": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}
"tables": {},
"columns": {}
},
"id": "b304d26a-1927-40c9-9067-57935d6d9ab3",
"prevId": "00000000-0000-0000-0000-000000000000"
}
177 changes: 177 additions & 0 deletions drizzle/meta/0001_snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
{
"id": "e2f7138b-3bc5-4e5c-8e9f-df04364cddcb",
"prevId": "b304d26a-1927-40c9-9067-57935d6d9ab3",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.early_access": {
"name": "early_access",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": true
},
"reason": {
"name": "reason",
"type": "text",
"primaryKey": false,
"notNull": true
},
"approved": {
"name": "approved",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"created_at": {
"name": "created_at",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"invitation_sent_at": {
"name": "invitation_sent_at",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"early_access_email_unique": {
"name": "early_access_email_unique",
"nullsNotDistinct": false,
"columns": [
"email"
]
}
}
},
"public.modules": {
"name": "modules",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": true
},
"code": {
"name": "code",
"type": "text",
"primaryKey": false,
"notNull": true
},
"icon": {
"name": "icon",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'default'"
},
"color": {
"name": "color",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'default'"
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"credits": {
"name": "credits",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"modified_at": {
"name": "modified_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"last_visited": {
"name": "last_visited",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"modules_id_unique": {
"name": "modules_id_unique",
"nullsNotDistinct": false,
"columns": [
"id"
]
}
}
}
},
"enums": {},
"schemas": {},
"sequences": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}
Loading

0 comments on commit 8f91ca2

Please sign in to comment.