System Architecture

Infrastructure topology
and design principles.

A non-custodial SaaS API routing layer for Namibian commerce. Feasable routes data, not money. Every architectural decision preserves this boundary.

Money Flow

The critical diagram. Money never passes through Feasable. Gateways settle directly to the merchant's verified bank account. Feasable records the transaction, calculates the routing fee, and invoices monthly.

Step 1

Customer

Initiates checkout on merchant site

Step 2

Feasable API

Creates session, routes to provider

Step 3

Payment Gateway

Processes card, 3DS, confirmation

Step 4

Merchant Bank

Gateway settles directly, Feasable never touches funds

Non-Custodial Revenue Collection

Feasable's revenue comes from monthly SaaS subscription fees and per-transaction routing commissions, billed via invoice. Merchant pays Feasable separately from the transaction flow. This model places Feasable outside the scope of the Payment System Management Act, 2023 (Act No. 14 of 2023).

Infrastructure Layers

Six layers, each with a single responsibility. The entire stack is designed to be operated by a small engineering team. Automation replaces headcount.

Edge Gateway

api.feasable.org
Cloudflare Workers

WAF, DDoS protection, edge authentication, and token-bucket rate limiting per API key. Webhook ingestion validates signatures at the edge before forwarding to the core engine.

Core API Engine

Internal
Hono · TypeScript

Stateless REST API. Handles checkout session creation, provider failover routing, transaction state management, and webhook dispatch. Horizontally scalable with no server-side sessions.

Database Layer

Supabase
PostgreSQL + RLS

Multi-tenant PostgreSQL with Row-Level Security enforced at the database level. Even a code bug cannot leak cross-tenant data. Sandbox and Live environments coexist, isolated by RLS policies.

Queue & Cache

Upstash
QStash + Redis

Serverless message queue for webhook delivery, notifications, monthly invoicing, and provider health checks. Redis for API key caching, rate limit counters, and idempotency deduplication.

Observability

Axiom
Centralized Logging

Every request is tagged with x-feasable-request-id. Full JSON payload audit trail. Structured log querying with 30-day retention. Every state change is searchable and traceable.

Document Storage

Cloudflare R2
Zero-Egress Object Storage

KYC documents stored as encrypted objects with signed URLs. Never publicly accessible. Zero egress costs. Tenant-isolated by design.

Design Principles

Every architectural decision is measured against these constraints. No exceptions. No compromises.

Non-Custodial First

Feasable never holds, pools, or escrows merchant funds. Gateways settle directly to merchant bank accounts. This places the system outside the scope of the Payment System Management Act, 2023.

Stateless API

JWT and API keys. No server-side sessions. Every request is self-contained and independently verifiable. Horizontally scalable without session affinity.

Event-Driven

State changes push to queues. No synchronous chains that can cascade-fail. Webhook delivery, notifications, and billing are decoupled from the transaction path.

Tenant Isolation

PostgreSQL Row-Level Security enforces data boundaries at the database level. Sandbox and Live data coexist but are RLS-enforced to never cross.

Provider Agnostic

A TypeScript driver abstraction means adding a new payment gateway is a single file. The core engine never changes. Failover routing is automatic.

Observable

Every request gets a unique ID. Every state change writes to an immutable audit log. Every payload is searchable in Axiom. No black boxes.

Subdomain Topology

api.feasable.orgCore API gatewayCloudflare Worker → Render
pay.feasable.orgHosted checkout redirect pagesCloudflare Pages
console.feasable.orgMerchant control plane dashboardCloudflare Pages
docs.feasable.orgDeveloper API documentationCloudflare Pages

Ready to integrate?

The API reference covers every endpoint, payload, and webhook event. Start in sandbox, no paperwork required.