2ccfac2d045cf4e33592c12d10adcb05c676be52
Datwyler Shooting Event System
Production-ready full-stack web app based on your original live score concept.
Stack
- Frontend: Vue 3 + Vite (pnpm)
- Backend: Go + Echo
- Database: SQLite
- Packaging: Single Docker image (frontend + backend)
Main Features
- Bilingual UI: Arabic and English
- Runtime RTL/LTR switching
- Admin avatar crop/fit tool (drag + zoom before saving)
- AI score advisor for proof images (Gemini-powered suggestion + optional apply)
- Two clean modes:
- View Only screen for players/coaches/audience
- Admin Control Panel (login required)
- Admin credentials (default):
- Username:
datwyler - Password:
datwyler
- Username:
Tournament Flow Implemented
- Admin registers players and assigns groups (no hard 6-player limit).
- View screen shows group assignment clearly.
- Admin enters preliminary scores.
- Overall ranking auto-calculates and highlights top 12 finalists.
- If rank #12 cutoff is tied, qualification tie-break stage appears.
- Top 12 split into final groups (1-6 and 7-12 seeds).
- Admin enters final scores.
- Podium is determined automatically.
- If top-3 tie exists, podium tie-break stage appears.
API Documentation (OpenAPI)
Interactive docs are now built in:
- Swagger UI:
GET /api/docs - OpenAPI JSON:
GET /api/openapi.json
Testing with Auth in Swagger UI
- Open
/api/docs. - Use the Login & Authorize form at the top:
- Username:
datwyler(default) - Password:
datwyler(default)
- Username:
- The page calls
POST /api/admin/login, retrieves the token, and auto-authorizes Swagger. - Use Try it out on any admin endpoint.
Stage Values
For score update/proof/advice endpoints (/api/admin/scores/{stage}/...), use:
prelim_r1prelim_r2prelim_r3final_r1final_r2prelim_tiebreakfinal_tiebreak
For reset endpoint (POST /api/admin/scores/{stage}/reset), use:
preliminaryfinalprelim_tiebreakfinal_tiebreak
Local Development
Install dependencies:
make install
Run backend + frontend together:
make dev
Notes:
- Backend dev port is
18081. - Frontend runs on
5173(or next free port, e.g.5174if busy). - Frontend proxy is configured so
/api/*works from Vite dev server.
Run individually:
make dev-backend
make dev-frontend
Build
make build
This builds frontend assets, copies them into backend web/, and compiles backend binary.
Docker
Build image:
make docker-build ARCH=amd64
# or
make docker-build ARCH=arm64
Run image:
make docker-run ARCH=amd64
# or
make docker-run ARCH=arm64
Docker Compose (Production)
- Copy environment template:
cp .env.example .env
-
Edit
.envfor production credentials/tag. -
Start service:
docker compose up -d
- Check health:
docker compose ps
- View logs:
docker compose logs -f
Runtime Environment Variables
PORT(default8080)DB_PATH(default./data/shooting.db)WEB_DIR(default./web)ADMIN_USER(defaultdatwyler)ADMIN_PASS(defaultdatwyler)GEMINI_API_KEY(required for AI score advisor)GEMINI_MODEL(defaultgemini-2.0-flash)
Description
Languages
C
63.1%
Elixir
31.9%
JavaScript
1.5%
Erlang
1.3%
Vue
0.9%
Other
1.3%