# Shooting Event Phoenix Backend This folder contains a Phoenix + SQLite implementation of the existing Go API contract used by the Vue frontend. ## Run (dev) ```bash cd phoenix mix deps.get mix ecto.create mix ecto.migrate PORT=8080 mix phx.server ``` Or from project root: ```bash make phoenix-dev ``` ## Build ```bash make phoenix-build ``` ## API compatibility The Phoenix app exposes the same `/api/*` endpoints currently used by the Vue app, including: - Public: - `GET /api/health` - `GET /api/state` - `GET /api/events` (SSE) - Admin: - `POST /api/admin/login` - `POST /api/admin/logout` - `GET /api/admin/state` - `PUT /api/admin/settings` - Player CRUD + auto-group - Score/proof update/delete + reset - AI score advice endpoint ## Environment - `PORT` (default: `8080`) - `DB_PATH` (default: `../data/shooting_phoenix.db`) - `ADMIN_USER` (default: `datwyler`) - `ADMIN_PASS` (default: `datwyler`) - `GEMINI_API_KEY` (default follows existing project fallback) - `GEMINI_MODEL` (default: `gemini-3.1-flash-lite-preview`)