- Add database indexes for frequently queried fields (listId, completed, priority, dueDate, createdAt) - Add compound indexes for common query patterns (listId+completed, listId+priority) - Implement pagination support in getItemsByFilter with configurable page size (default 50) - Optimize components with React.memo (ItemCard, ListCard, FilterPanel, SearchBar, SearchResults, EmptyState) - Configure Next.js for better bundle optimization: - Enable optimizePackageImports for lucide-react - Enable SWC minification - Remove console logs in production (except errors/warnings) - Optimize images with AVIF/WebP formats - Enable compression - Disable production source maps for smaller bundles - Loading states already implemented to prevent layout shift Task 18 complete - all performance optimizations implemented
41 lines
992 B
Plaintext
41 lines
992 B
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "mysql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model List {
|
|
id String @id @default(cuid())
|
|
title String
|
|
color String @default("#3B82F6")
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
items Item[]
|
|
}
|
|
|
|
model Item {
|
|
id String @id @default(cuid())
|
|
title String
|
|
description String?
|
|
completed Boolean @default(false)
|
|
priority String @default("medium") // low, medium, high
|
|
dueDate DateTime?
|
|
tags Json @default("[]")
|
|
notes String? @db.Text
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
listId String
|
|
list List @relation(fields: [listId], references: [id], onDelete: Cascade)
|
|
|
|
@@index([listId])
|
|
@@index([completed])
|
|
@@index([priority])
|
|
@@index([dueDate])
|
|
@@index([createdAt])
|
|
@@index([listId, completed])
|
|
@@index([listId, priority])
|
|
}
|