This commit is contained in:
2025-08-22 14:11:18 -05:00
commit 3e9ca1a146
88 changed files with 14387 additions and 0 deletions

27
api/prisma/schema.prisma Normal file
View File

@@ -0,0 +1,27 @@
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "linux-musl-openssl-3.0.x"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model Listing {
id String @id @default(cuid())
title String
slug String @unique
image String?
summary String
createdAt DateTime @default(now())
}
model Testimonial {
id String @id @default(cuid())
name String
area String
text String
rating Int @default(5)
createdAt DateTime @default(now())
}

48
api/prisma/seed.ts Normal file
View File

@@ -0,0 +1,48 @@
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
async function main() {
await prisma.listing.upsert({
where: { slug: 'retail-lighting-retrofit-south-side' },
update: {},
create: {
title: 'Retail Lighting Retrofit — South Side',
slug: 'retail-lighting-retrofit-south-side',
image: '/images/project-1.jpg',
summary: 'LED conversion for 5,000 sq ft retail space; 35% energy savings.'
}
});
await prisma.listing.upsert({
where: { slug: 'panel-upgrade-ocean-drive' },
update: {},
create: {
title: 'Residential Panel Upgrade — Ocean Drive',
slug: 'panel-upgrade-ocean-drive',
image: '/images/project-2.jpg',
summary: '100A → 200A service upgrade with AFCI breakers and EV-ready outlet.'
}
});
await prisma.listing.upsert({
where: { slug: 'office-buildout-downtown' },
update: {},
create: {
title: 'Office Build-Out — Downtown',
slug: 'office-buildout-downtown',
image: '/images/project-3.jpg',
summary: 'Complete tenant build-out: power distribution, LED lighting, data wiring.'
}
});
await prisma.testimonial.createMany({
data: [
{ name: 'Maria S.', area: 'Ocean Drive', text: 'Panel upgrade done fast. No more tripping breakers!', rating: 5 },
{ name: 'David R.', area: 'Downtown', text: 'Office build-out finished on time. Great team.', rating: 5 },
{ name: 'Jennifer L.', area: 'Flour Bluff', text: 'Emergency repair on Sunday. Reliable service.', rating: 5 }
],
skipDuplicates: true
});
console.log('Seed complete');
}
main().finally(() => prisma.$disconnect());