# yixin-backend **Repository Path**: gabr/yixin-backend ## Basic Information - **Project Name**: yixin-backend - **Description**: 一心服务器端 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-10-11 - **Last Updated**: 2026-11-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # yixin-backend 「一心」学佛内部学习 App 的后端服务。 - API:Python FastAPI - 数据库:MySQL(阿里云 RDS) - 对象存储:阿里云 OSS(私有 Bucket,预签名 URL 直连播放) - 管理后台:Vue3 + Vite(`admin/`) ## 目录结构(规划) ``` app/ FastAPI 应用 api/v1/ 业务接口 api/admin/ 管理接口 models/ SQLAlchemy 模型 schemas/ Pydantic schema services/ oss / auth / rbac / study core/ 配置与安全 alembic/ 数据库迁移 admin/ Vue3 管理后台 deploy/ systemd / nginx / 部署脚本 requirements.txt .env.example ``` ## 本地开发 ```bash python -m venv .venv .venv/Scripts/activate # Windows pip install -r requirements.txt cp .env.example .env alembic upgrade head uvicorn app.main:app --reload ``` ## 运维约定(数据安全) - 删除内容一律走后台「回收站」:先软删除,彻底删除在回收站里操作,这样有操作记录、OSS 才跟着清理。 - 清测试数据只用 `scripts/cleanup_test_data.py`(按标题前缀白名单,默认演练)。不要对整张 `contents` 表做无条件删除。 - Bucket 已开启版本控制:误删对象可以通过撤销 delete marker 恢复,删之前先确认影响范围。 - 恢复被误删内容时:标题来自 `audit_logs` 的「内容新增」,文件与内容的对应关系靠 OSS key 里的 content_id 与上传/创建时间对齐。