OTP Application module for Accrue — manages boot-time validation and the supervision tree.
What this is
Accrue follows an empty-supervisor pattern: it is a library, not a service. The supervisor starts with no children. Accrue does not start host-owned processes such as your Repo, Oban, ChromicPDF pool, or Finch pool — your application's supervision tree owns those.
What happens at boot
Before the (empty) supervisor starts, Accrue runs several validations:
Config schema check —
Accrue.Config.validate_at_boot!/0validates the:accrueapplication environment against the NimbleOptions schema. Misconfiguration fails loudly at startup, before any state is touched.Auth adapter safety check —
Accrue.Auth.Default.boot_check!/0refuses to start in:prodwhen:auth_adapterstill points at the dev-permissive default adapter.PDF adapter availability check — warns at boot if
Accrue.PDF.ChromicPDFis configured but no ChromicPDF supervisor child is running in the host app's supervision tree.Oban queue / PDF pool size check — warns if the
:accrue_mailersOban queue concurrency exceeds the ChromicPDF pool size, which can cause back-pressure on invoice email rendering.Connect webhook secret collision check — warns when a Connect endpoint's webhook signing secret is byte-identical to a platform endpoint secret. Stripe issues a separate signing secret for Connect endpoints in the Dashboard; mixing them causes silent signature verification failures. See
guides/connect.md.Company address / locale check — warns when customers have EU/CA preferred locales but
:branding[:company_address]is unset. CAN-SPAM/CASL require a physical postal address in transactional emails for those locales.
Host app integration
Accrue.Application is started automatically by OTP when :accrue is
listed as a dependency — host applications do not start it manually.
Ensure your config/runtime.exs is complete before the application
starts, as validation runs during start/2.