Skip to main content

Technical Architecture

This page summarizes Fiatsend’s end‑to‑end architecture. For deeper details, see in‑repo docs like apps/account-app/docs/technical-architecture.mdx and apps/contract/CONTRACT_ARCHITECTURE.md.

System Overview

Fiatsend enables crypto ↔ fiat conversions by orchestrating a web app, API routes, databases, blockchain interactions, and mobile money providers under strong security and compliance controls.

Component Diagram

graph TD
A[Next.js Frontend] --> B[API Routes]
B --> C[Appwrite DB/Auth]
B --> D[Mobile Money Providers]
B --> E[Blockchain (Stellar / EVM)]
A --> F[Privy Wallet Auth]
A --> G[Notifications]

Frontend

  • Next.js (TypeScript, App Router), Tailwind CSS
  • Auth: Privy wallet login; Wagmi/Viem for blockchain interactions
  • Realtime UX: Toasts, status polling, and optimistic updates

Backend/API

  • Next.js API routes
  • Integrations: Appwrite, KYC providers, mobile money APIs
  • Caching and rate limiting in critical paths

Data Layer

  • Appwrite collections for users, transactions, KYC, mobile money accounts, and audit logs
  • Strong indexing and retention policies

Blockchain Layer

  • Current: Solidity contracts for gateway and tokens
  • Planned: Stellar/Soroban contracts for conversion orchestration

Security & Compliance

  • JWT sessions, RBAC, audit logging
  • PII encryption at rest, TLS 1.3 in transit
  • Fraud/risk scoring and rate limiting

Deployment

  • Vercel for web + API routes
  • Appwrite managed or self‑hosted
  • Staging mirrors production with testnets/providers

Monitoring

  • Error tracking (e.g., Sentry)
  • Business metrics: transaction throughput, success rate, revenue

Scalability

  • Horizontal scaling for API routes
  • Read replicas/caching; microservices for high‑volume domains