## 🎨 UI/UX Fixes ### Fixed React Hydration Errors - ActivityFeed: Standardized button styling (gradient → solid) - ActivityFeed: Unified icon sizes and spacing for SSR/CSR consistency - ActivityFeed: Added timestamps to chat messages for stable React keys - About: Fixed duplicate keys in tech stack items (added unique key combinations) - Projects: Fixed duplicate keys in project tags (combined projectId + tag + index) ### Fixed Layout Issues - Added spacer after Header component (h-24 md:h-32) to prevent navbar overlap - Hero section now properly visible below fixed navbar ## 🔧 Backend Improvements ### Database Schema - Added ActivityStatus model for real-time activity tracking - Supports: coding activity, music playing, watching, gaming, status/mood - Single-row design (id=1) with auto-updating timestamps ### API Enhancements - Fixed n8n status endpoint to handle missing table gracefully - Added TypeScript interfaces (removed ESLint `any` warnings) - New API: POST /api/n8n/generate-image for AI image generation - New API: GET /api/n8n/generate-image?projectId=X for status check ## 🔐 Security & Auth ### Middleware Updates - Removed premature auth redirect for /manage and /editor routes - Pages now handle their own authentication (show login forms) - Security headers still applied to all routes ## 🤖 New Feature: AI Image Generation System ### Complete automated project cover image generation using local Stable Diffusion **Core Components:** - Admin UI component (AIImageGenerator.tsx) with preview, generate, and regenerate - n8n workflow integration for automation - Context-aware prompt generation based on project metadata - Support for 10+ project categories with optimized prompts **Documentation (6 new files):** - README.md - System overview and features - SETUP.md - Detailed installation guide (486 lines) - QUICKSTART.md - 15-minute quick start - PROMPT_TEMPLATES.md - Category-specific templates (612 lines) - ENVIRONMENT.md - Environment variables reference - n8n-workflow-ai-image-generator.json - Ready-to-import workflow **Database Migration:** - SQL script: create_activity_status.sql - Auto-setup script: quick-fix.sh - Migration guide: prisma/migrations/README.md **Key Features:** ✅ Automatic generation on project creation ✅ Manual regeneration via admin UI ✅ Category-specific prompts (web, mobile, devops, ai, game, etc.) ✅ Local Stable Diffusion (no API costs, privacy-first) ✅ n8n workflow orchestration ✅ Optimized for web (1024x768) ## 📝 Documentation - CHANGELOG_DEV.md - Complete changelog with migration guide - PRE_PUSH_CHECKLIST.md - Pre-push verification checklist - Comprehensive AI image generation docs ## 🐛 Bug Fixes 1. Fixed "Hydration failed" errors in ActivityFeed 2. Fixed "two children with same key" warnings 3. Fixed navbar overlapping hero section 4. Fixed "relation activity_status does not exist" errors 5. Fixed /manage redirect loop (was going to home page) 6. Fixed TypeScript ESLint errors and warnings 7. Fixed duplicate transition prop in Hero component ## ⚠️ Breaking Changes None - All changes are backward compatible ## 🔄 Migration Required Database migration needed for new ActivityStatus table: ```bash ./prisma/migrations/quick-fix.sh # OR psql -d portfolio -f prisma/migrations/create_activity_status.sql ``` ## 📦 Files Changed **Modified (7):** - app/page.tsx - app/components/About.tsx - app/components/Projects.tsx - app/components/ActivityFeed.tsx - app/components/Hero.tsx - app/api/n8n/status/route.ts - middleware.ts - prisma/schema.prisma **Created (14):** - app/api/n8n/generate-image/route.ts - app/components/admin/AIImageGenerator.tsx - docs/ai-image-generation/* (6 files) - prisma/migrations/* (3 files) - CHANGELOG_DEV.md - PRE_PUSH_CHECKLIST.md - COMMIT_MESSAGE.txt ## ✅ Testing - [x] Build successful: npm run build - [x] Linting passed: npm run lint (0 errors, 8 warnings) - [x] No hydration errors in console - [x] No duplicate key warnings - [x] /manage accessible (shows login form) - [x] API endpoints responding correctly - [x] Navbar no longer overlaps content ## 🚀 Next Steps 1. Test AI image generation with Stable Diffusion setup 2. Test n8n workflow integration 3. Create demo screenshots for new features 4. Update main README.md after merge --- Co-authored-by: AI Assistant (Claude Sonnet 4.5)
133 lines
4.6 KiB
Plaintext
133 lines
4.6 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Project {
|
|
id Int @id @default(autoincrement())
|
|
title String @db.VarChar(255)
|
|
description String
|
|
content String
|
|
tags String[] @default([])
|
|
featured Boolean @default(false)
|
|
category String @db.VarChar(100)
|
|
date String @db.VarChar(10)
|
|
github String? @db.VarChar(500)
|
|
live String? @db.VarChar(500)
|
|
published Boolean @default(true)
|
|
imageUrl String? @db.VarChar(500)
|
|
metaDescription String?
|
|
keywords String?
|
|
ogImage String? @db.VarChar(500)
|
|
schema Json?
|
|
difficulty Difficulty @default(INTERMEDIATE)
|
|
timeToComplete String? @db.VarChar(100)
|
|
technologies String[] @default([])
|
|
challenges String[] @default([])
|
|
lessonsLearned String[] @default([])
|
|
futureImprovements String[] @default([])
|
|
demoVideo String? @db.VarChar(500)
|
|
screenshots String[] @default([])
|
|
colorScheme String @default("Dark") @db.VarChar(100)
|
|
accessibility Boolean @default(true)
|
|
performance Json @default("{\"loadTime\": \"1.5s\", \"bundleSize\": \"50KB\", \"lighthouse\": 90}")
|
|
analytics Json @default("{\"likes\": 0, \"views\": 0, \"shares\": 0}")
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
@@index([category])
|
|
@@index([featured])
|
|
@@index([published])
|
|
@@index([difficulty])
|
|
@@index([createdAt])
|
|
@@index([tags])
|
|
}
|
|
|
|
model PageView {
|
|
id Int @id @default(autoincrement())
|
|
projectId Int? @map("project_id")
|
|
page String @db.VarChar(100)
|
|
ip String? @db.VarChar(45)
|
|
userAgent String? @map("user_agent")
|
|
referrer String? @db.VarChar(500)
|
|
timestamp DateTime @default(now())
|
|
|
|
@@index([projectId])
|
|
@@index([timestamp])
|
|
@@index([page])
|
|
}
|
|
|
|
model UserInteraction {
|
|
id Int @id @default(autoincrement())
|
|
projectId Int @map("project_id")
|
|
type InteractionType
|
|
ip String? @db.VarChar(45)
|
|
userAgent String? @map("user_agent")
|
|
timestamp DateTime @default(now())
|
|
|
|
@@index([projectId])
|
|
@@index([type])
|
|
@@index([timestamp])
|
|
}
|
|
|
|
model Contact {
|
|
id Int @id @default(autoincrement())
|
|
name String @db.VarChar(255)
|
|
email String @db.VarChar(255)
|
|
subject String @db.VarChar(500)
|
|
message String
|
|
responded Boolean @default(false)
|
|
responseTemplate String? @map("response_template") @db.VarChar(50)
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
@@index([email])
|
|
@@index([responded])
|
|
@@index([createdAt])
|
|
}
|
|
|
|
enum Difficulty {
|
|
BEGINNER
|
|
INTERMEDIATE
|
|
ADVANCED
|
|
EXPERT
|
|
}
|
|
|
|
enum InteractionType {
|
|
LIKE
|
|
SHARE
|
|
BOOKMARK
|
|
COMMENT
|
|
}
|
|
|
|
model ActivityStatus {
|
|
id Int @id @default(1)
|
|
activityType String? @map("activity_type") @db.VarChar(50)
|
|
activityDetails String? @map("activity_details") @db.VarChar(255)
|
|
activityProject String? @map("activity_project") @db.VarChar(255)
|
|
activityLanguage String? @map("activity_language") @db.VarChar(50)
|
|
activityRepo String? @map("activity_repo") @db.VarChar(500)
|
|
musicPlaying Boolean @default(false) @map("music_playing")
|
|
musicTrack String? @map("music_track") @db.VarChar(255)
|
|
musicArtist String? @map("music_artist") @db.VarChar(255)
|
|
musicAlbum String? @map("music_album") @db.VarChar(255)
|
|
musicPlatform String? @map("music_platform") @db.VarChar(50)
|
|
musicProgress Int? @map("music_progress")
|
|
musicAlbumArt String? @map("music_album_art") @db.VarChar(500)
|
|
watchingTitle String? @map("watching_title") @db.VarChar(255)
|
|
watchingPlatform String? @map("watching_platform") @db.VarChar(50)
|
|
watchingType String? @map("watching_type") @db.VarChar(50)
|
|
gamingGame String? @map("gaming_game") @db.VarChar(255)
|
|
gamingPlatform String? @map("gaming_platform") @db.VarChar(50)
|
|
gamingStatus String? @map("gaming_status") @db.VarChar(50)
|
|
statusMood String? @map("status_mood") @db.VarChar(50)
|
|
statusMessage String? @map("status_message") @db.VarChar(500)
|
|
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
|
|
|
|
@@map("activity_status")
|
|
}
|