feat: database and initial better auth install

This commit is contained in:
2026-04-03 21:00:26 +02:00
parent e46c19c587
commit bcb7f5ce9b
12 changed files with 303 additions and 9 deletions

18
drizzle.config.ts Normal file
View File

@@ -0,0 +1,18 @@
import { defineConfig } from 'drizzle-kit';
if (!process.env.CLOUDFLARE_ACCOUNT_ID) throw new Error('CLOUDFLARE_ACCOUNT_ID is not set');
if (!process.env.CLOUDFLARE_DATABASE_ID) throw new Error('CLOUDFLARE_DATABASE_ID is not set');
if (!process.env.CLOUDFLARE_D1_TOKEN) throw new Error('CLOUDFLARE_D1_TOKEN is not set');
export default defineConfig({
schema: './src/lib/server/db/schema.ts',
dialect: 'sqlite',
driver: 'd1-http',
dbCredentials: {
accountId: process.env.CLOUDFLARE_ACCOUNT_ID,
databaseId: process.env.CLOUDFLARE_DATABASE_ID,
token: process.env.CLOUDFLARE_D1_TOKEN,
},
verbose: true,
strict: true,
});