b307919bf7
Replace the single JSX file with a Next.js project, shared catalog and recommendation modules, backend API routes, file-backed persistence, Ollama recommendation endpoint, and picture-layer bike composition. Add initial aligned component assets for existing BSU layers plus RockShox and Maxxis products.
25 lines
985 B
TypeScript
25 lines
985 B
TypeScript
import { PrismaClient } from "@prisma/client";
|
|
import { frames, forks, shocks, tires } from "../src/lib/catalog";
|
|
|
|
const prisma = new PrismaClient();
|
|
|
|
async function main() {
|
|
const products = [...frames, ...forks, ...shocks, ...tires];
|
|
for (const product of products) {
|
|
const { id, category, brand, model, imagePath, sources } = product;
|
|
const position = "position" in product ? product.position : null;
|
|
await prisma.product.upsert({
|
|
where: { id },
|
|
update: { category, position, brand, model, imagePath, specs: JSON.stringify(product), setup: JSON.stringify(product), sources: JSON.stringify(sources) },
|
|
create: { id, category, position, brand, model, imagePath, specs: JSON.stringify(product), setup: JSON.stringify(product), sources: JSON.stringify(sources) },
|
|
});
|
|
}
|
|
await prisma.riderPreference.upsert({
|
|
where: { id: "default" },
|
|
update: {},
|
|
create: { id: "default" },
|
|
});
|
|
}
|
|
|
|
main().finally(async () => prisma.$disconnect());
|