Infrastructure

Deployment Architecture

TypeScript Express backend on Railway, Next.js frontend dApp on Vercel, Soroban contracts on Stellar, with Supabase for audit logging and real-time agent activity tracking.

Full Deployment Topology

REAPP's infrastructure is split across four tiers: Vercel hosts the public-facing dApp and documentation, Railway hosts the Express API server and WebSocket service, Stellar hosts the Soroban contracts, and Supabase provides the off-chain audit log and mandate store. External services — the x402 facilitator, LaunchTube, and AP2 protocol — are treated as configurable dependencies with fallback options.

Full Infrastructure Topology
Railway handles all stateful backend logic. Vercel serves the static dApp and SSR pages. Supabase bridges the on-chain audit trail with off-chain queryable logs.

Express Backend Architecture

The Railway-hosted Express server exposes nine REST endpoints covering the full mandate lifecycle, payment flow, agent activity, and evaluator operations. The service layer is cleanly separated from routing — AP2ValidatorService, SorobanClient, and FacilitatorClient are injected dependencies that can be swapped for test doubles.

Express Backend Service Architecture
Railway deployment. The middleware stack enforces per-agent rate limits and JWT authentication before any mandate or payment operation is processed.

Environment Configuration

# Railway — Backend
STELLAR_NETWORK=testnet                    # testnet | mainnet
HORIZON_URL=https://horizon-testnet.stellar.org
SOROBAN_RPC_URL=https://soroban-testnet.stellar.org
MANDATE_REGISTRY_CONTRACT=C...            # Deployed contract address
FACILITATOR_URL=https://facilitator.x402stellar.xyz
LAUNCHTUBE_URL=https://launchtube.xyz
AP2_SPEC_VERSION=0.1.0
SUPABASE_URL=https://xxx.supabase.co
SUPABASE_SERVICE_KEY=...
JWT_SECRET=...
PORT=3001

# Vercel — Frontend
NEXT_PUBLIC_API_URL=https://api.reapprotocol.com
NEXT_PUBLIC_STELLAR_NETWORK=testnet
NEXT_PUBLIC_SUPABASE_URL=https://xxx.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=...

CI/CD Pipeline

Every push to main triggers a full pipeline: TypeScript type-checking, ESLint, Vitest unit tests, Next.js production build, and Soroban cargo tests. Successful pipelines deploy simultaneously to Vercel and Railway, followed by automated smoke tests and a testnet end-to-end mandate flow.

CI/CD Pipeline — GitHub Actions
PR builds deploy to Vercel preview environments. Main branch deploys to both Vercel production and Railway simultaneously, with automated testnet E2E verification.

Mainnet Readiness Checklist

OpenZeppelin facilitator✅ Available
Testnet + mainnet endpoints live
USDC via SAC✅ Deployed
Mainnet SAC active, SEP-41 compliant
Soroban contracts🔄 T4
Mainnet deploy in Tranche 4
LaunchTube sponsorship⚠️ Experimental
Not mission-critical — fallback configured
Freighter desktop✅ Supported
x402 auth-entry signing compatible
Freighter Mobile❌ Not yet
Post-mainnet roadmap
Contract audit🔄 T4
Internal review + community audit request
3 integrations🔄 T4
Community bounties fund external integrations