Files
nroxy/docs/architecture/repository-layout.md
2026-03-10 14:03:52 +03:00

1.3 KiB

Repository Layout

Tree

.
|- apps/
|  |- web/
|  |- worker/
|  |- bot/
|  `- cli/
|- packages/
|  |- config/
|  |- db/
|  |- domain/
|  `- providers/
|- docs/
|  |- plan/
|  |- architecture/
|  `- ops/
|- infra/
|  |- compose/
|  `- caddy/
`- scripts/

Directory responsibilities

apps/web

Owns the browser-facing product and HTTP API entrypoints. It should not own core business rules.

apps/worker

Owns asynchronous and scheduled work. It is the execution surface for image-generation jobs, cleanup, and health polling.

apps/bot

Owns Telegram admin interaction only. Business decisions still belong to packages/domain.

apps/cli

Owns operator-facing CLI commands such as nproxy pair, nproxy pair list, and nproxy pair revoke.

packages/config

Owns typed environment contracts and config normalization.

packages/db

Owns database schema, migrations, and data-access utilities.

packages/domain

Owns subscription logic, quota logic, key state transitions, and orchestration rules.

packages/providers

Owns provider-specific adapters and low-level HTTP calls. It should not decide business policy.

infra

Owns deployment templates and reverse-proxy configuration for the single-VPS Docker Compose target.