-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathseed.dev.ts
More file actions
184 lines (169 loc) · 5.18 KB
/
seed.dev.ts
File metadata and controls
184 lines (169 loc) · 5.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
import { createId } from "@paralleldrive/cuid2";
import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";
import { PROVIDER_MODELS } from "../lib/models";
import { brands, industries, prompts, providers } from "./schema";
const connectionString = process.env.DATABASE_URL!;
const client = postgres(connectionString);
const db = drizzle(client);
// Sample prompts for developer tools industry (Feb 2026)
const samplePrompts = [
{
name: "Best issue tracker 2026",
content:
"What is the best issue tracking tool for a software engineering team in 2026?",
},
{
name: "Code hosting options",
content:
"What are the best code hosting and repository management platforms available in 2026?",
},
{
name: "Modern Jira alternatives",
content:
"What's the best modern alternative to Jira for agile project management in 2026?",
},
{
name: "Documentation tools",
content:
"What tools do engineering teams currently use for internal documentation and knowledge bases?",
},
{
name: "Git hosting for startups",
content:
"Which git hosting platform should a startup choose this year?",
},
{
name: "Latest project management",
content:
"What are the latest and most popular project management tools for software teams?",
},
{
name: "Best dev tools 2026",
content:
"What are the must-have developer tools and platforms in 2026?",
},
{
name: "Issue tracking comparison",
content:
"Can you compare the top issue tracking tools available today? Include pricing and features.",
},
{
name: "Startup tooling stack",
content:
"What's the recommended tooling stack for a new startup's engineering team right now?",
},
{
name: "Code hosting trends",
content:
"What are the current trends in code hosting and version control platforms?",
},
];
async function seed() {
console.log("🌱 Seeding database (dev mode - configuration only)...");
// Seed providers from shared model definitions
for (const [name, models] of Object.entries(PROVIDER_MODELS)) {
for (const model of models) {
await db
.insert(providers)
.values({ id: createId(), name, model })
.onConflictDoNothing({ target: providers.model });
}
}
console.log("✅ Providers seeded");
// Fetch actual providers from DB
const allProviders = await db.select().from(providers);
console.log(` Found ${allProviders.length} providers`);
// Seed industry
const industryId = createId();
await db
.insert(industries)
.values({
id: industryId,
name: "Developer Tools",
description: "Tools and platforms for software development workflows",
})
.onConflictDoNothing({ target: industries.name });
console.log("✅ Industry seeded");
// Fetch actual industry
const [industry] = await db.select().from(industries).limit(1);
const actualIndustryId = industry?.id || industryId;
// Seed brands
const brandData = [
{
name: "SprintHub",
aliases: ["sprinthub.io", "SprintHub.io"],
domains: ["sprinthub.io"],
isOwnBrand: true,
},
{
name: "GitHub",
aliases: ["github.com", "GitHub.com"],
domains: ["github.com", "docs.github.com"],
isOwnBrand: false,
},
{
name: "GitLab",
aliases: ["gitlab.com", "GitLab.com"],
domains: ["gitlab.com", "docs.gitlab.com"],
isOwnBrand: false,
},
{
name: "Linear",
aliases: ["linear.app", "Linear.app"],
domains: ["linear.app"],
isOwnBrand: false,
},
{
name: "Jira",
aliases: ["jira.atlassian.com", "Jira"],
domains: ["atlassian.com/software/jira", "jira.atlassian.com"],
isOwnBrand: false,
},
{
name: "Notion",
aliases: ["notion.so", "Notion.so"],
domains: ["notion.so"],
isOwnBrand: false,
},
{
name: "Bitbucket",
aliases: ["bitbucket.org", "Bitbucket.org"],
domains: ["bitbucket.org"],
isOwnBrand: false,
},
];
// Check existing brands first to avoid duplicates
const existingBrands = await db.select().from(brands);
const existingBrandNames = new Set(existingBrands.map((b) => b.name));
for (const brand of brandData) {
if (!existingBrandNames.has(brand.name)) {
await db
.insert(brands)
.values({ id: createId(), ...brand, industryId: actualIndustryId });
}
}
console.log("✅ Brands seeded");
// Fetch actual brands
const allBrands = await db.select().from(brands);
console.log(` Found ${allBrands.length} brands`);
// Seed prompts
for (const prompt of samplePrompts) {
await db
.insert(prompts)
.values({ id: createId(), ...prompt, industryId: actualIndustryId })
.onConflictDoNothing();
}
console.log("✅ Prompts seeded");
// Fetch actual prompts
const allPrompts = await db.select().from(prompts);
console.log(` Found ${allPrompts.length} prompts`);
console.log("🎉 Seeding complete!");
console.log("");
console.log("ℹ️ Run the workflows to generate real LLM responses and analyses.");
process.exit(0);
}
seed().catch((err) => {
console.error("❌ Seeding failed:", err);
process.exit(1);
});