Microservices Ready

微服务化拆分建议

当前项目还是一个单体 Next.js 应用,但我已经把服务层开始按模块拆分,后续可以平滑拆成多个微服务。

gateway-service

负责 /api/v1/chat/completions、/api/v1/models、/api/v1/embeddings 统一网关能力。

admin-service

负责后台管理、用户、渠道、模型、API Key、日志查询。

billing-service

负责余额扣费、套餐额度、账单流水、充值记录。

rate-limit-service

负责 Redis 限流、配额控制、风控。

health-service

负责 MySQL、Redis、上游连通性探活和告警。

docs-service

负责客户对接文档、OpenAPI、SDK 示例。

当前目录已开始微服务化

src/
  app/
    api/
    docs/
  lib/
  services/
    health/
      system-status.ts