## Search & Retrieval - Improved search ranking with scoring (title match, favorites, recency) - Highlight matches with excerpt extraction - Fuzzy search with string-similarity - Unified noteQuery function ## Quick Capture - Quick Add API (POST /api/notes/quick) with type prefixes - Quick add parser with tag extraction - Global Quick Add UI (Ctrl+N shortcut) - Tag autocomplete in forms ## Note Relations - Automatic backlinks with sync on create/update/delete - Backlinks API (GET /api/notes/[id]/backlinks) - Related notes with scoring and reasons ## Guided Forms - Type-specific form fields (command, snippet, decision, recipe, procedure, inventory) - Serialization to/from markdown - Tag suggestions based on content (GET /api/tags/suggest) ## UX by Type - Command: Copy button for code blocks - Snippet: Syntax highlighting with react-syntax-highlighter - Procedure: Interactive checkboxes ## Quality - Standardized error handling across all APIs - Integration tests (28 tests passing) - Unit tests for search, tags, quick-add Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
49 lines
1.3 KiB
Plaintext
49 lines
1.3 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlite"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Note {
|
|
id String @id @default(cuid())
|
|
title String
|
|
content String
|
|
type String @default("note")
|
|
isFavorite Boolean @default(false)
|
|
isPinned Boolean @default(false)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
tags NoteTag[]
|
|
backlinks Backlink[] @relation("BacklinkTarget")
|
|
outbound Backlink[] @relation("BacklinkSource")
|
|
}
|
|
|
|
model Tag {
|
|
id String @id @default(cuid())
|
|
name String @unique
|
|
notes NoteTag[]
|
|
}
|
|
|
|
model NoteTag {
|
|
noteId String
|
|
tagId String
|
|
note Note @relation(fields: [noteId], references: [id], onDelete: Cascade)
|
|
tag Tag @relation(fields: [tagId], references: [id], onDelete: Cascade)
|
|
|
|
@@id([noteId, tagId])
|
|
}
|
|
|
|
model Backlink {
|
|
id String @id @default(cuid())
|
|
sourceNoteId String
|
|
targetNoteId String
|
|
sourceNote Note @relation("BacklinkSource", fields: [sourceNoteId], references: [id], onDelete: Cascade)
|
|
targetNote Note @relation("BacklinkTarget", fields: [targetNoteId], references: [id], onDelete: Cascade)
|
|
createdAt DateTime @default(now())
|
|
|
|
@@unique([sourceNoteId, targetNoteId])
|
|
}
|