Refactor backend to use generic Category and Data models#63
Conversation
- Introduced `Category` and `Data` models in Prisma schema to replace hardcoded `Equipment`, `Pose`, and `Expression` tables. - Implemented `CategoryService` and `DataService` with CRUD APIs. - Updated `ExtractionService` to support dynamic categories and Handlebars templating for prompts. - Refactored migration system to use file-based migration scripts. - Added `001_migrateGenericCategory.ts` to create categories and migrate existing data. - Added `002_seedExampleData.ts` to seed example data into the new `Data` table for fresh installs. - Updated `Extraction` API to use the new generic service flow. - Added `handlebars` dependency for prompt templating. - Deprecated existing `Equipment`, `Pose`, and `Expression` tables but kept schema for migration. - Drafted frontend refactor plan in `frontend_refactor_plan.md`.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Introduced `Category` and `Data` models in Prisma schema to replace hardcoded `Equipment`, `Pose`, and `Expression` tables. - Implemented `CategoryService` and `DataService` with CRUD APIs. - Updated `ExtractionService` to support dynamic categories and Handlebars templating for prompts. - Refactored migration system to use file-based migration scripts in `src/service/migrations/`. - Added `001_migrateGenericCategory.ts` to create categories and migrate existing data. - Added `002_seedExampleData.ts` to seed example data into the new `Data` table for fresh installs. - Updated `Extraction` API to use the new generic service flow. - Added `handlebars` dependency for prompt templating. - Deprecated existing `Equipment`, `Pose`, and `Expression` tables but kept schema for migration compatibility. - Improved Zod schema validation for strict nesting in `imagePrompt`. - Drafted frontend refactor plan in `frontend_refactor_plan.md`.
- Introduced `Category` and `Data` models in Prisma schema to replace hardcoded `Equipment`, `Pose`, and `Expression` tables. - Implemented `CategoryService` and `DataService` with CRUD APIs. - Updated `ExtractionService` to support dynamic categories and Handlebars templating for prompts. - Refactored migration system to use file-based migration scripts in `src/service/migrations/`. - Added `001_migrateGenericCategory.ts` to create categories and migrate existing data. - Added `002_seedExampleData.ts` to seed example data into the new `Data` table for fresh installs. - Updated `Extraction` API to use the new generic service flow. - Added `handlebars` dependency for prompt templating. - Deprecated existing `Equipment`, `Pose`, and `Expression` tables but kept schema for migration compatibility. - Improved Zod schema validation for strict nesting in `imagePrompt`.
This PR refactors the backend to support a generic Category/Data model, allowing users to define custom categories and fields. It includes:
CategoryandDatamodels usingJsontype for schema flexibility. Deprecated old tables.001_migrateGenericCategory.tscreates generic categories and migrates existing data.002_seedExampleData.tsseeds example data into the newDatatable for fresh installs.ExtractionServicenow dynamically builds prompts based on enabled categories and uses Handlebars for image generation templates.PR created automatically by Jules for task 420670188649445425 started by @Yiling-J