feat: 添加 Vercel Postgres 数据库支持

- 安装 @vercel/postgres 和 pg 依赖
- 创建 PostgresAdapter 适配器,兼容 D1 接口
- 创建 PostgresStorage 类,实现完整的 IStorage 接口
- 添加 Postgres 数据库初始化脚本和 schema
- 更 next.config.js 排除 Postgres 模块的客户端打包
- 添加 VERCEL_DEPLOYMENT.md 部署指南
- 支持 Vercel serverless 环境部署

注意事项:观影室功能在 Vercel 上不可用(需要 WebSocket 支持)
This commit is contained in:
foxNG
2026-02-08 00:37:37 +08:00
committed by mtvpls
parent e619cbe62a
commit 1d3a7f2732
9 changed files with 2682 additions and 4 deletions
+2
View File
@@ -22,6 +22,7 @@
"prepare": "husky install",
"watch-room:server": "node server/watch-room-standalone-server.js --port 3001 --auth YOUR_SECRET_KEY",
"init:sqlite": "node scripts/init-sqlite.js",
"init:postgres": "node scripts/init-postgres.js",
"db:reset": "rm -f .data/moontv.db .data/moontv.db-shm .data/moontv.db-wal && node scripts/init-sqlite.js"
},
"dependencies": {
@@ -91,6 +92,7 @@
"@types/node": "24.0.3",
"@types/node-fetch": "^2.6.13",
"@types/nodemailer": "^7.0.5",
"@types/pg": "^8.16.0",
"@types/react": "^18.3.18",
"@types/react-dom": "^19.1.6",
"@types/react-window": "^2.0.0",