diff --git a/CLAUDE.md b/CLAUDE.md index c741c9b..318b308 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -52,6 +52,7 @@ src/app/ ``` ### Database (Prisma + PostgreSQL) +- **Provider**: Neon (serverless PostgreSQL) - **Schema**: `prisma/schema.prisma` defines models: `Project`, `Tag`, `ExternalLink`, `ProjectTag` - **Enums**: `ProjectStatus` (ACTIVE/ARCHIVED), `LinkType` (WEBSITE/GITHUB/HUGGINGFACE/PAPER) - **Client singleton**: `src/lib/prisma.ts` exports Prisma client instance @@ -64,6 +65,13 @@ src/app/ - `ExternalLink`: `@@unique([projectId, url])` (each project can't have duplicate URLs) - **Indexes**: `idx_project_status_createdAt`, `idx_project_slug`, `idx_tag_slug`, `idx_link_projectId`, `idx_link_type`, `idx_link_type_url` (composite for efficient URL-based deduplication) +#### Neon Database Setup +- **Dashboard**: https://console.neon.tech +- **Connection String Format**: `postgres://[user]:[password]@[host]/[database]?sslmode=require` +- **Vercel Integration**: Set `DATABASE_URL` environment variable in Vercel Dashboard (do NOT use `vercel.json` env references) +- **Free Tier**: 0.5GB storage, 300 hours compute/month +- **Run Migrations**: After deployment, run `pnpm prisma db push` or use Neon's SQL Editor to create tables + ### Webhook Deduplication Strategy The webhook at `src/app/api/webhook/projects/route.ts` implements a **multi-level deduplication** strategy to prevent duplicate projects: 1. **GitHub URL exact match** (highest priority) - via `ExternalLink` table using `idx_link_type_url` index diff --git a/vercel.json b/vercel.json index 90c83b5..d591be0 100644 --- a/vercel.json +++ b/vercel.json @@ -2,8 +2,5 @@ "buildCommand": "pnpm prisma generate && pnpm build", "installCommand": "pnpm install", "framework": "nextjs", - "regions": ["sin1"], - "env": { - "DATABASE_URL": "@database_url" - } + "regions": ["sin1"] }