Backend Architecture
The backend is Django REST Framework with Celery-based asynchronous operations.
Main domains
accounts
chains
institutions
employees
payroll
transactions
fcc
withdrawals
confidential_credits
tee_lifecycle
notifications
scheduling
audit
Why the backend matters
Balary uses the backend to centralize transaction preparation and verification. That gives the browser a narrow action surface:
- request a prepared transaction,
- sign/broadcast it,
- return the hash,
- let backend receipt logic verify the exact transaction and event.
Confidential boundaries
Asynchronous operations
Celery is used for operations that can outlive one HTTP request, such as:
- pending receipt synchronization,
- FCC polling,
- TEE result reconciliation,
- email delivery,
- recurring schedule work.
API safety patterns
The current source uses:
- idempotency keys,
- row locking in critical reconciliation paths,
- strict serializers,
- role-based authorization,
- exact prepared-transaction confirmation,
- public readiness endpoints without private keys,
- encrypted recipient/private fields,
- explicit feature and lifecycle gates.