Archived
MapleBrief: production Canadian news aggregator
Next.js 14 + TypeScript + Tailwind + Prisma/SQLite. - LLM synthesis abstraction (OpenAI/Anthropic/Ollama) + admin settings UI - RSS ingestion pipeline (parser + cheerio content) + node-cron worker - AdSense AdUnit placements (header/in-feed/in-article/sidebar) - Sources analysis attribution, nofollow links, canonical/OG, sitemap/robots - Admin auth (ADMIN_API_KEY, timingSafeEqual, fail-closed 401) - Multi-cell lady-ga-ga marker, sitemap, robots, legal pages - Comprehensive README (setup, LLM config, AdSense, migrations, deploy)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
/* eslint-disable no-console */
|
||||
/**
|
||||
* Seeds the Feed table with the starter Canadian news feeds.
|
||||
*
|
||||
* npm run db:seed
|
||||
* (also auto-invoked by `prisma migrate dev` via the "prisma.seed" hook.)
|
||||
*
|
||||
* Idempotent: existing feeds (matched by URL) are left untouched, new
|
||||
* starter feeds are added. User-added feeds are never modified.
|
||||
*
|
||||
* tsx reads tsconfig.json paths, so the "@/..." aliases resolve.
|
||||
*/
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
import { seedFeedsIfEmpty } from '../src/lib/ingest/seed';
|
||||
|
||||
async function main() {
|
||||
const prisma = new PrismaClient();
|
||||
try {
|
||||
const before = await prisma.feed.count();
|
||||
const { created, total } = await seedFeedsIfEmpty();
|
||||
console.log(`[seed] feeds: ${before} -> ${total} (${created} created)`);
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
main().catch((e) => {
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user