First step of the folder/video refactor. Adds an app-local SQLite DB at
data/app.db with schema for nested folders (max 2 levels enforced in
code, not SQL) and user-editable globally-unique video IDs.
- src/db.ts: open + WAL + schema (folders, videos) + partial unique
index for top-level folder names (NULL parent_id case)
- One-shot disk-tree migration: on first start scans data/folders/*
and seeds folder rows; reads each {videoId}/meta.json to seed video
rows. Skips invalid/missing meta gracefully.
- Wired into app.ts startup before routes mount.
- gitignore: data/app.db* (DB + WAL/journal sidecars).
Schema only — no routes or store.ts changes yet. Next step swaps the
file-based store calls to DB-backed equivalents.
Smoke-tested on the current data dir: 3 folders migrated, 0 videos
(folders were empty). Build (npx tsc) passes.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
31 lines
805 B
JSON
31 lines
805 B
JSON
{
|
|
"name": "make-video-site",
|
|
"version": "0.1.0",
|
|
"description": "영상 업로드 및 저장을 위한 사이트",
|
|
"type": "module",
|
|
"main": "dist/app.js",
|
|
"scripts": {
|
|
"setup": "node scripts/setup.mjs",
|
|
"build": "tsc -p tsconfig.json",
|
|
"start": "node dist/app.js",
|
|
"dev": "tsc -p tsconfig.json && node dist/app.js"
|
|
},
|
|
"dependencies": {
|
|
"@types/better-sqlite3": "^7.6.13",
|
|
"better-sqlite3": "^12.10.0",
|
|
"dotenv": "^16.6.1",
|
|
"ejs": "^3.1.10",
|
|
"express": "^4.19.2",
|
|
"express-session": "^1.18.0",
|
|
"multer": "^1.4.5-lts.1"
|
|
},
|
|
"devDependencies": {
|
|
"@types/ejs": "^3.1.5",
|
|
"@types/express": "^4.17.21",
|
|
"@types/express-session": "^1.18.0",
|
|
"@types/multer": "^1.4.11",
|
|
"@types/node": "^22.5.0",
|
|
"typescript": "^5.5.4"
|
|
}
|
|
}
|