Implementation notes for the IRAN Gateway application, Supabase integration, and payment workflow.
The Next.js app keeps public navigation, Pi authentication, language context, and the enforced dark interface in the shared wrapper. Client views use the existing IRAN Gateway components and design tokens.
The baseline migration defines profiles, escrows, payments, disputes, and escrow action logs with row level security enabled. Public anon access is blocked unless explicit policies are added.
API routes return structured envelopes with ok, mode, missing, message, and data fields. Fallback means configuration is absent; blocked means Supabase denied or rejected the request.
Staging must pass lint, TypeScript, build, route checks, and API smoke checks before any production deployment is considered.