# CLAUDE.md — 月子 SaaS 项目上下文 ## 部署信息 - **服务器**:`82.157.47.215`(root / Aiying88) - **前端**:`/var/www/saas/frontend`(Vue 3 静态 dist) - **后端**:`/var/www/saas/backend`(Laravel 12,PHP 8.3) - **仓库镜像**:`/var/www/saas/repo`(用于 git pull) - **Gitea 远程**:`git@git.20031227.de5.net:fengshao1227/yuezi-saas.git` ## 手动更新服务器 本地运行一键脚本(构建前端 → git push → SSH 触发服务器 pull + migrate): ```bash ./deploy.sh "feat: 描述变更" ``` 只更新服务器(跳过本地构建和 push): ```bash ssh root@82.157.47.215 '/var/www/saas/deploy.sh' ``` 查看部署日志: ```bash ssh root@82.157.47.215 'tail -50 /var/log/saas-deploy.log' ``` ## 服务器 deploy.sh 做的事 1. `git pull origin main`(在 `/var/www/saas/repo`) 2. rsync backend → `/var/www/saas/backend`(排除 `.env` / `vendor`) 3. 如果 `composer.json` 有变动,执行 `composer install` 4. `php artisan migrate --force` + 清缓存 5. rsync `frontend/dist/` → `/var/www/saas/frontend` ## 关键配置 - 后端 `.env` 在服务器,不入库,手动维护 - `bootstrap/app.php` 已移除 `statefulApi()`(用 Bearer Token 认证,无需 CSRF) - Nginx 配置:`/etc/nginx/conf.d/saas.conf` - PHP-FPM:`127.0.0.1:9000`