Initial import

This commit is contained in:
sirily
2026-03-10 14:03:52 +03:00
commit 6c0ca4e28b
102 changed files with 6598 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
# Repository Layout
## Tree
```text
.
|- 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.