feat: scaffold supabase multi-tenant backend

This commit is contained in:
Codex
2026-06-21 21:54:43 +08:00
commit c9c767c7bd
99 changed files with 36660 additions and 0 deletions

42
.env.example Normal file
View File

@@ -0,0 +1,42 @@
# 阿里云短信服务配置(脚本/服务端使用,前端不读取此文件)
# 复制此文件为 .env 并填写实际值
#
# 生产环境说明:
# - 学生端 https://tiku.tjszsb.com
# - 超管后台 https://tikuguanli.tjszsb.com
# - 服务器 39.107.64.207PocketBase 运行于 127.0.0.1:8090由 Nginx 反代)
#
# 前端Vite运行时 PocketBase 地址会根据 window.location 自动判断:
# - 本地开发 → http://127.0.0.1:8090
# - 线上部署 → 与页面同源Nginx 代理到后端)
# 因此前端代码无需配置服务器 IP本文件仅供 Node 脚本使用。
# PocketBase 地址(本地脚本连接用)
POCKETBASE_URL=http://127.0.0.1:8090
# 阿里云 AccessKey
ALIYUN_ACCESS_KEY_ID=your_access_key_id_here
ALIYUN_ACCESS_KEY_SECRET=your_access_key_secret_here
# 阿里云短信配置
ALIYUN_SMS_SIGN=天津专升本
ALIYUN_SMS_TEMPLATE=SMS_123456789
# 服务端口
PORT=3000
# 新 Supabase/PostgreSQL 重构 API
DATABASE_URL=postgresql://postgres:postgres@127.0.0.1:54322/postgres
DEFAULT_TENANT_SLUG=master
CORS_ORIGIN=http://127.0.0.1:5173,http://localhost:5173
# 认证迁移期配置:生产环境必须替换为高强度随机值
AUTH_SMS_PROVIDER=mock
AUTH_CODE_PEPPER=replace_with_a_long_random_secret
AUTH_SESSION_SECRET=replace_with_another_long_random_secret
AUTH_CODE_TTL_SECONDS=300
AUTH_SMS_COOLDOWN_SECONDS=60
AUTH_SESSION_TTL_SECONDS=604800
# 迁移期平台管理 API Key。生产环境应替换为平台管理员 JWT/服务端会话。
PLATFORM_ADMIN_API_KEY=replace_with_platform_admin_key