- Turborepo monorepo structure (packages: api, db, types, jobs; services: darkwatch) - Prisma schema: User, WatchListItem, Exposure, Alert, ScanJob models - WatchListService: CRUD with normalization, dedup, tier-based limits - HIBPService: API integration with severity scoring - MatchingEngine: exact-match with content hash dedup - AlertPipeline: dedup window, email notifications - ScanService: orchestrates watch list -> HIBP -> match -> alert flow - BullMQ job workers for scan and alert processing - Fastify API routes: watchlist, exposures, alerts, scan - Docker Compose: PostgreSQL 16 + Redis 7 - 15 unit tests passing - Implementation plan document uploaded
25 lines
460 B
TypeScript
25 lines
460 B
TypeScript
import prisma from "../src";
|
|
|
|
async function main() {
|
|
const user = await prisma.user.upsert({
|
|
where: { email: "dev@shieldai.local" },
|
|
update: {},
|
|
create: {
|
|
email: "dev@shieldai.local",
|
|
name: "Dev User",
|
|
subscriptionTier: "PREMIUM",
|
|
},
|
|
});
|
|
|
|
console.log("Seeded user:", user.email);
|
|
}
|
|
|
|
main()
|
|
.catch((e) => {
|
|
console.error(e);
|
|
process.exit(1);
|
|
})
|
|
.finally(async () => {
|
|
await prisma.$disconnect();
|
|
});
|