Documentation
Getting started
Run the Astro site and Phoenix control plane locally, then walk the current alpha workflow.
Getting started
TextTree is split into two apps:
apps/sitefor the public Astro siteapps/webfor the Phoenix app, developer API, webhooks, and MCP endpoints
Local workflow
- Install Node 22+, Elixir 1.19+, Erlang/OTP 28+, and PostgreSQL.
- Copy
apps/web/.env.exampletoapps/web/.env.local. - Copy
apps/site/.env.exampletoapps/site/.env.local. - Generate a Proton SMTP Submission token before sending real local email.
- Run
pnpm setupfrom the repo root. - Start Astro with
pnpm --dir apps/site dev. - Start Phoenix with
cd apps/web && mix phx.server.
Local URLs
- Astro public site:
http://localhost:4321 - Phoenix app and API:
http://localhost:4001
Environment groups
Environment variables are scoped by responsibility:
- Phoenix local runtime:
apps/web/.env.local - Astro local public config:
apps/site/.env.local - production deploy/admin operations:
devops/env/prod.env.local - test deploy/admin operations:
devops/env/test.env.local
Do not use root env files. Only scoped example files are committed.
Auth mode
Set TEXTREE_AUTH_MODE in the Phoenix runtime environment to choose which
signup and login methods are visible.
| Value | Signup/login UI | Enabled behind the scenes | Email delivery required? | Typical use |
|---|---|---|---|---|
magic_link_or_ethereum | Email magic link and Ethereum wallet only. Solana, Google, and email/password are hidden. | Email magic link, email/password, and Ethereum wallet. | Yes, configure SMTP. | Current default launch mode. |
wallet_only | Ethereum and Solana wallet buttons only. Email magic link, Google, and email/password are hidden. | Ethereum and Solana wallet. | No. | Crypto-only launch or unverified email delivery. |
wallet_first | Wallet buttons, Google, email magic link, and email/password. | Wallets, Google, email magic link, and email/password. | Yes, configure SMTP. | Broad auth surface after email and OAuth are verified. |
full | Google, email magic link, email/password, and wallet buttons. | Google, email magic link, email/password, and wallets. | Yes, configure SMTP. | Full browser-auth surface for later launches. |
For any mode that shows email magic links, set TEXTREE_MAILER_ADAPTER=smtp
and the TEXTREE_SMTP_* variables before launch, then run
mix textree.email.test recipient@example.com.
First-run alpha workflow
Once the stack is up:
- Sign up or log in through TextTree at
/signupor/login, or create a headless agent account withPOST /api/v1/accountsorPOST /mcp/accounts. - Open
/app. - Create or retrieve a TextTree
txt_...bearer access token withmessages:write. - Add prepaid SMS balance with a USDC funding invoice.
- Poll the invoice status until the balance is credited.
- Confirm the recipient is not under a workspace suppression.
- Use the TextTree bearer access token against
POST /api/v1/messages. - Poll
GET /api/v1/messages/:idor inspect/appfor provider and funding state.
Programmatic onboarding
The current API exposes account bootstrap and launch setup for authenticated users and agents:
POST /api/v1/accountsfor username/password headless account creationPOST /mcp/accountsfor the same headless bootstrap over the MCP namespaceGET /api/v1/onboardingwithonboarding:readPOST /api/v1/onboarding/api-keywithonboarding:writeto issue a scopedtxt_...bearer tokenPOST /api/v1/onboarding/funding-invoiceswithonboarding:writeGET /api/v1/onboarding/funding-invoices/:idwithonboarding:readPOST /api/v1/onboarding/branded-requestwithonboarding:write
Headless bootstrap returns one-time backup codes and a txt_... TextTree
bearer token with API/MCP scopes. The same funding status is available to agents through
onboarding.status, onboarding.create_invoice, and
onboarding.invoice_status MCP tools.
Verification commands
pnpm testpnpm verifypnpm app:testpnpm www:checkpnpm www:build
What the current alpha guarantees
- stable route namespaces
- Neon-ready Ecto config
- Oban queues for messaging and webhook work
- Phoenix-native auth and local identity normalization
- workspace and campaign suppression enforcement
- provider STOP/opt-out reconciliation into workspace suppressions
- spend authorization before provider execution
- verified messaging and funding webhook ingestion
- MCP execution audits, quotas, and timeout policy
What is not public yet
The current alpha still keeps some critical setup inside the authenticated app rather than public API endpoints:
- workspace/campaign suppression management
- spend-limit management
- browser backup-code rotation after initial headless bootstrap