sirily 9641678fa3 feat: add renewal invoice sweep (#20)
Refs #9

## Summary
- add a worker-side renewal invoice sweep that creates one invoice 72 hours before subscription expiry
- expire elapsed pending invoices automatically and email users when an automatic renewal invoice is created
- stop auto-recreating invoices for the same paid cycle once any invoice already exists for that cycle
- document the current renewal-invoice and pending-invoice expiry behavior

## Testing
- built `infra/docker/web.Dockerfile`
- ran `pnpm --filter @nproxy/db test` inside the built container
- verified `@nproxy/db build` and `@nproxy/web build` during the image build
- built `infra/docker/worker.Dockerfile`

Co-authored-by: sirily <sirily@git.shararam.party>
Reviewed-on: #20
2026-03-11 12:33:03 +03:00
2026-03-10 14:03:52 +03:00
2026-03-10 14:03:52 +03:00
2026-03-10 14:03:52 +03:00
2026-03-10 14:03:52 +03:00
2026-03-10 14:03:52 +03:00
2026-03-10 14:03:52 +03:00

nproxy

Product codebase for a crypto-subscription image gateway.

The repository contains:

  • runtime applications and shared packages;
  • the agreed system plan and architecture documents;
  • operational notes for deployment, Telegram pairing, and provider key rotation;
  • directory-scoped instructions so Codex runs implement against the same decisions.

Chosen baseline

  • Product: B2C website
  • Billing: one monthly plan, paid with crypto through a payment processor
  • Model support: starts with nano_banana
  • Generation modes: text-to-image and image-to-image
  • Infra target: one VPS with Docker Compose
  • Admin surfaces: web admin and Telegram bot
  • Key management: multiple provider keys with round-robin routing, failover, cooldown, balance tracking, and optional per-key proxy

Main directories

  • apps/ runtime entrypoints
  • packages/ shared domain and adapter code
  • docs/ source-of-truth planning documents
  • infra/ deployment templates
  • scripts/ operational helpers

Read first

  • docs/plan/system-plan.md
  • docs/architecture/system-overview.md
  • docs/ops/deployment.md
  • CONTRIBUTING.md
Description
Proxy chat for image generators
Readme 427 KiB
Languages
TypeScript 94.7%
JavaScript 3.6%
Dockerfile 1.7%