1.6 KiB
1.6 KiB
Backend RTK
Architecture
- Framework: NestJS + TypeScript.
- Package manager: pnpm.
- Data access: Prisma Client and Prisma migrations.
- Default local behavior: seeded project configuration keeps APIs runnable while MySQL is not configured; production uses real Jenkins and Gitea clients when credentials are injected.
Module Map
config: environment schema and validation.prisma: PrismaService and DB health boundary.health: runtime and dependency summary.projects: project configuration API and repository.deploy-runs: deploy run API, status model, BPMN step summary.integrations/jenkins: Jenkins API client boundary.integrations/gitea: Gitea API client boundary.notifications/wecom: current WeCom adapter boundary; notification provider abstraction is kept for future Feishu or generic webhook adapters.agent: LLM proxy client boundary for DevOps-only workflows.audit: sanitized audit record boundary.
Data Access Rules
- Controllers call services.
- Services call repositories and integration clients.
- Repositories call Prisma.
- Raw SQL is exceptional and repository-only.
- Transactions are required for deploy run writes once persistence is enabled.
Environment Rules
.env.examplemay contain placeholders only..envis local-only and ignored by git.- Missing external integration configuration should degrade to
not_configuredin health checks, not crash local development.
Verification
Run these before handing off backend changes when dependencies are available:
pnpm install
pnpm prisma:generate
pnpm lint
pnpm test
pnpm build