No description
  • TypeScript 93.9%
  • JavaScript 2.1%
  • Shell 1.9%
  • Python 1.6%
  • Dockerfile 0.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
egoreast d8912c8668
All checks were successful
CI / check-and-build (push) Successful in 39s
chore: set explicit WORKDIR in production image
2026-11-07 10:43:45 +03:00
.forgejo/workflows ci: pass first admin and direct postgres host to the API env 2026-11-04 16:48:38 +03:00
.husky chore: import from slovo-propovedi-backend f333ef9 (v0.18.1) 2026-11-04 10:24:17 +03:00
docs chore: remove remaining references to the original project 2026-11-07 10:20:41 +03:00
scripts chore: mix pdf, txt and md demo scripts 2026-11-06 21:41:25 +03:00
seed/demo chore: mix pdf, txt and md demo scripts 2026-11-06 21:41:25 +03:00
sql feat!: auth everywhere, private files and spot approval statuses 2026-11-04 15:28:47 +03:00
src feat!: support txt and markdown scripts (drop fb2) 2026-11-06 21:41:20 +03:00
test chore: import from slovo-propovedi-backend f333ef9 (v0.18.1) 2026-11-04 10:24:17 +03:00
.dockerignore chore: import from slovo-propovedi-backend f333ef9 (v0.18.1) 2026-11-04 10:24:17 +03:00
.env.example docs: move the stand to dubl.lightnode.ru 2026-11-05 00:07:09 +03:00
.gitignore chore: remove agent scaffolding, renovate and DCO sign-off 2026-11-04 10:39:03 +03:00
.prettierrc chore: import from slovo-propovedi-backend f333ef9 (v0.18.1) 2026-11-04 10:24:17 +03:00
AGENTS.md docs: move the stand to dubl.lightnode.ru 2026-11-05 00:07:09 +03:00
CHANGELOG.md chore: bump version to 0.3.0 2026-11-05 23:40:06 +03:00
CLAUDE.md chore: import from slovo-propovedi-backend f333ef9 (v0.18.1) 2026-11-04 10:24:17 +03:00
Dockerfile chore: set explicit WORKDIR in production image 2026-11-07 10:43:45 +03:00
eslint.config.mjs chore: remove agent scaffolding, renovate and DCO sign-off 2026-11-04 10:39:03 +03:00
nest-cli.json chore: import from slovo-propovedi-backend f333ef9 (v0.18.1) 2026-11-04 10:24:17 +03:00
orval.config.mjs feat!: rename the API to Dubl (clients, campaigns, spots) 2026-11-04 11:38:48 +03:00
package-lock.json chore: bump version to 0.3.0 2026-11-05 23:40:06 +03:00
package.json chore: bump version to 0.3.0 2026-11-05 23:40:06 +03:00
README.md docs: move the stand to dubl.lightnode.ru 2026-11-05 00:07:09 +03:00
tsconfig.build.json chore: import from slovo-propovedi-backend f333ef9 (v0.18.1) 2026-11-04 10:24:17 +03:00
tsconfig.json chore: import from slovo-propovedi-backend f333ef9 (v0.18.1) 2026-11-04 10:24:17 +03:00

Дубль — API

NestJS + TypeORM + PostgreSQL 18 + MinIO backend for «Дубль», an app for audio-ad agency staff: clients, campaigns and spots (audio ads) with an approval workflow. It serves the mobile app and the PWA from dubl-mobile; there is no separate web panel.

  • Everything needs a JWT except POST /auth/login, POST /auth/refresh and GET /health. Roles: admin, manager (manage the catalog and statuses), employee (read and listen); users and feature flags are admin only.
  • Files are private. MinIO keys are stored in the DB; every response turns artwork, audioUrl, scriptUrl, fileUrl into signed links valid for 15 minutes. An unsigned request gets 403.
  • Spot approval: draft → on_review → changes_requested | approved → on_air (PATCH /spots/{id}/status, a comment is optional; any other transition is 409).
  • No migrations: the schema is sql/bootstrap.sql, applied on first start to an empty database, together with the first admin from ADMIN_USERNAME / ADMIN_PASSWORD.

The contract is dubl-docs/openAPI.yaml (Swagger UI at https://docs.dubl.lightnode.ru); npm run gen:schemas generates the zod schemas in src/generated/. Detailed docs (in Russian) are in docs/; agent rules in AGENTS.md.

Local stand

docker run -d --rm --name dubl-pg -e POSTGRES_USER=dubl -e POSTGRES_PASSWORD=dev -e POSTGRES_DB=dubl \
  -p 55432:5432 postgres:18
docker run -d --rm --name dubl-s3 -e MINIO_ROOT_USER=dubladmin -e MINIO_ROOT_PASSWORD=devpass123 \
  -p 59000:9000 docker.io/pgsty/silo:RELEASE.2026-10-26T00-00-00Z server /data

npm install
cp .env.example .env      # point POSTGRES_* / MINIO_* at the containers above
npm run build
npm run seed              # schema + demo catalog + accounts admin, manager, employee, employee2
npm run start:prod        # http://localhost:3000

npm run seed recreates the whole stand: 5 fictional clients, 8 campaigns and 19 spots in all five statuses, each with audio, cover and a PDF script (seed/demo/, regenerated by scripts/make-demo-assets.py). Passwords come from SEED_<ROLE>_PASSWORD or are generated and printed once.

Checks

npm run lint
npm test                  # Jest unit tests
npm run build             # tsgo + tsc-alias
python3 scripts/smoke-api.py http://localhost:3000 admin <password>   # live 401/403/409/signed-link smoke

npm run test:e2e is the unused NestJS template and is not part of the checks (see docs/debt.md).

Deployment

A v* tag runs .forgejo/workflows/release.yml: it checks the tag against package.json, waits for CI, writes the env file on the server and runs scripts/vps-deploy.sh, which builds the image and restarts dubl-backend.service behind Traefik at https://api.dubl.lightnode.ru. PostgreSQL, PgBouncer, MinIO and Traefik are provisioned by dubl-infra; the CI variables and secrets are listed in its docs/deploying-apps.md.

License

Private / UNLICENSED (see package.json).