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

# Self-hosting

> Alchemy deploys, wrangler develops, queues and cron included.

# Self-hosting

## Develop

```bash theme={null}
bun install
bunx --cwd apps/api wrangler dev --port 18887   # D1/R2/queues/DO simulated
bun --cwd apps/web dev                          # :5173, proxies /api/v0/*
bunx --cwd packages/db prisma migrate dev       # console auth DB
```

Outbound mail providers: `log` (default, dev) · `mailchannels` (keyless) ·
`resend` (+ `RESEND_API_KEY`). Inbound arrives through Email Routing
(`email()` handler) or `POST /v0/internal/inbound` in dev. Scheduled drafts
drain on the `*/5 * * * *` cron; Miniflare needs `--test-scheduled`.

## Deploy

```bash theme={null}
bun --cwd infra deploy        # alchemy → prod: D1, R2, queues, DO namespace, Worker
bun --cwd apps/web deploy     # opennextjs-cloudflare
```

`infra/alchemy.run.ts` is the whole data plane as code — bindings, crons
and queue consumers included. Custom domains for sending need real DNS +
`OUTBOUND_PROVIDER` set; verification runs live DNS-over-HTTPS checks.

## Repo map

`apps/api` (Hono + Effect) · `apps/web` (Next + Better Auth) ·
`packages/shared` (Zod contracts) · `packages/db` (Prisma) ·
`packages/sdk` · `packages/cli` · `infra` (Alchemy) · `docs` (this site).
