refactor: 重命名客户端工程

This commit is contained in:
Nixevol
2026-07-03 03:08:05 +08:00
parent b9e2b78fcd
commit 70a8528f41
35 changed files with 64 additions and 61 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
| 脚本 | 作用 |
| --- | --- |
| `python scripts/dev.py` | 本地开发:生成 .env → 起 MySQL/Redis → 构建 shared → 迁移+种子 → 同时启动 api/admin/h5 |
| `python scripts/dev.py` | 本地开发:生成 .env → 起 MySQL/Redis → 构建 shared → 迁移+种子 → 同时启动 api/admin/client |
| `python scripts/docker_build.py` | 构建:生成 .env → 构建前端静态 → 构建 API 镜像 |
| `python scripts/docker_dev.py` | Docker 运行全栈(`--down` 停止,`--logs` 看日志) |
+3 -3
View File
@@ -104,7 +104,7 @@ def build_env(cfg: dict) -> dict[str, str]:
"BASE_URL": app["base_url"],
"PUBLIC_TRACE_PATH": "/t",
"ADMIN_ORIGIN": f"http://localhost:{app['admin_port']}",
"H5_ORIGIN": f"http://localhost:{app['h5_port']}",
"CLIENT_ORIGIN": f"http://localhost:{app['client_port']}",
"DATABASE_URL": f'"{database_url}"',
"MYSQL_ROOT_PASSWORD": db["root_password"],
"MYSQL_DATABASE": db["name"],
@@ -381,7 +381,7 @@ def _free_port_psutil(port: int) -> bool:
def free_port(port: int) -> None:
"""结束本机占用指定端口的进程(释放上次的 api/admin/h5,并解除对 Prisma 引擎 DLL 的占用)。
"""结束本机占用指定端口的进程(释放上次的 api/admin/client,并解除对 Prisma 引擎 DLL 的占用)。
仅用于本地 node 服务,不要对 Docker 管理的端口使用。"""
try:
if _free_port_psutil(port):
@@ -426,7 +426,7 @@ _SERVER_MARKERS = (
"start:dev",
"dev:api",
"dev:admin",
"dev:h5",
"dev:client",
"nodemon",
)
+1 -1
View File
@@ -9,7 +9,7 @@ app:
api_port: 3000 # 后端 API 端口
base_url: "http://localhost:3000" # 公开访问基址(短链/二维码使用)
admin_port: 5173 # 后台管理开发端口
h5_port: 5174 # C 端溯源页开发端口
client_port: 5174 # 客户端溯源页开发端口
database: # MySQL
host: "localhost"
+4 -4
View File
@@ -2,7 +2,7 @@
# requires-python = ">=3.9"
# dependencies = ["pyyaml", "psutil", "pymysql"]
# ///
"""本地开发一键启动:生成 .env -> 起 MySQL/Redis -> 构建 shared -> 迁移+种子 -> 同时启动 api/admin/h5。
"""本地开发一键启动:生成 .env -> 起 MySQL/Redis -> 构建 shared -> 迁移+种子 -> 同时启动 api/admin/client。
用法:
python scripts/dev.py # 完整启动(首次会询问数据源:Docker 编排 / 手动连接)
@@ -152,7 +152,7 @@ def main() -> None:
# 0. 彻底清理上次残留服务(按命令行清掉 idle 的 nest --watch 监视器,避免其重启抢占端口;
# 同时解除对 Prisma 引擎 DLL 的占用,避免 generate EPERM)
ports = [app["api_port"], app["admin_port"], app["h5_port"]]
ports = [app["api_port"], app["admin_port"], app["client_port"]]
kill_project_servers(ports=ports)
time.sleep(1.5)
@@ -242,11 +242,11 @@ def main() -> None:
else:
print("[artveris] 后端 API 等待超时,仍继续启动前端(稍后会自动恢复)")
procs.append(popen("pnpm dev:admin", job=job))
procs.append(popen("pnpm dev:h5", job=job))
procs.append(popen("pnpm dev:client", job=job))
print("\n[artveris] 开发服务启动中:")
print(f" 后端 API : http://localhost:{app['api_port']}/api (文档 /api/docs)")
print(f" 管理后台 : http://localhost:{app['admin_port']}")
print(f" C 端 : http://localhost:{app['h5_port']}")
print(f" C 端 : http://localhost:{app['client_port']}")
print(" 按 Ctrl+C 退出全部。\n")
for p in procs:
p.wait()
+1 -1
View File
@@ -22,7 +22,7 @@ def main() -> None:
run("pnpm install")
run("pnpm build:shared")
run("pnpm --filter @artveris/admin build")
run("pnpm --filter @artveris/h5 build")
run("pnpm --filter @artveris/client build")
# 构建 API 镜像
run(f"{COMPOSE} build")
+1 -1
View File
@@ -35,7 +35,7 @@ def main() -> None:
run("pnpm install")
run("pnpm build:shared")
run("pnpm --filter @artveris/admin build")
run("pnpm --filter @artveris/h5 build")
run("pnpm --filter @artveris/client build")
# 启动全栈(含 API 镜像构建)
run(f"{COMPOSE} up -d --build")