# wallet_web

**OTP app:** `:wallet_web`
**Module namespace:** `WalletWeb.*`
**Owner:** Platform Team

## Responsibilities
- HTTP/API and BFF delivery layer for web, admin, and partner/mobile clients.
- Request validation, auth enforcement (delegated to `wallet_auth`), response shaping.
- Serves the canonical JSON error envelope and success envelope defined in `wallet_api_contracts`.
- Does NOT implement any financial domain logic (ADR 0001 forbidden).

## Public Interface
This is the entry-point app. It exposes HTTP endpoints only; it has no public Elixir API consumed by other apps.

### Inbound HTTP Routes (current skeleton)
| Method | Path | Handler |
|---|---|---|
| GET | `/` | `WalletWeb.PageController.home/2` |
| GET | `/dev/dashboard` | Phoenix LiveDashboard (dev only) |
| GET | `/dev/mailbox` | Swoosh mailbox preview (dev only) |

## Allowed Dependencies (ADR 0001)
- `wallet_shared_kernel` - ID/Money/Correlation primitives
- `wallet_api_contracts` - error/success envelope construction
- `wallet_observability` - telemetry and audit emission
- Domain apps via public service interfaces only (Phase 2+)

## Forbidden
- Implementing financial domain logic directly
- Reading another app's database tables
- Circular dependencies

## Configuration
All config keys are under the `:wallet_web` OTP app atom.
Key settings in `config/config.exs`:
- `WalletWeb.Repo` - MySQL database connection
- `WalletWeb.Endpoint` - Bandit HTTP server on port 24000 (dev)
- `WalletWeb.Mailer` - Swoosh local adapter (dev)

## Running Locally
```bash
# From umbrella root
mix phx.server

# Run tests
mix test apps/wallet_web
```
