Initial commit of Step Admin panel

This commit is contained in:
Chaos
2026-03-24 21:33:48 +08:00
commit 81045c5d57
45 changed files with 4327 additions and 0 deletions

14
src/lib/server/db.ts Normal file
View File

@@ -0,0 +1,14 @@
import Database from 'better-sqlite3';
import { env } from '$env/dynamic/private';
import path from 'path';
// Store DB in the data directory
const dbPath = path.resolve('./data/app.db');
const db = new Database(dbPath);
db.pragma('journal_mode = WAL');
// Provide simple helper to get DB instance
export function getDb() {
return db;
}