api specs

This commit is contained in:
2026-04-29 00:45:48 +04:00
parent 27143319e3
commit 8cda54548f
67 changed files with 5052 additions and 93 deletions

51
phoenix/README.md Normal file
View File

@@ -0,0 +1,51 @@
# 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`)