Skip to content

Commit d70acd2

Browse files
Copilotshoaibsharif
andcommitted
feat: add in-app notifications with Inngest queue integration
- Add notifications table schema (Drizzle migration 0002) - Add Notification domain model and NotificationType to domain-models.ts - Add notifications to DatabaseTableName enum and persistence repositories - Add optional INNGEST_EVENT_KEY/INNGEST_SIGNING_KEY to env.ts - Create Inngest client + persistNotificationFn in src/lib/inngest.ts - Add Inngest API route at /api/inngest - Create notification input schema and actions (list, markRead, markAllRead, unreadCount) - Update createMyComment to resolve recipient and send notification events - Update toogleReaction insert path to send notification events - Replace notifications dashboard stub with full TanStack Query UI - Add i18n strings to bn.json for notification copy Agent-Logs-Url: https://github.com/techdiary-dev/techdiary.dev/sessions/a4d2f56f-8ea0-484d-883e-4aa0cce5a9cc Co-authored-by: shoaibsharif <29075110+shoaibsharif@users.noreply.github.com>
1 parent 17bc4a5 commit d70acd2

17 files changed

Lines changed: 1913 additions & 26 deletions

File tree

migrations/0002_fearless_tomas.sql

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
CREATE TABLE "gist_files" (
2+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
3+
"gist_id" uuid NOT NULL,
4+
"filename" varchar NOT NULL,
5+
"content" text NOT NULL,
6+
"language" varchar,
7+
"created_at" timestamp DEFAULT now(),
8+
"updated_at" timestamp DEFAULT now()
9+
);
10+
--> statement-breakpoint
11+
CREATE TABLE "gists" (
12+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
13+
"title" varchar NOT NULL,
14+
"description" text,
15+
"is_public" boolean DEFAULT true,
16+
"owner_id" uuid NOT NULL,
17+
"created_at" timestamp DEFAULT now(),
18+
"updated_at" timestamp DEFAULT now()
19+
);
20+
--> statement-breakpoint
21+
CREATE TABLE "notifications" (
22+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
23+
"recipient_id" uuid NOT NULL,
24+
"actor_id" uuid,
25+
"type" varchar(100) NOT NULL,
26+
"payload" jsonb,
27+
"read_at" timestamp,
28+
"created_at" timestamp DEFAULT now() NOT NULL
29+
);
30+
--> statement-breakpoint
31+
ALTER TABLE "gist_files" ADD CONSTRAINT "gist_files_gist_id_gists_id_fk" FOREIGN KEY ("gist_id") REFERENCES "public"."gists"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
32+
ALTER TABLE "gists" ADD CONSTRAINT "gists_owner_id_users_id_fk" FOREIGN KEY ("owner_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
33+
ALTER TABLE "notifications" ADD CONSTRAINT "notifications_recipient_id_users_id_fk" FOREIGN KEY ("recipient_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
34+
ALTER TABLE "notifications" ADD CONSTRAINT "notifications_actor_id_users_id_fk" FOREIGN KEY ("actor_id") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE no action;

0 commit comments

Comments
 (0)