This is a Next.js project designed as a web application for cross-border e-commerce product image generation and management.
- Step 1: Project Initialization - ✅ Completed
- Initialized Next.js with TypeScript, Tailwind CSS, ESLint, App Router, and React Compiler.
- Added tooling: Prettier,
next-themes,zod,lucide-react. - Configured project environment (
.prettierrc,.eslintrc.json,.gitignore,.env.local).
- Step 2: Prisma + Database Schema - ✅ Completed
- Setup Prisma with SQLite locally.
- Implemented the database schema representing product requirements (
Task,TaskImage,CopyResult,ModelConfig,PromptTemplate). - Added the dev-safe Prisma client singleton (
src/lib/db.ts). - Synced database tables (
pnpm db:push). - Created initial database seeding script (
prisma/seed.ts).
Based on the original structural design, here is the execution plan:
- Initialize Next.js in the existing directory and add tooling.
- Add prettier, eslint-config-prettier, tsx, next-themes, zod, lucide-react.
- Create project config files and verify development server starts.
- Add prisma and @prisma/client, initialize with
sqlite. - Create
prisma/schema.prismamapping out tasks, images, generated copies, and system settings. - Create
src/lib/db.tsto prevent hot-reload connection leaks. - Create
prisma/seed.tsand set up standard database npm scripts.
- Create
src/types/with strict domain types (TypeScript) shared across client and server:platform.ts,model.ts,template.ts,storage.ts,task.ts
- Create
src/lib/config.tsfor typed app configuration driven byprocess.env. - Create
src/lib/utils.tsfor standard shadcn/tailwind merging and formatting.
- Create
src/lib/storage/establishing theIStorageProviderinterface. - Implement
local.tsfor immediate file system uploads and provide a stubbeds3.ts.
- Initialize
shadcn/uiand add basic UI components (button, card, input, sidebar, dialog, etc.). - Build nested dashboard layouts (
src/app/(dashboard)/layout.tsx) utilizing a sidebar and header. - Flesh out standard scaffolding pages for the application route structure.
- Layer 1: Model Adapter Layer (
src/lib/models) to interface with OpenAI, Anthropic, Gemini. - Layer 2: Capability Abstraction Layer (
src/lib/capabilities) for generic text-to-image and multimodal tasks. - Layer 3: Business Orchestration Layer (
src/lib/orchestration) defining the sequence pipeline.
- Set up scalable Next.js App Router API endpoints supporting Prisma validation.
- Routes: Healthchecks, task dispatching, model configs, templates, and storage uploading.
- Complete full default database insertions via
prisma/seed.tsfor standard item templates (Rugs, Desk mats). - Finalize UI mapping and update primary documentation.
First, ensure dependencies are installed via pnpm:
pnpm installGenerate the Prisma client:
pnpm prisma generateRun the development server:
pnpm devOpen http://localhost:3000 with your browser to see the application.