You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Epic: #1155 Story Points: 5 Priority: High Dependencies: none (foundation for this epic)
User Story
As a veteran building my portfolio I want my projects stored on my account So that I can manage them once and surface them anywhere on the platform
Acceptance Criteria
Add a Project model to prisma/schema.prisma with a one-to-many relation from User (fields: id, userId, title, summary, repoUrl, liveUrl, techTags as a JSON string matching the existing User.skills pattern, imageUrl, order, createdAt, updatedAt)
Generate a migration (npx prisma migrate dev --name add_project_model)
CRUD API under src/pages/api/user/projects/: GET (list own), POST (create), PATCH /[id], DELETE /[id]
All routes wrapped with requireAuth from @/lib/rbac; ownership enforced (a user can only mutate their own projects)
Input validation (title required; URL fields validated; tag count/length capped)
@swagger JSDoc block on each route so it shows in /api-docs
Technical Notes
Use the Prisma singleton import prisma from "@/lib/prisma" — never new PrismaClient() per file
Store techTags as a JSON string to match User.skills rather than a join table
Mirror the src/lib/project.ts static-project shape where practical so the showcase can reuse types
Definition of Done
Migration runs clean; npm run typecheck, npm run lint, npm test, npm run build pass
Epic: #1155
Story Points: 5
Priority: High
Dependencies: none (foundation for this epic)
User Story
As a veteran building my portfolio
I want my projects stored on my account
So that I can manage them once and surface them anywhere on the platform
Acceptance Criteria
Projectmodel toprisma/schema.prismawith a one-to-many relation fromUser(fields:id,userId,title,summary,repoUrl,liveUrl,techTagsas a JSON string matching the existingUser.skillspattern,imageUrl,order,createdAt,updatedAt)npx prisma migrate dev --name add_project_model)src/pages/api/user/projects/:GET(list own),POST(create),PATCH /[id],DELETE /[id]requireAuthfrom@/lib/rbac; ownership enforced (a user can only mutate their own projects)@swaggerJSDoc block on each route so it shows in/api-docsTechnical Notes
import prisma from "@/lib/prisma"— nevernew PrismaClient()per filetechTagsas a JSON string to matchUser.skillsrather than a join tablesrc/lib/project.tsstatic-project shape where practical so the showcase can reuse typesDefinition of Done
npm run typecheck,npm run lint,npm test,npm run buildpass