> ## Documentation Index
> Fetch the complete documentation index at: https://0xramp-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 0xramp Technical Architecture: Stack and Components

> A high-level overview of 0xramp's stack: React/Vite frontend, Express API, P2P.me SDK, and NEAR Intents integration for developers and contributors.

0xramp is a non-custodial fiat ↔ crypto on/off-ramp built on a lightweight, composable stack. This page gives developers and contributors a mental model of how the pieces fit together — what 0xramp builds and owns, and what it delegates to best-in-class protocol SDKs.

## Stack Overview

| Layer                  | Technology                                         | Role                                                                 |
| ---------------------- | -------------------------------------------------- | -------------------------------------------------------------------- |
| **Frontend**           | React + Vite (TypeScript)                          | User-facing web app — quote display, wallet connection, order status |
| **Backend**            | Express.js API                                     | Session coordination and order state management                      |
| **Sessions**           | PostgreSQL                                         | Session state only — not a general-purpose data store                |
| **P2P.me integration** | `@p2pdotme/sdk`                                    | Identity, Pix matching, USDC escrow on Base                          |
| **Asset conversion**   | NEAR Intents                                       | USDC → target asset swaps                                            |
| **Wallet support**     | Rabby, Phantom; thirdweb (configuration-dependent) | External wallet connection; smart accounts via P2P.me                |

## How the Layers Interact

When a user initiates a transaction in the UI, the React frontend sends the order parameters to the Express API, which coordinates session state and order lifecycle. The Express layer invokes the `@p2pdotme/sdk` to place the on-chain order, match a Pix counterparty, and manage USDC escrow on Base. Once USDC is settled, NEAR Intents executes the conversion into the user's target asset (e.g. ZEC, SOL, ETH). Status updates from both P2P.me and NEAR Intents are surfaced back through the API and reflected in real time in the frontend UI.

```text theme={null}
User (browser)
    │  React + Vite
    ▼
Express API  ──────────────►  @p2pdotme/sdk
    │                         (identity · Pix matching · USDC escrow on Base)
    │
    └──────────────────────►  NEAR Intents
                              (USDC → target asset conversion)
```

## What 0xramp Owns vs. What It Delegates

<CardGroup cols={2}>
  <Card title="0xramp owns" icon="house">
    * Product UX and quote presentation
    * Session correlation and order status display
    * Wallet connection surface (Rabby, Phantom, thirdweb)
    * Frontend routing and state management
    * Express API orchestration layer
  </Card>

  <Card title="Delegates to protocols" icon="arrow-right-arrow-left">
    **P2P.me** — identity, KYC, Pix matching, USDC escrow, reputation and limits

    **NEAR Intents** — USDC ↔ target asset swaps
  </Card>
</CardGroup>

<Note>
  0xramp does not fork or heavily customize P2P.me's core SDK — it uses the pure `@p2pdotme/sdk` integration path.
</Note>

## Source Code

0xramp is open source. The GitHub organization is at [github.com/0xramp](https://github.com/0xramp). Specific repository URLs will be linked here when public.

Architecture Decision Records (ADRs) documenting significant technical choices will also be linked from this page when published.

<Info>
  **TODO:** Add link to the public repository and ADR directory when available.
</Info>
