diff --git a/docs/database-schema-message.md b/docs/database-schema-message.md new file mode 100644 index 00000000..0fa12231 --- /dev/null +++ b/docs/database-schema-message.md @@ -0,0 +1,37 @@ +# Message Database Schema Relations + +This document outlines the database schema relations for the `messages` table within IntelliCircle, as defined in `packages/shared/src/schema.ts`. + +## The `messages` Table +The `messages` table stores the core chat content for the application. + +### Columns +- `id`: Serial Primary Key +- `roomId`: Integer (Foreign Key to `chatRooms.id`) +- `userId`: Integer (Foreign Key to `users.id`) +- `content`: Text (Not Null) +- `createdAt`: Timestamp (Defaults to now) + +### Relationships +1. **Belongs to a Room:** + Each message is tied to exactly one chat room via `roomId`. +2. **Belongs to a User:** + Each message is authored by exactly one user via `userId`. + +### Indexes +- `roomHistoryIdx`: A composite index on `(roomId, createdAt)` exists to optimize the fetching of room message history in chronological order. + +### Drizzle ORM Definition +```typescript +export const messages = pgTable("messages", { + id: serial("id").primaryKey(), + roomId: integer("room_id").notNull(), + userId: integer("user_id").notNull(), + content: text("content").notNull(), + createdAt: timestamp("created_at").notNull().defaultNow(), +}, (table) => { + return { + roomHistoryIdx: index("message_room_created_idx").on(table.roomId, table.createdAt), + }; +}); +``` diff --git a/packages/client/src/app/(app)/dashboard/loading.tsx b/packages/client/src/app/(app)/dashboard/loading.tsx new file mode 100644 index 00000000..b9ec963d --- /dev/null +++ b/packages/client/src/app/(app)/dashboard/loading.tsx @@ -0,0 +1,82 @@ +import { Activity, Compass, MessageSquare, Target } from "lucide-react"; + +export default function DashboardLoading() { + return ( +
+
+ {/* Header Section Skeleton */} +
+
+
+
+ + {/* Main Dashboard Grid Skeleton */} +
+ + {/* Left Column Skeleton */} +
+ {/* Action Cards Skeleton */} +
+
+ +
+
+
+
+
+ +
+
+
+
+
+ + {/* Recent Activity/Feed Section Skeleton */} +
+
+
+ +
+
+
+
+
+
+
+ + {/* Right Column Skeleton */} +
+ {/* Mini Profile Card Skeleton */} +
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+ + {/* Suggestions Block Skeleton */} +
+
+ +
+
+
+
+
+
+
+
+
+
+
+ ); +} diff --git a/packages/shared/src/schema.ts b/packages/shared/src/schema.ts index 097042a3..09e734aa 100644 --- a/packages/shared/src/schema.ts +++ b/packages/shared/src/schema.ts @@ -96,7 +96,7 @@ export const participants = pgTable( // Waitlist Schemas export const insertWaitlistSchema = z.object({ - email: z.string().email(), + email: z.string().email().trim().toLowerCase(), name: z.string().optional(), profession: z.string().optional() }); @@ -113,7 +113,7 @@ export const anonymousAuthSchema = z.object({ }); export const upgradeAuthSchema = z.object({ - email: z.string().email(), + email: z.string().email().trim().toLowerCase(), password: z.string() .min(8, "Password must be at least 8 characters long") .regex(/[A-Z]/, "Password must contain at least one uppercase letter")