Add Democratic fundraising platform.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
root
2026-05-16 00:47:44 +00:00
parent 89f9b8dc83
commit 391d90a754
141 changed files with 14989 additions and 914 deletions

View File

@@ -1,7 +1,7 @@
import "dotenv/config";
import bcrypt from "bcryptjs";
import { PrismaPg } from "@prisma/adapter-pg";
import { PrismaClient } from "@prisma/client";
import { DemocraticInitiativeOrigin, PrismaClient } from "@prisma/client";
import { Pool } from "pg";
const connectionString = process.env.DATABASE_URL;
@@ -20,9 +20,15 @@ async function main() {
const user = await prisma.user.upsert({
where: { email },
update: { passwordHash: hash, name: "Demo Supporter", role: "USER" },
update: {
passwordHash: hash,
name: "Demo Supporter",
role: "USER",
username: "portal_demo",
},
create: {
email,
username: "portal_demo",
name: "Demo Supporter",
passwordHash: hash,
role: "USER",
@@ -44,9 +50,11 @@ async function main() {
passwordHash: adminHash,
name: "Dr Jones",
role: "ADMIN",
username: "portal_admin",
},
create: {
email: adminEmail,
username: "portal_admin",
name: "Dr Jones",
passwordHash: adminHash,
role: "ADMIN",
@@ -95,6 +103,65 @@ async function main() {
},
});
const officialPriorities: Array<{ slug: string; sortOrder: number; title: string; description: string }> = [
{
slug: "priority-voting-access",
sortOrder: 0,
title: "Voting access & fair elections",
description:
"Protect early voting, drop boxes where allowed, and nonpartisan election administration — signal BWT here if this is the lane you want organizers and messaging to emphasize first.",
},
{
slug: "priority-climate-jobs",
sortOrder: 1,
title: "Climate jobs & clean infrastructure",
description:
"Invest in union-scale clean energy, grid resilience, and communities transitioning off volatile fossil cycles — pledge BWT to raise the salience of green industrial policy in the program.",
},
{
slug: "priority-health-affordability",
sortOrder: 2,
title: "Healthcare affordability",
description:
"Expand coverage choices, cap out-of-pocket shocks for families, and defend access to care — use BWT totals here to show democratic demand for health-centered field work.",
},
{
slug: "priority-workers-rights",
sortOrder: 3,
title: "Workers rights & wages",
description:
"Stand with organizing, overtime fairness, and safety nets that reward work — pledges aggregate as a live scoreboard for how loud supporters want labor-forward priorities.",
},
{
slug: "priority-community-safety",
sortOrder: 4,
title: "Community safety & prevention",
description:
"Fund violence interruption, mental health first responders, and common-sense safety policy without scapegoating — BWT here steers narrative and volunteer energy toward prevention-first democracy.",
},
];
for (const p of officialPriorities) {
await prisma.democraticInitiative.upsert({
where: { slug: p.slug },
update: {
title: p.title,
description: p.description,
origin: DemocraticInitiativeOrigin.PLATFORM,
sortOrder: p.sortOrder,
creatorId: null,
},
create: {
slug: p.slug,
title: p.title,
description: p.description,
origin: DemocraticInitiativeOrigin.PLATFORM,
sortOrder: p.sortOrder,
creatorId: null,
},
});
}
// eslint-disable-next-line no-console
console.log("Seed OK — demo:", email, "/", password);
// eslint-disable-next-line no-console