> For the complete documentation index, see [llms.txt](https://wally-3.gitbook.io/wally-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wally-3.gitbook.io/wally-docs/developers/installation.md).

# Setup Guide

> Get the Wally project running on your local machine.

***

## Prerequisites

* **Node.js**: v18 or higher
* **npm**: v9 or higher
* **PostgreSQL**: Via [Neon](https://neon.tech/) (recommended) or local Docker instance

## Initial Setup

1. **Clone the repo**:

   ```bash
   git clone <repo-url>
   cd remesas-escrow
   ```
2. **Install dependencies**:

   ```bash
   npm install
   ```

***

## Backend (apps/api)

1. **Navigate to API**:

   ```bash
   cd apps/api
   ```
2. **Configure environment**: Copy `.env.example` to `.env` and fill in values (see [API Reference](https://wally-3.gitbook.io/wally-docs/technical/index-1.md) for required variables).
3. **Database migration**:

   ```bash
   npx prisma migrate dev
   ```
4. **Start development server**:

   ```bash
   npm run start:dev
   ```

   API runs at `http://localhost:4000`. GraphQL playground at `http://localhost:4000/graphql`.

***

## Web Frontend (apps/web)

1. **Navigate to web**:

   ```bash
   cd apps/web
   ```
2. **Configure environment**: Copy `.env.example` to `.env.local` with the API URL.
3. **Start development server**:

   ```bash
   npm run dev
   ```

   Web app runs at `http://localhost:3000`.

***

## Mobile (apps/mobile)

1. **Navigate to mobile**:

   ```bash
   cd apps/mobile
   ```
2. **Start Expo**:

   ```bash
   npm run start
   ```

***

## Wallet Extension (apps/wallet-ext)

1. **Navigate to extension**:

   ```bash
   cd apps/wallet-ext
   ```
2. **Build**:

   ```bash
   npm run build
   ```
3. **Load in Chrome**: Go to `chrome://extensions`, enable Developer mode, click "Load unpacked", select the `dist/` folder.

***

## Shared Packages

### wallet-core

```bash
cd packages/wallet-core
npm run build
npm run test  # Vitest
```

### wallet-sdk (@wally/connect)

```bash
cd packages/wallet-sdk
npm run build
```

***

## Running Tests

```bash
# API unit tests
cd apps/api && npx jest --no-coverage

# wallet-core unit tests
cd packages/wallet-core && npx vitest run
```

***

## Stellar Configuration

### Testnet

* Horizon: `https://horizon-testnet.stellar.org`
* Soroban RPC: `https://soroban-testnet.stellar.org`
* Fund test accounts at [Stellar Friendbot](https://friendbot.stellar.org)

### Mainnet

* Horizon: `https://horizon.stellar.org`
* Soroban RPC: `https://soroban-rpc.mainnet.stellar.org`
* Requires real XLM for transaction fees
