# Setup guide

## Prerequisites

Node 18+, and either Expo Go on your phone or an iOS/Android simulator.

## Get it running

```bash
npm install
cp env.example .env
npm run start
```

Press `i` for iOS, `a` for Android, `w` for web, or scan the QR code with Expo Go.

You don't need to fill in `.env` to try the app - it'll run against the seeded in-memory data without external payment providers.

## Logging in without setting anything up

The database seeds itself with four accounts on first run, all using the password `password123`:

| Email | Name | Balance | Verified |
|---|---|---|---|
| alex@zendo.com | Alex Morgan | $1,247.50 | yes |
| sarah@zendo.com | Sarah Chen | $523.25 | yes |
| marcus@zendo.com | Marcus Williams | $892.00 | yes |
| priya@zendo.com | Priya Patel | $345.75 | no |

Or just tap "Try the demo" on the login screen - that runs entirely client-side against `lib/demo-ledger.ts`, no account needed.

## Deploying

**App:** `eas build --platform all` (you'll need an Expo account and `eas-cli` installed). For just the web build, `npm run build` outputs static files you can host anywhere.

**Backend:** `backend/http-app.ts` is a standard Node server — deploy it on a VPS, AWS, or any Docker host. Point `EXPO_PUBLIC_API_BASE_URL` at it once it's live.

Before going to production: swap the in-memory store for a real database (see the README), generate a real `JWT_SECRET` (`openssl rand -base64 32`), and wire in a production payment provider.

## Common issues

- **"Cannot find module"** - `rm -rf node_modules && npm install`
- **Add-money flow is simulated** - this build does not move real funds via an external processor
- **Port 8081 already in use** - `lsof -ti:8081 | xargs kill -9`
- **Logged out unexpectedly** - the JWT expires after 7 days; just log back in
