Documentation

Implementation notes for the IRAN Gateway application, Supabase integration, and payment workflow.

Application shell

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.

  • Next.js App Router
  • Pi authentication provider
  • Language provider
  • Shared page primitives

Supabase contract

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.

  • Profiles bind Pi identity.
  • Escrows hold transaction state.
  • Payments store callback review data.
  • Disputes and logs support auditability.

API behavior

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.

Deployment checks

Staging must pass lint, TypeScript, build, route checks, and API smoke checks before any production deployment is considered.