Skip to content

Repository files navigation

PaiGram Account Center

PaiGram Account Center is the product repository for unified PaiGram identity, authorization, platform account ownership, Mihomo credential operations, first-party management interfaces, and bot-consumer access.

The repository is a source-control boundary, not a runtime monolith. Account Center and Platform Mihomo remain independent processes with separate databases, configuration, credentials, and release lifecycles.

Repository layout

services/account-center/       Account Center service
services/platform-mihomo/      Mihomo platform service
contracts/proto/               Cross-service Protocol Buffer sources
contracts/gen/go/              Generated Go contract module
sdks/python/                   Async Python consumer SDK
frontend/                      User and administrator web applications
scripts/                       Local verification entrypoints

Dependency direction

  • The frontend calls Account Center's public interface.
  • Account Center owns users, roles, bindings, grants, and short-lived service tickets.
  • Platform Mihomo owns raw credentials, devices, refresh state, and platform lifecycle data.
  • The Python SDK hides transport and generated contracts from PaiGram consumers.
  • PaiGram remains an independent repository and pins an immutable SDK Git revision with uv.

Raw platform credentials must never be stored by Account Center, the SDK, or bot consumers.

Local verification

Files under scripts/ are CI-only entry points. During local development, determine the affected component and run its underlying formatter, linter, build, or test command directly from that component's directory.

Typical targeted checks include:

go test ./...
uv run pytest -q
bun test tests/unit

Database-backed Go tests require PAI_TEST_DATABASE_DSN (or PAI_DATABASE_DSN). Integration-tagged tests additionally require Docker or Podman.

The repository intentionally does not copy build or deployment systems from the source repositories.

Podman deployment

The complete Account Center stack can be built and run with Podman. A single Nginx entry point serves the user and admin frontends and proxies the API, while PostgreSQL, Redis, backend HTTP, and gRPC stay private to the container network. See deploy/podman/README.md for the local single-host workflow.

Regenerate Go and Python contract bindings directly when a .proto file changes:

bash ./contracts/generate.sh

About

Unified PaiGram identity, account, platform contracts, frontend, and consumer SDK

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages