# VIPBoxLB Architecture

## Principles
- PostgreSQL is the source of truth. Excel is import/export/reporting, never the primary database.
- Wallet changes are ledger-backed and auditable.
- Inventory is modeled as assets and capacity/slots so one account can serve multiple duration products safely.
- Website, admin, supplier integrations and reseller API all use the same order/fulfillment domain.
- External providers are adapters. DailyCards/FazerCards can be disabled/replaced without changing product/order models.
- Sensitive credentials, PINs and supplier secrets must be encrypted at rest; never log plaintext secrets.
- Fulfillment must be idempotent to prevent duplicate charges/deliveries.

## Target modules
Auth & sessions; catalog; inventory; orders/fulfillment; wallet/payments; subscriptions/renewals; secure access/OTP; supplier adapters; support; Telegram/email notifications; admin; resellers; reseller API; Excel/import/export; reporting; audit/security.

## Background jobs
Redis/BullMQ will handle fulfillment retries, expiry scans, notifications, scheduled exports, supplier synchronization and webhook delivery.
