Herald

快速上手

你需要先装好

依赖版本要求用途
Python3.12+运行开发脚本
uv最新Python 版本管理和脚本执行
Docker能跑容器就行PostgreSQL、Redis
CargoRust 稳定版编译后端
npm最新前端依赖

uv 的安装:

curl -LsSf https://astral.sh/uv/install.sh | sh
uv python install 3.12
uv python pin 3.12

Windows 用户可以直接 powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex",或者去 GitHub Releases 下安装包。

启动服务

  1. 启动 PostgreSQL 和 Redis 容器,然后启动后端和前端:
# 1. 启动 PostgreSQL
docker run -d --name herald-postgres \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_PASSWORD=postgres \
  -e POSTGRES_DB=herald \
  -p 5432:5432 \
  postgres:18-alpine

# 2. 启动 Redis
docker run -d --name herald-redis \
  -p 6379:6379 \
  redis:8.4-alpine

# 3. 启动后端(会自动运行迁移)
cd backend
cargo run --bin herald-app

# 4. 启动前端(另一个终端)
cd frontend
npm install
npm run dev

验证

后端健康检查:

curl http://localhost:8080/health

在浏览器打开 http://localhost:3000 访问前端,Vite 提供热更新。

如果后端启动失败,先检查 PostgreSQL 和 Redis 容器是不是在跑(docker ps),再检查 config.toml 里的连接字符串。

下一步

服务跑起来后,打开 http://localhost:3000 进入前端界面。创建 realm 时指定的管理员用户具有超级管理员权限,可以邀请用户、配置权限。具体操作见架构了解各模块的职责。

On this page