feat: auth system, scrip scheduler, UI widgets, and new API routes

- Add session-based authentication (login page, middleware, auth context)
- Add cron-like scrip scheduler for time-based conditions
- Add layout builder, scrip wizard, searchable select components
- Add trend chart widget for dashboards
- Add notifications, attachments, queue-permissions API routes
- Add seed-users script
- Update schema with 10 new migrations (0008-0017)
- Apply redesign: Linear-inspired dark theme, conversation-centric UI
- Gitignore runtime data directory

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Gjermund Høsøien Wiggen
2026-06-15 20:42:17 +02:00
parent 1d4dc38d06
commit 70f0924d4b
59 changed files with 21795 additions and 321 deletions

28
scripts/seed-users.ts Normal file
View File

@@ -0,0 +1,28 @@
import { drizzle } from 'drizzle-orm/node-postgres';
import { Pool } from 'pg';
import { users } from '../src/db/schema.ts';
const pool = new Pool({ connectionString: process.env.DATABASE_URL! });
const db = drizzle(pool);
const BATCH = 100;
const TOTAL = 1000;
const password = await Bun.password.hash('password');
console.log(`Inserting ${TOTAL} users...`);
for (let i = 0; i < TOTAL; i += BATCH) {
const batch = [];
for (let j = i; j < Math.min(i + BATCH, TOTAL); j++) {
const n = String(j).padStart(4, '0');
batch.push({
username: `user${n}`,
email: `user${n}@test.local`,
role: 'staff',
password_hash: password,
});
}
await db.insert(users).values(batch as any).onConflictDoNothing();
process.stdout.write('.');
}
console.log(`\nDone. ${TOTAL} users seeded.`);
await pool.end();